I2C Target Enhanced ACK Control
The below additonal bits in the ACKCTL register
provide enhanced acknowledgement functionality.
The status bit SR.ACKOEN is updated automatically
when the ACKOEN_ON_PECDONE, ACKOEN_ON_PECNEXT, or
ACKOEN_ON_START bits in ACKCTL are set. Software
has to write ACKCTL.ACKOEN to ‘0’ to clear the
acknowledge override condition generated by
hardware.
- ACKOEN_ON_PECDONE
- When set, this bit automatically turns on the
target override mechanism following the ACK/NACK
of the received PEC byte. This allows software to
manually handle data bytes received after the PEC
byte. The sequence is as follows:
- Set ACKCTL.ACKOEN_ON_PECDONE
- SR.ACKOEN bit is automatically set after the
PEC byte has been ACK/NACK'd
- Receive "n" bytes using manual software
ACK
- Clear SR.ACKOEN after "n" bytes have been
received
- Receive next "m" bytes using the automatic
hardware ACK
- ACKOEN_ON_PECNEXT
- When set, this bit automatically turns on the
target override mechanism following the ACK/NACK
of the byte received prior to the PEC byte.
Software must clear the SR.ACKOEN after
ACKing/NACKing the PEC byte. Using this option,
software can effectively get the synchronization
point by getting an interrupt here (TREQ/RREQ
condition with TXEMPTY_ONTREQ/RXFLL_ON_RREQ set),
and then manually send the ACK/NACK of the PEC. In
other words, the software doesn’t need to rely on
byte granularity RXMODE and TXMODE interrupts and
get an interrupt after the entire frame has been
TX/RX. The sequence is as follows:
- Set ACKCTL.ACKOEN_ON_PECNEXT
- SR.ACKOEN bit is automatically set before the
PEC bytes
- Receive the PEC byte and manually ACK/NACK
using software
- Clear SR.ACKOEN
- Receive the entire next frame using automatic
hardware ACK until the next PEC byte is received
- ACKOEN_ON_START
- When set, this bit automatically turns on the
target override mechanism following a START
condition. The sequence is as follows:
- Set ACKCTL.ACKOEN_ON_START
- SR.ACKOEN bit is automatically set when the
START condition is detected
- Continue receiving bytes with software until
remaining bytes are known
- Clear SR.ACKOEN
- Receive the rest of the frame using automatic
hardware ACK until the next START condition is
received
Note: The I2CT software must wait a bit duration between generating a NACK and
disabling the SR.ACKOEN. These operations cannot
happen in the same cycle.
I2C Controller Enhanced ACK Control
The I2CC, when in receive mode, can ACK/NACK after "n" number of
bytes are received. When CTR.ACKOEN is set and the
number of bytes configured by CTR.BLEN are
received, an RXDONE interrupt is generated and the
transaction is either ACK'd or NACK'd depending on
the value of CTR.ACK. To stop the transaction, the
CTR.STOP can be set. Otherwise, software can
update the CTR.BLEN field to a new value to
continue with the transaction.