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

[mbed] I2C fails in a consistent pattern

I had a mbed firmware running on a ST Nucleo 64 that periodically query a sensor for data. It only use the I2C, a button interrupt and a LED for heartbeat. I ported it to a nRF51 target by changing the pin numbers. The firmware compiled just fine. And the firmware runs on the nRF51-DK without any hard fault. The heartbeat LED toggle periodically as it should, debugging UART messages are being printed out in the correct order.

However there is a problem in the I2C communication.

For I2C write, consistently, I2C write would fail once, then succeed once, and repeat.

For I2C read, I used a function that would read three times. This function would succeed twice, fail once, and repeat...

The most bizarre thing is that this failing behavior has a consistent pattern to it.

What could be going on here?


Update:

I encountered this issue while working with the X-NUCLEO-1KS01A1 shield. Both this shield and the nRF51 DK has Arduino UNO Rev 3 compliance connectors. However, they have some conflicts where the shield's data ready signals overlap with the nRF51 DK's buttons. So I started by connecting them together using jumper wires. Apparently this is what causes the issue. When I try to connect the two board using the Arduino headers, the issue is resolved.

However, I still would like to resolve this issue. As mentioned, the boards has pin conflicts, so I would rather avoid having to connect them using the Arduino headers

Parents
  • Sorry I guess I could have embedded an URL there instead of giving just the part number. While I make that quick edit I didn't have time to think much about it.

    However I don't understand your question. What do you mean by socket? In case this answer your confusion, both nRF51 and the X-Nucleo shield has Arduino UNO Rev 3 compliance connectors. Power would be supplied correctly to the shield and I2C lines would be aligned correctly as well.

    Going to update the questions with all these information now.

Reply
  • Sorry I guess I could have embedded an URL there instead of giving just the part number. While I make that quick edit I didn't have time to think much about it.

    However I don't understand your question. What do you mean by socket? In case this answer your confusion, both nRF51 and the X-Nucleo shield has Arduino UNO Rev 3 compliance connectors. Power would be supplied correctly to the shield and I2C lines would be aligned correctly as well.

    Going to update the questions with all these information now.

Children
No Data
Related