GD32A50x User Manual
515
Table 20-2. Data setup time and data hold time
Symbol
Parameter
Standard
mode
Fast mode
Fast mode
plus
SMBus
Unit
Min
Max
Min
Max
Min
Max
Min
Max
t
HD;DAT
Data hold time
0
-
0
-
0
-
0.3
-
us
t
VD;DAT
Data valid time
-
3.45
-
0.9
-
0.45
-
-
t
SU;DAT
Data setup time
250
-
100
-
50
-
250
-
ns
t
r
Rising time of
SCL and SDA
-
1000
-
300
-
120
-
1000
t
f
falling time of
SCL and SDA
-
300
-
300
-
120
-
300
20.3.5.
I2C reset
A software reset can be performed by clearing the I2CEN bit in the I2C_CTL0 register. When
a software reset is generated, the SCL and SDA are released. The communication control
bits and status bits come back to the reset value. Software reset have no effect on
configuration registers. The impacted register bits are START, STOP, NACKEN in I2C_CTL1
register, I2CBSY, TBE, TI, RBNE, ADDSEND, NACK, TCR, TC, STPDET, BERR, LOSTARB
and OUERR in I2C_STAT register. Additionally, when the SMBus is supported, PECTRANS
in I2C_CTL1 register, PECERR, TIMEOUT and SMBALT in I2C_STAT are also impacted.
In order to perform the software reset, I2CEN must be kept low during at least 3 APB clock
cycles. This is ensured by writing software sequence as follows:
Write I2CEN = 0
Check I2CEN = 0
Write I2CEN = 1
20.3.6.
Data transfer
Data Transmission
When transmitting data, if TBE is 0, it indicates that the I2C_TDATA register is not empty, the
data in I2C_TDATA register is moved to the shift register after the 9th SCL pulse. Then the
data will be transmitted through the SDA line from the shift register. If TBE is 1, it indicates
that the I2C_TDATA register is empty, the SCL line is stretched low until I2C_TDATA is not
empty. The stretch begins after the 9th SCL pulse.