15. Combination of USART, SPI, and I2C (USI)
A96G150 User's manual
204
After doing one of the actions above, write arbitrary value to USInST2 to release SCLn line.
For the case 1 and case 2, move to step 7. For the case 3, move to step 9 to handle STOP
interrupt. For the case 4, move to step 6 after transmitting the data in USInDR, and if transfer
directio
n bit is ‘0’ go to master transmitter section.
9.
This is the final step for master receiver 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.
15.19.3
USIn I2C slave transmitter
To operate I2C in slave transmitter, 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, I2C compares the
received data with value 0x00, the general call address.
4.
If the received address does not equal to USInSLA[6:0] bits in USInSAR, I2C enters idle state
i.e., waits for another START condition. Else if the address equals to USInSLA[6:0] 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 USInSLA[6:0] bits, when the ACKnEN bit is disabled,
I2C enters idle state. When SSELn interrupt occurs, load transmit data to USInDR and write
arbitrary value to USInST2 to release SCLn line.
5.
1-Byte of data is being transmitted.
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...