I am working with the frdmKL03Z and the example lpuart_polling in the SDK 2.2 in that example use the internal oscilator but i need more Precision in the count of time
add a xtal but i think i need make changes in the software to the LPUART works well
someone can tell me if i am right ?
what change needed?
best regards
Solved! Go to Solution.
Hi Ramon
To clock the KL03 LPUART from the XTAL you need to set
SIM_SOPT2 |= (SIM_SOPT2_UART0SRC_OSCERCLK);
so that the OSCERCLK is connected to it.
Before that, you also need to enable the oscillator:
OSC0_CR = (OSC_CR_ERCLKEN | OSC_CR_EREFSTEN); // enable the oscillator and allow it to continue oscillating in stop mode
The crystal will need to have a frequency that is suitable for the Baud rate generation - eg, the 32kHz on the FRDM-KL03Z is not because it is too slow.
Regards
Mark
Hi Ramon
To clock the KL03 LPUART from the XTAL you need to set
SIM_SOPT2 |= (SIM_SOPT2_UART0SRC_OSCERCLK);
so that the OSCERCLK is connected to it.
Before that, you also need to enable the oscillator:
OSC0_CR = (OSC_CR_ERCLKEN | OSC_CR_EREFSTEN); // enable the oscillator and allow it to continue oscillating in stop mode
The crystal will need to have a frequency that is suitable for the Baud rate generation - eg, the 32kHz on the FRDM-KL03Z is not because it is too slow.
Regards
Mark