I2C is not working

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

I2C is not working

1,988件の閲覧回数
raphaelprechtel
Contributor I

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

0 件の賞賛
1 返信

1,512件の閲覧回数
aresmarser
Contributor III

Hi Raphael,

Have you resolved the problem?

I also met some similar issue when using I2C.

Could you be kindly to share your experience if you solved the problem?

Many thanks,

Arna 

0 件の賞賛