This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nrf52840 with zephyr i2c sometimes not working

hello Nordic

i am working with nrf52840, with zephyr (i am new to zephyr)

i am trying to connect to a low power magnetic sensor (si7210-00-iv) 

my i2c sometimes works and sometimes fail (gets nack), not sure why .. maybe you have an idea ?

the i2c is configured to 100khz. and the init of the driver that uses the i2c is run before kernal and app,  i don't know if how or if i can configure stop bits or nacks or repeated start (if there is something like )

with oscilloscope looks like this (first photo is when it works, it can be seen that the 9'th bit is low on the second byte transferred):

the following photos are when i2c fail, on ack, and it can be seen that the 9'th bit is high in the second byte, which i guess signal the device something and it does not give a ack 

any ideas will be appritiated

best regards

Ziv

Parents
  • Hello,

    i am trying to connect to a low power magnetic sensor (si7210-00-iv) 

    my i2c sometimes works and sometimes fail (gets nack), not sure why .. maybe you have an idea ?

    Could you show me your prj.conf file and the TWI initialization?

    i don't know if how or if i can configure stop bits or nacks or repeated start (if there is something like )
    with oscilloscope looks like this

    The oscilloscope pictures looks alright to me, so I suspect that there here perhaps is a mismatch between what the sensor expects and what the nRF is sending. Does the Si7210-00-iv's datasheet mention any requirements for the TWI communication to be successful? I have no personal experience with this particular sensor, but I know that some sensors for example require a certain delay between commands to ensure that it has enough time to process them.

    Does the nack's happen after a particular command has been sent, or seemingly random / at any time?

    Best regards,
    Karl

  • hi Karl

    the issue is actually related to the device in hand, which apparently requires an empty 'write' command which fail and it is normal for this device, so there where actually no problem with the i2c

    but i opened a new thread cause i have an interrupt pin that does not work and i also want to use a zephyr example with my board  but for some reason the build search the file in the board/arc instead of board/arm

    i will close this thread and hope to read from you on the other thread

    https://devzone.nordicsemi.com/f/nordic-q-a/80307/nrf52840-with-zephyr-running-button-example-can-t-find-my-board

    best regards

    Ziv

Reply Children
No Data
Related