using FRDM-KL03Z LPUART0 at 115200 baud

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

using FRDM-KL03Z LPUART0 at 115200 baud

Jump to solution
527 Views
rameshiyer
Contributor I

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 ? 

Labels (1)
0 Kudos
1 Solution
399 Views
mjbcswitzerland
Specialist V

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:

pastedImage_1.png

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

View solution in original post

0 Kudos
2 Replies
399 Views
rameshiyer
Contributor I

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.

0 Kudos
400 Views
mjbcswitzerland
Specialist V

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:

pastedImage_1.png

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

0 Kudos