This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I need to work on twi compatible with smbus and I2C for NRF5340 DK

I need to interface my sensors by using twi. Here one of my sensor is smbus compatible. For I2C, I need to read acknowledge from sensor. So i need reference or samples to work on above requirements with NCS v1.5.0 for nrf5340dk

Thanks & regards

Navin

Parents Reply
  • I made some modifications to the i2c_scanner sample:

    • Changed the name nrf5340pdk_nrf5340_cpuappns.overlay to nrf5340dk_nrf5340_cpuapp.overlay
    • Removed unecessary Kconfigs from the prj.conf
    • Swapped NRF_TWIM1_NS with NRF_TWIM1_S

    Could you test the updated sample with NCS v1.5.1 and the board nrf5340dk_nrf5340_cpuapp?

    i2c_scanner.zip

    Connect the sensor in the following manner:

    Sensor nRF5340 DK
    SDA P1.02 (34-32=2)
    SCL P0.04 (4)
    VIN VDD
    GND GND

    I tested the sample with a MAX4009 GY-49 and it worked fine. I got the following output:

    *** Booting Zephyr OS build v2.4.99-ncs2  ***                                                                                                                               v2.4.99-ncs2  ***
    The I2C scanner started
    Value of NRF_TWIM1_S->PSEL.SCL : 4
    Value of NRF_TWIM1_S->PSEL.SDA : 34
    Value of NRF_TWIM1_S->FREQUENCY: 26738688
    26738688 -> 100k
    0x4b FOUND

    Best regards,

    Simon

Children
Related