AnsweredAssumed Answered

I2C is not working

Question asked by Raphael Prechtel on Dec 20, 2017
Latest reply on Mar 15, 2018 by Arna Lee

Hello,

 

I'm using the NHS3152 and want to use the I²C bus. I have tested the example of NXP but it doesn't work. Also I tried my own programm based on the example, which isn't working, too.

Is the programm tested for this chip?

 

I am not even getting a clock signal at the SCL pin. But perhaps I am doing something completely wrong.

Here is my main:

 

#include "board.h"
#include "NHS+MAX.h"
#define I2C_MASTER
#ifdef I2C_MASTER
    #include "master.h"
#endif

 

int main(void)
{
    if (I2C_SYSTEMCLOCK == NSS_SFRO_FREQUENCY) {
        Chip_Flash_SetHighPowerMode(true);
    }
    Chip_Clock_System_SetClockFreq(I2C_SYSTEMCLOCK);
    Board_Init();

 

#ifdef I2C_MASTER
    Master_Init_NHS();
    uint32_t MAX_ID;

 

    while (true) {
           MasterRead_MAX(0xFF,0x57, (uint8_t*) &MAX_ID, sizeof(MAX_ID));
        Chip_Clock_System_BusyWait_ms(I2C_MASTER_COMM_INTERVAL);
        printf("%i \n", MAX_ID);
    }
#endif
}

 

I try to read the id of a MAX30101 Sensor.

 

If someone could help me, that would be great!!

 

Sincerely,

Raphael

Outcomes