AT32F425
Series Reference Manual
2022.03.30
Page 150
Ver 2.01
USART_DT[8.
When parity check is enabled, if DBN1,DBN0=10, the MSB stands for USART_DT[5; if
DBN1,DBN0=00, the MSB stands for USART_DT[6]; if DBN1,DBN0=01, the MSB stands for
USART_DT[7].
When the ID[3: 0] bit is selected, the four LSB bits indicate the ID value; When the ID[7: 0] bit is
selected, all of the LSB bits indicates the ID value, except for the above parity check bits and MSB
bits.
7.
Synchronous mode: Set the CLKEN bit enables synchronous mode and clock pin output. Select CK
pin high or low in idle state by setting the CLKPOL bit (1 or 0). Whether to sample data on the second
or first edge of the clock depends on the CLKPHA bit (1 or 0). The LBCP bit (1 or 0) is used to select
whether to output clock on the last data bit. And the ISDIV[4: 0] is used to select the required clock
output frequency.
12.4
USART frame format and configuration
USART data frame consists of start bit, data bit and stop bit, with the last data bit being as a parity bit.
USART idle frame size is equal to that of the data frame under current configuration, but all bits are 1.
USART break frame size is the current data frame size plus its stop bit. All bits before the stop bit are 0.
In non-LIN mode, a break frame transmission and detection must be in line with this rule. For instance,
if DBN1,DBN=00, the break frame size for transmission and detection should be 10-bit low level plus its
stop bit. In LIN mode, refer to Mode selector and configuration process for more details.
The DBN1 and DBN0 bits are used to program 7-bit (DBN1,DBN0=10), 8-bit (DBN1,DBN0=00) or 9-bit
(DBN1,DBN0=01) data bits.
The STOPBN bit is used to program one bit (STOPBN=00), 0.5-bit (STOPBN=01), two-bit (STOPBN=10)
and 1.5-bit (STOPBN=11) stop bits.
Set the PEN bit will enable parity control. PSEL=1 indicates Odd parity, while PSEL=0 for Even parity.
Once the parity control is enabled, the MSB of the data bit will be replaced with parity bit, that is, the
significant bits is reduced by one bit.
12.5
DMA transfer introduction
Enable transmit data buffer and receive data buffer using DMA to achieve continuous high-speed
transmission for USART, which is detailed in subsequent sections. For more information on specific DMA
configuration, refer to DMA chapter.
12.5.1 Transmission using DMA
1.
Select a DMA channel: Select a DMA channel from DMA channel map table described in DMA
chapter.
2.
Configure the destination of DMA transfer: Configure the USART_DT register address as the
destination address bit of DMA transfer in the DMA control register. Data will be sent to this address
after transmit request is received by DMA.
3.
Configure the source of DMA transfer: Configure the memory address as the source of DMA transfer
in the DMA control register. Data will be loaded into the USART_DT register from the memory
address after transmit request is received by DMA.
4.
Configure the total number of bytes to be transferred in the DMA control register.
5.
Configure the channel priority of DMA transfer in the DMA control register.
6.
Configure DMA interrupt generation after half or full transfer in the DMA control register.
7.
Enable DMA transfer channel in the DMA control register.
12.5.2 Reception using DMA
1.
Select a DMA transfer channel: Select a DMA channel from DMA channel map table described in
DMA chapter.
2.
Configure the destination of DMA transfer: Configure the memory address as the destination of DMA
transfer in the DMA control register. Data will be loaded from the USART_DT register to the
programmed destination after reception request is received by DMA.