LPC54S018's UART : how to force parity bit ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC54S018's UART : how to force parity bit ?

1,361 次查看
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.

标签 (3)
0 项奖励
回复
2 回复数

1,222 次查看
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 项奖励
回复

1,222 次查看
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