Source Clock for LPUART on imxrt1062

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

Source Clock for LPUART on imxrt1062

1,083 Views
rcusack
Contributor II

Hello,

I am working on setting up a UART configuration on a imxrt1062. 

The configurations I have used are as follows:

LPUART_GetDefaultConfig(&user_config);
user_config.baudRate_Bps = 115200U;
user_config.enableTx = true;
user_config.enableRx = true;
user_config.parityMode = kLPUART_ParityDisabled;
user_config.dataBitsCount = kLPUART_EightDataBits;
user_config.isMsb = false;
user_config.stopBitCount = kLPUART_OneStopBit;
user_config.txFifoWatermark = 0;
user_config.rxFifoWatermark = 1;
status =LPUART_Init(LPUART6,&user_config, 20000000U); //fsl_lpuart.c example configuration

I am testing with a simple echo.

while (true) {
   LPUART_ReadBlocking(LPUART6, test, 1);
   LPUART_WriteBlocking(LPUART6, test, 1);

}

I need to send and receive data through the Rx and Tx pins.
I have verified that I have the correct data on the Rx pin, but the data is not received in the correct format. I think this has to do something with the source clock. 

If anyone can point me in the right direction that would be appreciated. Hopefully a correct source clock will solve my issues.

Labels (1)
1 Reply

992 Views
mjbcswitzerland
Specialist V

Hi

How is your UART_CLK_ROOT configured?
The possibilities are

pastedImage_1.png

or

pastedImage_2.png

with adjustable pre-scaling.

If you are not sure, connect UART_CLK_ROOT to CCM_CLKO2 so that you can measure it.

Regards

Mark

[uTasker project developer for Kinetis and i.MX RT]