AnsweredAssumed Answered

KL17 LPUART noise error with 4 Mhz external crystal

Question asked by Christopher Porter on Apr 3, 2017
Latest reply on Apr 5, 2017 by Kerry Zhou

I had a board with a 48 Mhz crystal and had the LPUART module communicating at 115200 baud with no errors.  Then I swapped out the external clock for one at 4 MHz and the receiver stopped working (the transmitter is still working fine). Communication works if I reduce the baud rate to 9600.  I have verified the following are within tolerance:

!.  External clock speeds;  with scope and also by toggling GPIO with interrupt driven timer.

2. Bit width of data on TX and RX lines

3. Error flags in the LPUART ISR.  We are getting noise error which may suggest phase shifting error.

4. Computation of OSR and SBR.  Baud clock should be 114285 Hz.


Below is the code used to set up the UART




lpuart_config_t lpuart_config;
lpuart_config.baudRate_Bps = 115200;
lpuart_config.enableRx = true;
lpuart_config.enableTx = true;


LPUART_Init(LPUART0, &lpuart_config, CLOCK_GetFreq(kCLOCK_Osc0ErClk));

LPUART_EnableRx(LPUART0, true);
LPUART_EnableTx(LPUART0, true);
LPUART_EnableInterrupts(LPUART0, kLPUART_RxDataRegFullInterruptEnable);
LPUART_EnableInterrupts(LPUART0, kLPUART_NoiseErrorInterruptEnable | kLPUART_FramingErrorInterruptEnable | kLPUART_RxOverrunInterruptEnable);


Thank you