AT32F425
Series Reference Manual
2022.03.30
Page 116
Ver 2.01
11.4
I
2
C interface
Figure 11-2 shows the block diagram of I
2
C function
Figure 11-2 I2C function block diagram
Clock Control
Master clock
generation
Slave clock
stretching
SMBus Timeout
check
Digital
noise filter
Data Control
Shift register Tx
SMBUS PEC
generation/check
Digital
noise filter
Shift register Rx
Shift register Tx
Shift register Rx
Interrupt
Genaration
SMBUS
Alert
Control
Register
APB
Interface
I2C_DMAreq_TX
I2C_DMAreq_RX
I2C_EV_Intr
I2C_ER_Intr
I2CCLK
TIMEOUT_Frozen
CPU_Halt_en
I2C_SCL_out
I2C_SDA_out
I2C_SCL_in
I2C_SDA_in
I2C_SMBA_out
I2C_SMBA_in
GPIO
GPIO
I2C_SCL
I2C_SDA
1. Operating mode
I
2
C bus interface can operate both in master mode and slave mode. Switching from master mode to
slave mode, vice versa, is supported as well. By default, the interface operates in slave mode. When
GENSTART=1 is set (Start condition is activated), the I
2
C bus interface switches from slave mode to
master mode, and returns to slave mode automatcially at the end of data transfer (Stop condition is
triggered).
2. Communication process
Master mode communication:
1.
Start condition generation
2.
Address transmission
3.
Data Tx or Rx
4.
Stop condition generation
5.
End of communication
Slave mode communication:
1.
Wait until the address is matched.
2.
Data Tx or Rx
3.
Wait for the generation of Stop condition
4.
End of communication
3. Digital filter capability
The digital filter is available on both SCL and SDA lines. It is enabled by setting the DFLT[3: 0] bit
(0~15) in the I2C_CTRL1 register to reduce noise on bus on a large scale. The filter time is DLFT x
t
I2 C _ C L K .
The digital filter is not allowed to be altered when the I
2
C is enabled.
4. Address control
Both master and slave support 7-bit and 10-bit addressing modes.
Slave address mode:
In 7-bit mode (ADDR1MODE=0)
―
ADDR1EN=1,
ADDR2EN=0 stands for a single address mode: only matches OADDR1
―
ADDR1EN=1, ADDR2EN=1
stands for dual address mode: matches OADDR1 and OADDR2
In 10-bit mode
(ADDR1MODE=1)
―
Only supports a single address mode (ADDR1EN=1, ADDR2EN=0), matches OADDR1