
BL602/604 Reference Manual
FIFO, the register RFIU will be set;
• RX FIFO overflow: When I2C receives data until the 2 words of RX FIFO are filled. Without reading the RX FIFO,
I2C receives the data again and the register RFIO will be set;
• TX FIFO underflow: When the size of the data filled in the TX FIFO does not meet the configured I2C data length
PKTLEN, and there is no new data to be filled into the TX FIFO, the register TFIU will be set;
• TX FIFO overflow: After the two words of the TX FIFO are filled, before the data in the TX FIFO is sent out, fill the
TX FIFO with data again. The register TFIO will be set.
11.7 Using DMA
I2C can use DMA to send and receive data. Set DTEN to 1 to enable the DMA transmission mode. After a channel
is allocated for I2C, the DMA will transfer data from the memory area to the I2C_FIFO_WDATA register.
Set DREN to 1 to enable the DMA receive mode. After a channel is allocated for I2C, the DMA will transfer the data
in the I2C_FIFO_RDATA register to the memory area.
When the I2C module is used with DMA, the data part will be automatically carried by the DMA. There is no need for
the CPU to write data to the I2C TX FIFO or read data from the I2C RX FIFO.
11.7.1 DMA transmission process
1. Configure the read and write flags to 0
2. Configure the slave device address
3. Configure Slave Device Address
4. Configure slave device address length
5. Data length
6. Set the enable signal register
7. Configure DMA transfer size
8. Configure DMA source address transfer width
9. Configure the DMA destination address transfer width (Note that when I2C is used with DMA, the destination
address transfer width needs to be set to 32bits and used in word alignment)
10. Configure the DMA source address as the memory address to store the transmitted data
11. Configure the DMA destination address as I2C TX FIFO address, I2C_FIFO_WDATA
12. Enable DMA
BL602/604 Reference Manual
148/ 195
@2020 Bouffalo Lab