hello,
I have gone through the AN-895 APPLICATION NOTE explaining I2C, still I'm not able to get a clear picture on the use of I2CxCCNT register.How to know what value to be assigned into it?
The datasheet simply explains it as :
I2CxCCNT are 8-bit start/stop generation counters. They hold off SDA low for start and stop conditions.
In the application note, an example code sequence is given:
I2C0CCNT = 0x0; // Sets Start/Stop condition counter value to 0 - minimum value.
I2C0ADR = 0xA0; // Write sequence
I2C0MTX = 0x7; // Load the Tx FIFO
while ((I2C0FSTA & 0x30) != 0x00) {} // Wait for the Tx FIFO to empty
I2C0CNT = 0x1; // Read 2 bytes from the slave
I2C0ADR = 0xA1; // Send out the Read condition
I2C0CCNT = 0x80; // Set the Start/Stop counter to a nonzero value to re-enable the Stop Condition
I understand, assigning 0x0 to the register assigns the counter to a minimum value, but what does this actually indicate? Is this a START condition?
And what does the other values indicate?
How do we issue a START or STOP condition?
Expecting help on this area. I am new to programming using I2C.
Thanks in advance.