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

Reply
  • 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

Children
Related