AT32F425
Series Reference Manual
2022.03.30
Page 119
Ver 2.01
In master mode, the width of SCL signals (high and low) can be configured freely by setting the DIV[7:
0], SCLH[7: 0] and SCLL[7: 0] in the I2C_CLKCTRL register.
SCL low: When the SCL low signal is detected, the internal SCLL counter starts counting until it reaches
the SCLL value. At this point, the SCL line is released and become high.
SCL high: When the SCL high signal is detected, the internal SCLH counter starts counting. When the
counter value reaches the SCLH value, the SCL line is pulled low. In the process of SCL remaining high,
if it is pulled low by external bus, the internal SCLH counter will stop counting and start counting in SCL
low mode, laying the foundation for clock synchronization.
SCL high signal width
t
HIGH
= (SCLH + 1) x (DIV + 1) x t
I2C_CLK
SCL low signal width
T
Low
= (SCLL + 1) x (DIV + 1) x t
I2C_CLK
Table 11-1 I
2
C timing specifications
Parameter
Standard mode
Fast mode
Fast mode plus
SMBus
Min.
Max.
Min.
Max.
Min.
Max.
Min.
Max.
f
SCL
(kHz)
SCL clock frequency
100
400
1000
100
t
LOW
(us)
SCL clock low
4.7
1.3
0.5
4.7
t
HIGH
(us)
SCL clock high
4.0
0.6
0.26
4.0
50
t
HD;DAT
(us)
Data hold time
0
0
0.9
0
0.45
300
t
SU;DAT
(ns)
Data setup time
250
100
50
250
tr (ns)
SCL/SDA rising edge
1000
300
120
1000
tf (ns)
SCL/SDA falling edge
300
300
120
300
11.4.2 Data transfer management
Data transfer counter is available in the I
2
C interface to control communication flow. It is mainly used for:
―
NACK transmission: master reception mode
―
STOP transmission: master reception/transmission modes
―
RESTART generation: master reception/transmission modes
―
ACK control: slave mode (SMBus)
―
PEC transmission/reception: master/slave modes
Generally, the data transfer management counter (by setting the CNT[7:0] in the I2C_CTRL2 ) is
applicale to master mode. It is disabled in slave mode. This counter is used only in SMBus mode for the
ACK control and PEC reception of each byte by the slave. In SMBus mode, the slave enables data
counter with the SCTRL bit in the I2C_CTRL2 register.
Byte control through master
The CNT[7:0] bit in the I2C_CTRL2 register is used to configure the number of bytes to be transferred,
ranging from 1 to 255. If the number of data to be transferred is greater than 255, then the RLDEN bit
has to be set in the I2C_CTRL2 register to enable reload mode. The following configuration processes
are described in two aspects:
≤
255
bytes, for example, the number of data to be transferred is 100 bytes
―
Step 1: Disable reload mode by setting RLDEN=0
―
Step 2: Set CNT[7:0]=100
>
255
bytes, for example, the number of data to be transferred is 600 bytes
―
Step 1: Enable reload mode by setting RLDEN=1
―
Step 2: Set CNT[7:0]=255, the remaining bytes are 600-255=345 bytes