Datasheet
In Master Receiver mode, the slave calculates a PEC value and transmits it to the master after all data bytes have
been transmitted. Upon reception of this PEC byte, the master compares it to the PEC value it has computed itself. If
the values match, the data was received correctly
. If the PEC values differ, data was corrupted, and
TWIHS_SR.PECERR is set. In Master Receiver mode, the PEC byte is always followed by a NACK transmitted by
the master, since it is the last byte in the transfer.
In combined transfers, the PECRQ bit should only be set in the last of the combined transfers.
Consider the following transfer:
S, ADR+W, COMMAND_BYTE, ACK, SR, ADR+R, DATA_BYTE, ACK, PEC_BYTE, NACK, P
See Read/Write Flowcharts for detailed flowcharts.
43.6.3.9.2 Timeouts
The TLOWS and TLOWM fields in TWIHS_SMBTR configure the SMBus timeout values. If a timeout occurs, the
master transmits a STOP condition and leaves the bus. The TOUT bit is also set in TWIHS_SR.
43.6.3.10 SMBus Quick Command (Master Mode Only)
The TWIHS can perform a quick command by following these steps:
1. Configure the Master mode (DADR, CKDIV, etc).
2. Write TWIHS_MMR.MREAD at the value of the one-bit command to be sent.
3. Start the transfer by setting TWIHS_CR.QUICK.
Figure 43-13. SMBus Quick Command
TXCOMP
TXRDY
Write QUICK command in TWIHS_CR
TWD
AS DADR R/W P
43.6.3.11 Read/Write Flowcharts
The flowcharts give examples for read and write operations. A polling or interrupt method can be used to check the
status bits. The interrupt method requires that TWIHS_IER be configured first.
SAM E70/S70/V70/V71 Family
T
wo-wire Interface (TWIHS)
© 2019 Microchip T
echnology Inc.
Datasheet
DS60001527D-page 1054










