Will the config tools and LPUART_Init function support inverting the UART polarity?

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

Will the config tools and LPUART_Init function support inverting the UART polarity?

跳至解决方案
261 次查看
rj_engineer
Contributor III

Hi,

The CTRL register of the MCXA UART contains the TXINV (28) bit which control the polarity of the UART.

txinv_capture.png

However, the config tools doesn't expose this functionnality and the "LPUART_Init" function automatically unset this bit. The only solution found was to disable the RX and TX output (after the "LPUART_Init") to set the TXINV.

LPUART1_PERIPHERAL->CTRL &= ~LPUART_CTRL_TE_MASK;
LPUART1_PERIPHERAL->CTRL &= ~LPUART_CTRL_RE_MASK;
LPUART1_PERIPHERAL->CTRL |= LPUART_CTRL_TXINV_MASK;
LPUART1_PERIPHERAL->CTRL |= LPUART_CTRL_TE_MASK;
LPUART1_PERIPHERAL->CTRL |= LPUART_CTRL_RE_MASK;

 

This solution cause unnecessary rising edge on the UART lines.

Writing a custom UART init function is overkill and error prone.

 

The question is :

Is there any other "proper" way to invert the UART polarity and are the config tools scheduled to support this functionnality.

 

Sincerely,

标签 (1)
0 项奖励
回复
1 解答
201 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi @rj_engineer 

I'm sorry for replying to you late.

1. I have checked the config tool, and it indeed doesn't support this feature. I will submit a feature request to the config tool development team. Thank you
 
2. We can add this configuration through code, such as
 

LPUART_CTRL_TXINV(1); // Enable Transmit Data Inversion

 

Please contact me if still have any question. 

 

BR

Alice

在原帖中查看解决方案

0 项奖励
回复
2 回复数
202 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi @rj_engineer 

I'm sorry for replying to you late.

1. I have checked the config tool, and it indeed doesn't support this feature. I will submit a feature request to the config tool development team. Thank you
 
2. We can add this configuration through code, such as
 

LPUART_CTRL_TXINV(1); // Enable Transmit Data Inversion

 

Please contact me if still have any question. 

 

BR

Alice

0 项奖励
回复
109 次查看
rj_engineer
Contributor III
Thank you for the answer
0 项奖励
回复