LPC54S018's UART : how to force parity bit ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC54S018's UART : how to force parity bit ?

732 Views
belmontbob59
Contributor IV

I need to force the parity bit when transmitting data via USART. Older NXP MCUs (LPC17xx, LPC18xx) have 4 options for parity setting. Example for LPC17xx:

pastedImage_1.png

However, LPC54s018 does not:

pastedImage_6.png

I thought about using the 9th bit by setting DATALEN to 2, but the FIFO write data register only accepts 8bits. 

pastedImage_8.png

pastedImage_7.png

Please advise.

Labels (3)
0 Kudos
2 Replies

593 Views
belmontbob59
Contributor IV

Never mind, FIFOWR is 9bit wide. However, Please note a shortcoming in the SDK's fsl_usart.h, the API does not allow for 9bits data transfer. (only 7 or 8bits are allowed):

pastedImage_1.png

0 Kudos

593 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello bob belmont

 

Although the enum only enumerates until 8bits you can add a variable to add the 9bit. The usar_data_len_t gets written at the CFG register. So writing a 2 will allow the 9bit transfer.

pastedImage_2.png

 

Let me know if this is helpful.

Best Regards,

Omar