
Functional Description
1324
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Inter-Integrated Circuit (I
2
C) Interface
19.3.5 FIFO and µDMA Operation
Both the master and the slave module have the capability to access two 8-byte FIFOs that can be used in
conjunction with the µDMA for fast transfer of data. The transmit (TX) FIFO and receive (RX) FIFO can be
independently assigned to either the I
2
C master or I
2
C slave. Thus, the following FIFO assignments are
allowed:
•
The transmit and receive FIFOs can be assigned to the master
•
The transmit and receive FIFOs can be assigned to the slave
•
The transmit FIFO can be assigned to the master, while the receive FIFO is assigned to the slave and
vice versa
In most cases, both FIFOs will be assigned to either the master or the slave. The FIFO assignment is
configured by programming the TXASGNMT and RXASGNMT bit in the I
2
C FIFO Control (I2CFIFOCTL)
register.
Each FIFO has a programmable threshold point which indicates when the FIFO service interrupt should
be generated. Additionally, a FIFO receive full and transmit empty interrupt can be enabled in the Interrupt
Mask (I2CxIMR) registers of both the master and slave. Note that if we clear the TXFERIS interrupt (by
setting the TXFEIC bit) when the TX FIFO is empty, the TXFERIS interrupt does not reassert even though
the TX FIFO remains empty in this situation.
When a FIFO is not assigned to a master or a slave module, the FIFO interrupt and status signals to the
module are forced to a state that indicates the FIFO is empty. For example, if the TX FIFO is assigned to
the master module, the status signals to the slave transmit interface indicates that the FIFO is empty.
NOTE:
The FIFOs must be empty when reassigning the FIFOs for proper functionality
19.3.5.1 Master Module Burst Mode
A BURST command is provided for the master module which allows a sequence of data transfers using
the µDMA (or software, if desired) to handle the data in the FIFO. The BURST command is enabled by
setting the BURST bit in the Master Control/Status (I2CMCS) register. The number of bytes transferred by
a BURST request is programmed in the I
2
C Master Burst Length (I2CMBLEN) register and a copy of this
value is automatically written to the I
2
C Master Burst Count (I2CMBCNT) register to be used as a down-
counter during the BURST transfer. The bytes written to the I
2
C FIFO Data (I2CFIFODATA) register are
transferred to the RX FIFO or TX FIFO depending on whether a transmit or receive is being executed. If
data is NACKed during a BURST and the STOP bit is set in the I2CMCS register, the transfer terminates.
If the STOP bit is not set, the software application must issue a repeated STOP or START when a NACK
interrupt is asserted. In the case of a NACK, the I2CMBCNT register can be used to determine the
amount of data that was transferred prior to the BURST termination. If the Address is NACKed during a
transfer, then a STOP is issued.
19.3.5.1.1 Master Module µDMA Functionality
When the Master Control/Status (I2CMCS) register is set to enable BURST and the master I
2
C µDMA
channel is enabled in the DMA Channel Map Select n (DMACHMAPn) registers in the µDMA, the master
control module will assert either the internal single µDMA request signal (dma_sreq) or multiple µDMA
request signal (dma_req) to the µDMA. Note that there are separate dma_req and dma_sreq signals for
transmit and receive. A single µDMA request (dma_sreq) will be asserted by the master module when the
Rx FIFO has at least one data byte present in the FIFO and/or when the Tx FIFO has at least one space
available to fill. The dma_req (or Burst) signal will be asserted when Rx FIFO fill level is higher than trigger
level and/or the Tx FIFO burst length remaining is less than 4 bytes and the FIFO fill level is less than
trigger level. If a single transfer or BURST operation has completed, the µDMA sends a dma_done signal
to the master module represented by the DMATX and DMARX interrupts in the I2CMIMR, I2CMRIS,
I2CMMIS, and I2CMICR registers.
If the µDMA I
2
C channel is disabled and software is used to handle the BURST command, software can
read the FIFO Status (I2CFIFOSTAT) Register and the Master Burst Count (I2CMBC) register to
determine whether the FIFO needs servicing during the BURST transaction. A trigger value can be
programmed in the I2CFIFOCTL register to allow for interrupts at various fill levels of the FIFOs.