
15. USI
A96G140/A96G148/A96A148 User’s manual
176
set the STOPCn bit in USInCR4.
Case 3: Master transmits repeated START condition with not checking ACK signal. In this
case, load SLAn+R/W into the USInDR and set STARTCn bit in USInCR4.
After doing one of the actions above, write any arbitrary to USInST2 to release SCLn line.
For the case 1, move to step 7. For the case 2, move to step 9 to handle STOP interrupt.
For the case 3, move to step 6 after transmitting the data in USInDR and if transfer
direction bit is ‘1’ go to master receiver section.
7.
1-Byte of data is being transmitted. During data transfer, bus arbitration continues.
8.
This is ACK signal processing stage for data packet transmitted by master. I2C holds the
SCLn LOW. When I2C loses bus mastership while transmitting data arbitrating other
masters, the MLOSTn bit in USInST2 is set. If then, I2C waits in idle state. When the data
in USInDR is transmitted completely, I2C generates TENDn interrupt.
I2C can choose one of the following cases regardless of the reception of ACK signal from
slave:
Case 1: Master receives ACK signal from slave, so continues data transfer because slave
can receive more data from master. In this case, load data to transmit to USInDR.
Case 2: Master stops data transfer even if it receives ACK signal from slave. In this case,
set the STOPCn bit in USInCR4.
Case 3: Master transmits repeated START condition with not checking ACK signal. In this
case, load SLAn+R/W into the USInDR and set the STARTCn bit in USInCR4.
After doing one of the actions above, write any arbitrary to USInST2 to release SCLn line.
For the case 1, move to step 7. For the case 2, move to step 9 to handle STOP interrupt.
For the case 3, move to step 6 after transmitting the data in USInDR, and if transfer
direction bit is ‘1’ go to master receiver section.
9.
This is the final step for master transmitter function of I2C, handling STOP interrupt. The
STOP bit indicates that data transfer between master and slave is over. To clear USInST2,
write any value to USInST2. After this, I2C enters idle state.