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

No activity on TWI Sensor example interface pins

Running the SDK11 example \examples\peripheral\twi_sensor on a NRF52 PCA10040 version dev board and can't get any output from TWI pins. Leaving pins unconnected and using programs default pins or changing them to something else and I get no activity on my O-scope. Using latest Keil uVision. Have tried using both Softdevice and nothing. Am I missing something?

Parents
  • The TWI Sensor example is a bit over-complicated (but has improved in SDK 12). Also, note that the defines of ARDUINO_I2C_SCL_PIN and ARDUINO_I2C_SDA_PIN are note used, and should be ignored (and deleted). The pin numbers that are used are ARDUINO_SCL_PIN and ARDUINO_SDA_PIN, that are defined in examples/bsp/pca10040.h as 27 and 26 respectively.

    If you connect your logic analyzer to those pins, you should see some activity. However, there will not be much, as the example application will wait for the first transfer to complete, which it never does. If you comment out the while(m_set_mode_done == false); on line 206 in main.c, you should see some more activity on the I2C lines, even without a slave connected.

  • I'm glad to hear you got it working. I agree that the example is bad. It was reported internally and has improved substansially in SDK 12 (which was released a few days ago).

Reply Children
No Data
Related