Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
500
/
631
are listed in the table below.
Table 23-2 Parity frame format
PCDIS bit
LPUART frame
0
| Start bit | 8-bit data | parity bit | stop bit |
1
| Start bit | 8 bits data | stop bit |
Transfer mode: Parity is enabled by resetting the LPUART_CTRL.PCDIS bit. If parity fails, the LPUART_STS.PEF
flag is set to '1', and an interrupt occurs if LPUART_INTEN.PEIE is set.
Odd parity: LPUART_CTRL.PSEL
=
1.
Make the number of '1' in one frame data (including
parity bit
) be an odd number. That is: if Data=11000101, there
are 4 '1's, then the
parity bit
will be '1' (5 '1' in total).
Even parity: LPUART_CTRL.PSEL
=
0.
Make the number of '1' in one frame data (including
parity bit
) be an even number. That is: if Data=11000101, there
are 4 '1's, then the
parity bit
will be '0' (4 '1' in total).
DMA application
LPUART can access the transmit data register (TDR) and receive buffer respectively through DMA.
DMA transmission
The steps for assigning a DMA channel to the LPUART transmissions are as follows (x indicates the channel number) :
1.
Configure the LPUART_DAT register address as the destination address for DMA transfer, and the memory
address as the source address for DMA transfer.
2.
Set the total number of bytes to be transmitted.
3.
Set the channel priority.
4.
Configure to generate DMA interrupts when the transfer is half or all complete.
5.
Activate the channel.
Completing a DMA transfer will generate an interrupt on the corresponding DMA channel. In transmission mode,
when the DMA has finished the data transfer, the DMA controller sets the DMA_INTSTS.TXCFx flag. The
LPUART_STS.TXC flag bit is asserted by the hardware to indicate that the transfer is completed. The software needs
wait for LPUART_STS.TXC=1.