I am using a FRDM-KL03Z board.
The USB port is connected to my Windows PC and I run a putty session to connect to the UART.
115200 baud, 8 bits per char, 1 stop, no parity, no handshake.
I have programmed the LPUART0 like wise.
LPUART0 Clk is from MCGPCLK(internal 48 Mhz), OSR is 15 and the SBR value is also fine.
I see garbage on the terminal when I send chars from the board.
The UART works fine at 9600 baud.
I suspect that the 48 Mhz needs trimming, but where is the IPC_TRIM register?, I could not find any ref to this in the ref manual.
Has anyone tried this ?
Solved! Go to Solution.
Hi
The 48MHz oscillator should be accurate enough without trimming. It is specified to be typically +/-0.5% over the temperature range at 3V3, with worst case +/-1.0%
If you use an SBR value of 0x1a (complete LPUART_BAUD value of 0x0f00001a) the baud rate is 115'384Hz (if 48MHz oscillator is perfect). See simulation below:
You can load the attached binary to your board as reference. It sets 115'200Baud on the LPUART so that you can test its command-line menu. It also switches the 48MHz oscillator output to PTA12 (CLKOUT) in case you want to verify the exact 48MHz frequency. [As reference - board gives 115'040Hz - which is 0.02% low and well within the worst case RS232 accuracy requirement which is practically about 1.5%]
Beware that the LPUART0 RX pin has a 100nF capacitor on it on the FRDM-KL03Z board which needs to be removed if frequencies higher than about 19'200 are used - otherwise the reception stops working.
For a complete KL03 solution to avoid development complications see links below.
Regards
Mark
Open source uTasker for almost all Kinetis parts with 10 IDEs, simulation and no porting efforts:
Web: https://github.com/uTasker/uTasker-Kinetis
HTTPS: https://github.com/uTasker/uTasker-Kinetis.git
SSH: git@github.com:uTasker/uTasker-Kinetis.git
Hi mark,
thanks for the reply. I found that the Rx pin is also the vref and on this board is a 0.1 Uf cap on this line, I depopulated it and it's fine now.
Hi
The 48MHz oscillator should be accurate enough without trimming. It is specified to be typically +/-0.5% over the temperature range at 3V3, with worst case +/-1.0%
If you use an SBR value of 0x1a (complete LPUART_BAUD value of 0x0f00001a) the baud rate is 115'384Hz (if 48MHz oscillator is perfect). See simulation below:
You can load the attached binary to your board as reference. It sets 115'200Baud on the LPUART so that you can test its command-line menu. It also switches the 48MHz oscillator output to PTA12 (CLKOUT) in case you want to verify the exact 48MHz frequency. [As reference - board gives 115'040Hz - which is 0.02% low and well within the worst case RS232 accuracy requirement which is practically about 1.5%]
Beware that the LPUART0 RX pin has a 100nF capacitor on it on the FRDM-KL03Z board which needs to be removed if frequencies higher than about 19'200 are used - otherwise the reception stops working.
For a complete KL03 solution to avoid development complications see links below.
Regards
Mark
Open source uTasker for almost all Kinetis parts with 10 IDEs, simulation and no porting efforts:
Web: https://github.com/uTasker/uTasker-Kinetis
HTTPS: https://github.com/uTasker/uTasker-Kinetis.git
SSH: git@github.com:uTasker/uTasker-Kinetis.git