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

twi_scanner example only returning address 0x01

I have set up a custom board using the nRF52811 based BMD-360 module.

I have tested the twi_scanner example, first of the nrf52DK with an external sensor. I Changed the TWI pins to the ones I am using on the custom board (SCL: 26, SDA: 25) and verified it worked as expected returning the address of the sensor over UART.

I have set up a custom board using the nRF52811 based BMD-360 module, and modified the project to target the nrf52811 (extracted settings from a PCA10056e project and changed the target, etc.). The program compiles fine and runs. My custom board doesn't have a serial output, so I have placed breakpoints to check for any detected devices. 

I only seem to be detecting one device on address 0x01, regardless of if I have a sensor attached to the board or not. I have tried the same sensor as I used with the DK connected, and still get the same result.

I have pull-ups on the TWI lines and nothing else on the bus so I don't think it's a hardware issue. I think it may just be a configuration problem moving from the nRF52840 DK to the nRF52811?

Any help would be appreciated.

(Using nRF5 SDK16.0.0)

Parents Reply
  • I was setting breakpoints at the appropriate points in the code and examined the address variable. This worked fine on the nRF52 DK.

    I now enabled RTT logging to check it. Though sometimes it looks like it might detect the I2C device, the output from is completely unreliable so debugging if it actually works is still near impossible. I've attached my project if you'd like to examine it.

    It should be such a simple task to communicate with an I2C device, but even the examples barely seem to work out of the box after a minor port to another supported part. It's very frustrating for me.

    2772.twi_scanner.zip

Children
Related