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

continuous data about example twi_master_using_app_twi

hello. I want use I2C program. so, I used twi_master_using_app_twi example. SDA is output only 1byte(0x21). I need to output a continuous 5byte. Where do I need to modify the part. thank you.

Parents
  • Hi,

    On the image in your comment you are sending a 7 bit address (0x98 >> 1) with a write bit. You also get a Not Acknowledge (NACK) bit in the end. The 9th bit on the SCK is for the NACK bit.

    image description

    Read about NACK and addresses in the I2C spec here: I2C Bus Specification. Read about the difference between 8 and 7 bits addresses and why you right shift some addresses here.

    The NACK you get is important to note. It signifies that you are trying to transfer a byte, but no slave is responding. This is often due to one of the following reasons:

    • You use the wrong slave address.
    • You use wrong pins on your slave and/or the nRF5. Given that can provide logic trace you obviously know what pins on the nRF5 is used for TWI, but double check that SCK on the nRF5 is connected to SCK on the slave and likewise for SDA.
    • Your slave is not powered on.
    • The nRF5 has internal pull-ups, but you might need to add external ones as well. Your logic trace looks good though, so this is probably not an issue.
  • TM1640 is not compatible? I just want to send continuous data. So, if possible use the SPI example?

Reply Children
No Data
Related