MCXN LPUART for RS485 driver or hardware flow control

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

MCXN LPUART for RS485 driver or hardware flow control

2,552 Views
Vagni
Contributor IV

In the MCX Nx4x Reference manual I see LPUART transmitter can use RTS_B output as an enable signal for the driver of an external RS-485 transceiver.

How to set that RTS_B functionality in LPUART registers?

HDCR[RTSEXT] is the only mentioned LPUART register for RTS_B output as drive enable signal.

Also, I do not understand how to enable LPUART hardware flow control with receiver RTS_B output and transmitter CTS_B input.

Labels (1)
0 Kudos
Reply
4 Replies

2,535 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Regarding the LPUART module pins assignment,

Pls refer to the section 66.2.3 External signals in RM of MCXNx4x family.

xiangjun_rong_0-1722391477989.png

There are total 8 Fc module, I represent it as FCx. The FCx_P0 is RXD pin, FCx_P1 is TXD pin, FCx_P2 is RTS_b pin.

In the MCXx4x_pinout.xlsx doc, the pin assignment is defined.

 

xiangjun_rong_1-1722391822296.png

You can see the FCx_P2 pin.

Hope it can help you

BR

Xiangjun Rong

 

0 Kudos
Reply

2,518 Views
Vagni
Contributor IV

Thank you Xiangjun Rong,

Yes, I know I need to enable the FC_P2 signal on the Pinmux to have the alternate RTS_B functionality on the output pin.

Then, if I have LPUART connected to a RS485 transceiver, how to enable the driver enable functionality on the RTS_B output?

Similarly, if I have to use LPUART with hardware flow control, enabling RTS_B output and CTS_B input on the Pinmux automatically enables the hardware flow control on those pins?

I cannot find any flag in the LPUART registers that enables RTS_B as Request to Send for hardware flow control or as driver enable for an external RS485 transceiver. 

In the SDK_2_16_000_MCXN546 I cannot find any sample code for LPUART used with RS485 or hardware flow control.

 

0 Kudos
Reply

2,435 Views
Vagni
Contributor IV

Maybe, the MODEM IrDA (MODIR) register seems to have all the flags I was looking for LPUART hardware flow control and RS485 transceiver driver enable, right?

The TXCTSSRC, TXCTSC, TXCTSE flags configure the LPUART transmitter CTS input function.

The RXRTSE, RTSWATER flags configure the LPUART receiver RTS output function.

The TXRTSE, TXRTSPOL flags configure the LPUART transceiver driver enable output function.

The fsl_lpuart SDK driver seems to handle only the hardware flow control configuration. I have to make myself the LPUART configuration for RS485 transceiver driver enable, right?

0 Kudos
Reply

2,367 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that you have to set the TXRTSE bit in the MODIR register, after you set the bit, when the uart transfers character, the RTS_b will be asserted.

I suppose that the uart driver in SDK does not includes the hardware flow control code. You have to develop the code yourself.

Hope it can help you

BR

Xiangjun Rong

xiangjun_rong_0-1723440447884.png

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply