LPUART0 baudrate

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

LPUART0 baudrate

834 Views
akimata
Contributor IV

Hello,

I've got problem with setting baudrate highter than 9600.

Microcontroller : K82

Clock is internal fast oscillator 4MHz

According to this :

Baud Rate = LPUART ASYNCH Module Clock / (SBR[12:0] × (OSR+1))

If i set SBR at 13, and OSR at 31 i get almost  9600 and it works just fine but the problem starts when i want any higher baudrate, let's say i will set SBR at 3 and OSR at 31 and i should get something close to 41500 according to the formula but according to oscilloscope i get something close to 18000. It gets even worse when LPUART0 source is FLL.

Is there any script or software to get as close to standard baudrates or i need to find right numbers(dividers) by myself?

What am i missing? Where's the catch?

2 Replies

642 Views
akimata
Contributor IV

I read almost every post about lpuart, config is correct except baudrate and clocking.

Baudrate clock/(SBR*(OSR+1))

How is  4MHz/(13*(31+1)) = 9615 not equal to: 4Mhz/(26*(15+1) )= 9615, in theory they're equal but both settings gives me 2 different baudrates so it looks like there is strange corelation between OSR and SBR.

@Edit

I noticed that only 16 and 32 can be set in OSR (15 and 31), any other value results in getting 16/32. In SBR field there is  always "1"  on third spot from LSB,  so  if i set 8 result in 12, value of 12 results in 12 etc.

Also there is no way to set FLL/PPL or IRC48M in SIM_SOPT2, value in the register doesn't want to change or clear, only fast internal oscillator can be set.

Knowing these problems i could easily set specific baudrate but achieving 57200 or any higher baud is just impossible when i can't manipulate OSR and SBR freely.

Noticed that on  custom K80 board  also on FRDM-K82.

Any ideas what might be wrong?

642 Views
miduo
NXP Employee
NXP Employee

Hi,

Please make reference from this post on how to config the baudrate. Although it is for K22, but the proceduce for K82 is same. https://community.nxp.com/message/669194

https://community.nxp.com/message/1012371

0 Kudos