AnsweredAssumed Answered

receive 9-bit data via UART1 using LPC1754?

Question asked by Stijn Paesen on Jul 9, 2018
Latest reply on Jul 11, 2018 by Kerry Zhou
Hello,

How to set up the UART1 to receive a 9-bit data (RS485) message for LPC1754?

1 start bit, 9 data bits, 1 stop bit

Is setting parity needed? I get every byte I receive an parity error?

Regards,
Stijn

 

I set:
UART_InitStruct->Baud_rate = 460800;
UART_InitStruct->Databits = UART_DATABIT_8;
UART_InitStruct->Parity = UART_PARITY_SP_1;
UART_InitStruct->Stopbits = UART_STOPBIT_1;

UART_FIFOInitStruct->FIFO_DMAMode = DISABLE;
UART_FIFOInitStruct->FIFO_Level = UART_FIFO_TRGLEV0;
UART_FIFOInitStruct->FIFO_ResetRxBuf = ENABLE;
UART_FIFOInitStruct->FIFO_ResetTxBuf = ENABLE;

rs485cfg.AutoDirCtrl_State = ENABLE;
rs485cfg.DirCtrlPin = UART1_RS485_DIRCTRL_DTR;
rs485cfg.DirCtrlPol_Level = SET;
rs485cfg.DelayValue = 50;
rs485cfg.NormalMultiDropMode_State = ENABLE;
rs485cfg.AutoAddrDetect_State = DISABLE;
//rs485cfg.MatchAddrValue = 0;
rs485cfg.Rx_State = ENABLE;

Outcomes