Hi,
i've got the TWI scanner example flashed onto the NRF51 dk board, using the default "Arduino" pins of P0.07 and P0.30 as SDA/SCL.
I've added two lines to the example code inside the "for each address loop" so that it reads out each address as it checks it, and the code is untouched otherwise.:
NRF_LOG_INFO("scanning: 0x%x.\r\n", address); NRF_LOG_FLUSH(); // helps catch the 0x1 error further down
With nothing plugged in to P0.07 and P0.30, I get on the uart output:
APP:INFO:TWI scanner. APP:INFO:scanning: 0x1. APP:INFO:scanning: 0x2. APP:INFO:scanning: 0x3. APP:INFO:scanning: 0x4. APP:INFO:scanning: 0x5. APP:INFO:scanning: 0x6. ... ... ... APP:INFO:scanning: 0x7d. APP:INFO:scanning: 0x7e. APP:INFO:scanning: 0x7f. APP:INFO:No device was found.
On a board external to the DK, I have two i2c items on the sda/scl lines - one at address 0x40, and one at 0x38. The external devices is powered through the VDD on the DK board (I've also tried powering it externally, no difference), and the grounds between the external devices and the DK board are connected.
I've tried 5k both ohms and 10k ohms pullups on both the SDA/SCL lines, same deal.
The SDA/SCL lines are also tied to two separate NRF51822 (unpowered) i/o pins, not too sure if that does anything to this test.
If I plug in any single wire (SDA/SCL) into either P0.07 or P0.30, I get:
APP:INFO:TWI scanner. APP:INFO:scanning: 0x1.
And that's it. It's stuck at 0x1.
The 0x1 line doesn't print if I don't force a flush immediately after printing that line.
Any ideas appreciated.