I'm working with the LPUART on a KL82Z.
All the LPUART examples shown in SDK 2.0 have no hardware flow control. I need to turn on the hardware flow control, but I cannot find any registers that allow for RTS/CTS to start controling the uart data flow.
I configured the corresponding GPIOs in the MUX but they don't seem to work, there is probably something else I need to do to turn the flow control on. Here's my mux config as generated by the Pins config tool V1.0:
PORT_SetPinMux(PORTA, PIN14_IDX, kPORT_MuxAlt3); /* PORTA14 (pin 34) is configured as LPUART0_TX */
PORT_SetPinMux(PORTA, PIN15_IDX, kPORT_MuxAlt3); /* PORTA15 (pin 35) is configured as LPUART0_RX */
PORT_SetPinMux(PORTD, PIN4_IDX, kPORT_MuxAlt3); /* PORTD4 (pin 77) is configured as LPUART0_RTS_b */
PORT_SetPinMux(PORTD, PIN5_IDX, kPORT_MuxAlt3); /* PORTD5 (pin 78) is configured as LPUART0_CTS_b */
SIM->SOPT5 = ((SIM->SOPT5 &
(~(SIM_SOPT5_LPUART0TXSRC_MASK | SIM_SOPT5_LPUART0RXSRC_MASK))) /* Mask bits to zero which are setting */
| SIM_SOPT5_LPUART0TXSRC(SOPT5_LPUART0TXSRC_LPUART_TX) /* LPUART0 transmit data source select: LPUART0_TX pin */
| SIM_SOPT5_LPUART0RXSRC(SOPT5_LPUART0RXSRC_LPUART_RX) /* LPUART 0 receive data source select: LPUART0_RX pin */
The configuration structure for the LPUART has no members for turning the hardware flow control on or off. There is no mentioning anywhere in the fsl_lpuart.h file of bit or a register for flow control.
The LPUART0 works fine, it's just that it doesn't care much about the CTS pin and it's not controlling the RTS pin as it should.
The FIFO is not enabled, the tx and rx watermark is set at 0.
What am I missing?
Thanks in advance for any help!
UPDATE: I read and again the KL82 Sub-Family Reference Manual, Rev. 2, 1/2016, the only reference I can find is in 188.8.131.52 Hardware flow control, a little bit lower, there is a link highlighted in blue saying: See Transceiver driver enable using LPUART_RTS for details. Unfortunately, that link points to nowhere, and there is nowhere in the manual a chapter or a note explaining how to deal with the RTS line or with the "transceiver driver". In my case, the RTS line is high when it should have been low. Anyone bumped into a similar problem?