Preliminary
Registers
www.ti.com
7.3.18 Data Counter Register (I2C_CNT)
CAUTION
During an active transfer phase (between STT has been set to 1 and
receiving of ARDY), no modification must be done in this register. Changing
it may result in an unpredictable behavior.
This read/write register is used to control the numbers of bytes in the I2C data payload.
Figure 7-31. Data Counter Register (I2C_CNT)
31
16 15
0
Reserved
DCOUNT
R-0
R/W-0
LEGEND: R/W = Read/Write; R = Read only; -n = value after reset
Table 7-21. Data Counter Register (I2C_CNT) Field Descriptions
Bit
Field
Value
Description
31-16
Reserved
0
Reserved
15-0
DCOUNT
0-FFFFh
Data count. I2C Master Mode only (receive or transmit; F/S).
This 16-bit countdown counter decrements by 1 for every byte received or sent through the I2C
interface. A write initializes DCOUNT to a saved initial value. A read returns the number of bytes that
are yet to be received or sent. A read into DCOUNT returns the initial value only before a start
condition and after a stop condition.
When DCOUNT reaches 0, the core generates a stop condition if a stop condition was specified
(I2C_CON.STP = 1) and the ARDY status flag is set to 1 in the I2C_IRQSTATUS_RAW register.
Note that DCOUNT must not be reconfigured after I2C_CON.STT was enabled and before ARDY is
received.
Note1: In case of I2C mode of operation, if I2C_CON.STP = 0, then the I2C asserts SCL = 0 when
DCOUNT reaches 0. The CPU can then reprogram DCOUNT to a new value and resume sending or
receiving data with a new start condition (restart). This process repeats until the CPU sets to 1 the
I2C_CON.STP bit.
The ARDY flag is set each time DCOUNT reaches 0 and DCOUNT is reloaded to its initial value.
0
Data counter = 65536 bytes (216)
1
Data counter = 1 bytes
-
-
FFFFh
Data counter = 65535 bytes (216 - 1)
Values after reset are low (all 16 bits).
Note2: Since for DCOUNT = 0, the transfer length is 65536, the module does not allow the possibility
to initiate zero data bytes transfers.
884
Inter-Integrated Circuit (I2C) Controller Module
SPRUGX9 – 15 April 2011
© 2011, Texas Instruments Incorporated