AnsweredAssumed Answered

Configuring FlexIO UART for FRDM-KL43Z with baudrate <115200bps

Question asked by Diego Valerio on Nov 8, 2018
Latest reply on Nov 19, 2018 by Alice_Yang

Hello! I am trying to configure the FlexIO as UART with baudrate less than 115200 in a FRDM-KL43Z, but I can´t do it.

I am using the SDK example called: flexio_uart_interrupt_transfer.c , for MCUXpresso IDE.

I was reading some posts that it is needed to decrease the Clock Frequency to make the divider less than 0xFF to use it in the TIMER_CMP. 

As my clock frequency is 48MHz, and my baudrate less than 115200, the timer value is bigger than 0xFF; the code implemented uses this:

timerDiv = srcClock_Hz / userConfig->baudRate_Bps;
timerDiv = timerDiv / 2 - 1;

if (timerDiv > 0xFFU)
result = kStatus_InvalidArgument;

So, as timerDiv is bigger than 0xFF, it returns invalid argument.



How can I  configure the clocks and the flexio to work with baudrates lower than 115200 bps?

Best regards.