A96G150 User's manual
15. Combination of USART, SPI, and I2C (USI)
205
Case 1: No ACK signal is detected and I2C waits STOP or repeated START condition.
Case 2: ACK signal from master is detected. Load data to transmit into USInDR.
After doing one of the actions above, write arbitrary value to USInST2 to release SCLn line.
For the case 1, move to step 7 to terminate communication. For the case 2, move to step 5.
In either case, a repeated START condition can be detected. For that case, move step 4.
7.
This is the final step for slave transmitter function of I2C, handling STOP interrupt. The
STOPCn 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.
15.19.4
USIn I2C slave receiver
To operate I2C in slave receiver, follow the recommended steps below:
1.
If the main operating clock (SCLK) of the system is slower than that of SCLn, load value 0x00
into USInSDHR to make SDAn change within one system clock period from the falling edge
of SCLn. Note that the hold time of SDAn is calculated by SDAH x period of SCLK where
SDAH is multiple of number of SCLK coming from USInSDHR. When the hold time of SDAn
is longer than the period of SCLK, I2C (slave) cannot transmit serial data properly.
2.
Enable I2C by setting USInMS[1:0] bits in USInCR1, IICnIEbit in USInCR4 and USInEN bit in
USInCR2. This provides main clock to the peripheral.
3.
When a START condition is detected, I2C receives one byte of data and compares it with
USInSLA[6:0] bits in USInSAR. If the GCALLn bit in USInSAR is enabled, I2Cn compares the
received data with value 0x00, the general call address.
4.
If the received address does not equal to SLAn bits in USInSAR, I2C enters idle state i.e.,
waits for another START condition. Else if the address equals to SLAn bits and the ACKnEN
bit is enabled, I2C generates SSELn interrupt and the SCLn line is held LOW. Note that even
if the address equals to SLAn bits, when the ACKnEN bit is disabled, I2C enters idle state.
When SSELn interrupt occurs and I2C is ready to receive data, write arbitrary value to
USInST2 to release SCLn line.
5.
1-Byte of data is being received.
6.
In this step, I2C generates TENDn interrupt and holds the SCLn line LOW regardless of the
reception of ACK signal from master. Slave can select one of the following cases.
Содержание A96G150
Страница 126: ...12 Timer 0 1 2 3 4 5 A96G150 User s manual 126 Figure 43 16 bit Timer Counter Mode Operation Example...
Страница 136: ...12 Timer 0 1 2 3 4 5 A96G150 User s manual 136 Figure 51 16 bit Timer Counter Mode Operation Example...
Страница 147: ...A96G150 User s manual 12 Timer 0 1 2 3 4 5 147 Figure 59 16 bit Timer Counter Mode Operation Example...
Страница 157: ...A96G150 User s manual 12 Timer 0 1 2 3 4 5 157 Figure 67 16 bit Timer Counter Mode Operation Example...
Страница 171: ...A96G150 User s manual 14 12 bit ADC 171 Figure 79 ADC Operation Flow Sequence...
Страница 333: ...A96G150 User s manual Revision history 333 Revision history Revision Date Notes 1 00 2022 06 22 First creation...