149
MC96F8204
ABOV Semiconductor Co., Ltd.
11.9.8.3
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 SCL, load value 0x00 into I2CSDHR
to make SDA change within one system clock period from the falling edge of SCL. Note that the hold time of
SDA is calculated by SDAH x period of SCLK where SDAH is multiple of number of SCLK coming from
I2CSDHR. When the hold time of SDA is longer than the period of SCLK, I2C (slave) cannot transmit serial
data properly.
2.
Enable I2C by setting IICIE bit and IICEN bit in I2CCR. This provides main clock to the peripheral.
3.
When a START condition is detected, I2C receives one byte of data and compares it with SLA bits in
I2CSAR. If the GCALLEN bit in I2CSAR is enabled, I2C compares the received data with value 0x00, the
general call address.
4.
If the received address does not equal to SLA bits in I2CSAR, I2C enters idle state ie, waits for another
START condition. Else if the address equals to SLA bits and the ACKEN bit is enabled, I2C generates SSEL
interrupt and the SCL line is held LOW. Note that even if the address equals to SLA bits, when the ACKEN
bit is disabled, I2C enters idle state. When SSEL interrupt occurs, load transmit data to I2CDR and clear to
“0b” all interrupt source bits in I2CSR to release SCL line.
5.
1-Byte of data is being transmitted.
6.
In this step, I2C generates TEND interrupt and holds the SCL line LOW regardless of the reception of ACK
signal from master. Slave can select one of the following cases.
1) No ACK signal is detected and I2C waits STOP or repeated START condition.
2) ACK signal from master is detected. Load data to transmit into I2CDR.
After doing one of the actions above, clear to
“0b” all interrupt source bits in I2CSR to release SCL line. In
case of 1) move to step 7 to terminate communication. In case of 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 STOPC bit indicates
that data transfer between master and slave is over. To clear I2CSR, write
“0” to I2CSR. After this, I2C
enters idle state.
Содержание MC96F8104M
Страница 13: ...13 MC96F8204 ABOV Semiconductor Co Ltd 4 Package Diagram Figure 4 1 20 Pin SOP Package...
Страница 14: ...14 MC96F8204 ABOV Semiconductor Co Ltd Figure 4 2 20 Pin TSSOP Package...
Страница 15: ...15 MC96F8204 ABOV Semiconductor Co Ltd Figure 4 3 16 Pin SOPN Package...
Страница 16: ...16 MC96F8204 ABOV Semiconductor Co Ltd Figure 4 4 10 Pin SSOP Package...
Страница 17: ...17 MC96F8204 ABOV Semiconductor Co Ltd Figure 4 5 8 Pin SOP Package...