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

TWI on nRF51822

I just entered a Case to Nordic with this same question but do not expect to get a response over the weekend so I am posting here. I made the assumption that the Nordic Cases and the Developer Zone are not related. If this is considered a double-post I apologize.

I used the RF6350_radio_configuration_example as a starting point for our TWI interface. The goal is for the nRF51822 to act a a Master and send commands to a Slave to read/write the Slave's RAM/EEPROM.

I am using the nRF51822 EK with our TWI Slave attached and uVision 4 and the TWI transmission are unsuccessful. When a command is issured there are two negative SDA pulses followed by continuous SCL pulses. (36 usec period = 27.8KHz). The Slave requires clock freuencies of 10KHz-100KHz. When the code reaches “if (timeout == 0)” in the twi_master_write() while loop timeout always equals 0 which may be why the transmissioin fails. Of course this may not be the only problem.

I am still plugging away on this but time is short so any suggestions will be appreciated.

twi.txt

Parents
  • Hi Tom

    What is the supply to your system? From the graphs you sent, the SDA line goes to about 2.4V while the CLK only rises to about 1.3V. According to the datasheet of your TWI device, you need a supply of at least 2.6V and that comms should go up to 2.5V. Comms will definitely not work. Will you also send the pin configuration of your TWI lines? I do not see them in the code. Please note that according to Figure 15 in the nrf51822 Ref Manual, it appears that the pull configuration is only used when the pin has the input buffer enabled. Not sure if the pull-up is used when configured as output? Have you connected two external resistors to your comms lines to see if you can at least get comms to work to your device first? Maybe give this a try if you have not yet.

Reply
  • Hi Tom

    What is the supply to your system? From the graphs you sent, the SDA line goes to about 2.4V while the CLK only rises to about 1.3V. According to the datasheet of your TWI device, you need a supply of at least 2.6V and that comms should go up to 2.5V. Comms will definitely not work. Will you also send the pin configuration of your TWI lines? I do not see them in the code. Please note that according to Figure 15 in the nrf51822 Ref Manual, it appears that the pull configuration is only used when the pin has the input buffer enabled. Not sure if the pull-up is used when configured as output? Have you connected two external resistors to your comms lines to see if you can at least get comms to work to your device first? Maybe give this a try if you have not yet.

Children
No Data
Related