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,

    Are you able to share the datasheet of the device you're working with?

    Also, it sounds like you have a logic analyzer hooked-up (which is a Good Thing(tm)) -- are you seeing SCL go low after SDA goes low? i.e. an I2C/TWI start sequence?

    The timing and pattern is important, so you'll want to capture both synchronously if you can.

    See the attached image URL for details.

    I'll go through your code, but I'm also experimenting with I2C, so may not be much help :p

    Cheers,

    -m

Reply
  • Hi Tom,

    Are you able to share the datasheet of the device you're working with?

    Also, it sounds like you have a logic analyzer hooked-up (which is a Good Thing(tm)) -- are you seeing SCL go low after SDA goes low? i.e. an I2C/TWI start sequence?

    The timing and pattern is important, so you'll want to capture both synchronously if you can.

    See the attached image URL for details.

    I'll go through your code, but I'm also experimenting with I2C, so may not be much help :p

    Cheers,

    -m

Children
No Data
Related