© 2004 Microchip Technology Inc. DS70068C-page 21-21
Section 21. Inter-Integrated Circuit (I
2
C)
Inter-Integrated
Circuit (I
2
C)
21
21.5.4 Acknowledge Generation
Setting the Acknowledge sequence enable bit, ACKEN (I2CCON<4>), enables generation of a
master Acknowledge sequence.
Figure 21-11 shows an ACK
sequence and Figure 21-12 shows a NACK sequence. The
Acknowledge data bit, ACKDT (I2CCON<5>), specifies ACK
or NACK.
After two baud periods:
• The ACKEN bit is automatically cleared.
• The module generates the MI2CIF interrupt.
21.5.4.1 IWCOL Status Flag
If the software writes the I2CTRN when an Acknowledge sequence is in progress, then IWCOL
is set and the contents of the buffer are unchanged (the write doesn’t occur).
Figure 21-11: Master Acknowledge (ACK) Timing Diagram
Figure 21-12: Master Not Acknowledge (NACK) Timing Diagram
Note: The lower 5 bits of I2CCON must be ‘0’ (master logic inactive) before attempting to
set the ACKEN bit.
Note: Because queueing of events is not allowed, writing to the lower 5 bits of I2CCON is
disabled until the Acknowledge condition is complete.
SCL (Master)
SDA (Master)
ACKEN
MI2CIF Interrupt
TBRG
1 2 3
Writing ACKEN = 1 initiates a master Acknowledge event.
1
TBRG
- Writing ACKDT = 0 specifies sending an ACK.
- When SCL detected low, module drives SDA low.
2
- Baud generator times out. Module releases SCL.
3
- Baud generator times out.
4
I
2
C Bus State
(A)
(Q)
(Q)
4
Baud generator restarts.
Baud generator starts. SCL remains low.
Module drives SCL low then releases SDA.
Module clears ACKEN. Master generates interrupt.
(Q)
ACKDT = 0
SCL (Master)
SDA (Master)
ACKEN
MI2CIF Interrupt
TBRG
1 2 3
Writing ACKEN = 1 initiates a master Acknowledge event.
1
T
BRG
- Writing ACKDT = 1 specifies sending an NACK.
- When SCL detected low, module releases SDA.
2
- Baud generator times out. Module releases SCL.
3
- Baud generator times out.
4
I
2
C Bus State (A)
(I)
(Q)
4
Baud generator restarts.
Baud generator starts.
Module drives SCL low then releases SDA.
Module clears ACKEN. Master generates interrupt.
ACKDT = 1