AnsweredAssumed Answered

LPC54101 UART Hardware Flow Control

Question asked by Terence Kong on May 16, 2018
Latest reply on May 28, 2018 by jeremyzhou

I am trying to get the UART hardware flow control to work on LCP54101.

The RTS does toggle when data sending to the LPC54101 RX, however the RTS polarity seems to be wrong, supposed to be active low?  Also observed there is missing data received, the hardware flow control doesn't seems to work properly.  Could someone share some idea how to get the hardware flow control to work?

UART initialization call as shown in below

 

 

void Init_UART(UART_PORT_SELECTOR port_id, RX_HANDLER rx_handler) {

assert( port_id < UART_LAST_PORT );

Chip_Clock_SetAsyncSysconClockDiv(1);

Chip_SYSCON_Enable_ASYNC_Syscon(true);

 

Chip_UART_Init(port->uart_port);

Chip_IOCON_PinMuxSet(LPC_IOCON, PORT(port->cts_pin), PIN(port->cts_pin), IOCON_FUNC2 | IOCON_DIGITAL_EN | IOCON_INPFILT_OFF);

Chip_IOCON_PinMuxSet(LPC_IOCON, PORT(port->rts_pin), PIN(port->rts_pin), IOCON_FUNC2 | IOCON_DIGITAL_EN | IOCON_INPFILT_OFF);

Chip_UART_ConfigData(port->uart_port, UART_CFG_DATALEN_8 | UART_CFG_PARITY_NONE | UART_CFG_STOPLEN_1 | UART_CFG_CTSEN);

Chip_UART_SetBaud(port->uart_port, port->baud);

Chip_IOCON_PinMuxSet(LPC_IOCON, PORT(port->rx_pin), PIN(port->rx_pin), IOCON_MODE_INACT | IOCON_FUNC1 | IOCON_DIGITAL_EN | IOCON_INPFILT_OFF);

Chip_IOCON_PinMuxSet(LPC_IOCON, PORT(port->tx_pin), PIN(port->tx_pin), IOCON_MODE_INACT | IOCON_FUNC1 | IOCON_DIGITAL_EN | IOCON_INPFILT_OFF);

Chip_UART_Enable(port->uart_port);

Chip_UART_TXEnable(port->uart_port);

port->rx_handler = rx_handler;

if(rx_handler) {

Chip_UART_IntEnable(port->uart_port, UART_INTEN_RXRDY );

}

Chip_UART_IntDisable(port->uart_port, UART_INTEN_TXRDY);

NVIC_SetPriority(port->irq_number, INT_PRIORITY_UART);

NVIC_EnableIRQ(port->irq_number);

}

Outcomes