42.7.3.3 Host Transmitter Mode

This operating mode is not available if High-speed mode is selected.

After the Host initiates a START condition when writing into the Transmit Holding register (TWIHS_THR), it sends a 7-bit Client address, configured in the Host Mode register (DADR in TWIHS_MMR), to notify the Client device. The bit following the Client address indicates the transfer direction, 0 in this case (MREAD = 0 in TWIHS_MMR).

The TWIHS transfers require the Client to acknowledge each received byte. During the acknowledge clock pulse (9th pulse), the Host releases the data line (HIGH), enabling the Client to pull it down in order to generate the acknowledge. If the Client does not acknowledge the byte, then the Not Acknowledge flag (NACK) is set in the TWIHS Status Register (TWIHS_SR) of the Host and a STOP condition is sent. The NACK flag must be cleared by reading TWIHS_SR before the next write into TWIHS_THR. As with the other status bits, an interrupt can be generated if enabled in the Interrupt Enable register (TWIHS_IER). If the Client acknowledges the byte, the data written in the TWIHS_THR is then shifted in the internal shifter and transferred. When an acknowledge is detected, the TXRDY bit is set until a new write in the TWIHS_THR.

TXRDY is used as Transmit Ready for the DMA transmit channel.

While no new data is written in the TWIHS_THR, the serial clock line is tied low. When new data is written in the TWIHS_THR, the SCL is released and the data is sent. Setting the STOP bit in TWIHS_CR generates a STOP condition.

After a Host write transfer, the serial clock line is stretched (tied low) as long as no new data is written in the TWIHS_THR or until a STOP command is performed.

To clear the TXRDY flag, first set the bit TWIHS_CR.MSDIS, then set the bit TWIHS_CR.MSEN.

See the figures below.

Figure 42-4. Host Write with One Data Byte
Figure 42-5. Host Write with Multiple Data Bytes
Figure 42-6. Host Write with One-Byte Internal Address and Multiple Data Bytes