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.
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.
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.
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:
If you look at the timing diagram in Figure 2 in the datasheet you will see that it differ from the I2C timing diagrams. For example there is no NACK or ACK bit. It is not similar to SPI either as the TM1640 use start and stop conditions different from the SPI protocol. And where did you get the address from? I can't find any reference to address 0x98 in the datasheet. Are we looking at the same datasheet?
If you look at the timing diagram in Figure 2 in the datasheet you will see that it differ from the I2C timing diagrams. For example there is no NACK or ACK bit. It is not similar to SPI either as the TM1640 use start and stop conditions different from the SPI protocol. And where did you get the address from? I can't find any reference to address 0x98 in the datasheet. Are we looking at the same datasheet?