Reply
Posts: 14
Registered: ‎11-29-2016
Accepted Solution

EFM8BB Uart0 baud rate

Hi,

 

I'm newbie with the EFM8BB (starter kit) and the "EFM8BB1_UART_Lib_Buffer" example. I need to transmit over the UART0 with 9600 bps instead of the 115200 bps configured by default.

 

Is it possible? How can I do it?

 

Best regards,

 

Manuel

Posts: 7,951
Registered: ‎08-13-2003

Re: EFM8BB Uart0 baud rate

the formula is in the reference manual

erik
<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero</font></font> </a> jmg
Posts: 1,107
Registered: ‎04-27-2004

Re: EFM8BB Uart0 baud rate


I'm newbie with the EFM8BB (starter kit) and the "EFM8BB1_UART_Lib_Buffer" example. I need to transmit over the UART0 with 9600 bps instead of the 115200 bps configured by default.

 

Is it possible? How can I do it?

 


There are two parts to this  problem.

The EFM8BB1 you can change the Baud rate on, but the STK firmware is fixed at 115200 on current releases.

There is a STK upgrade somewhere in the pipeline that will support other than 115200, but for now you would need to use an external USB-UART (3v3) for testing a link to the EFM8BB1 at 9600.

 

Or, with conditional compile switches you could do some STK-PC development at 115200, and then switch to target-testing at your 9600.

 

 

Posts: 1,733
Registered: ‎10-14-2014

Re: EFM8BB Uart0 baud rate

I suggest you use the configurator tool integrated into the Simplicity Studio. you could configure the speed and it will generate the code automatically for you.

My views are my own and do not necessarily represent the views of Silicon Labs

WeiguoLu
Posts: 14
Registered: ‎11-29-2016

Re: EFM8BB Uart0 baud rate

Hi guys,

 

For my project, I need to do an UART communication at 9600bps with the EFM8BB chip integrated in a custom board. So I started with de STK! Now, I know it's possible to do it.

 

Thank you everyone for your help.

 

Best regards,

 

Manuel

Posts: 14
Registered: ‎11-29-2016

Re: EFM8BB Uart0 baud rate

Hi again,

 

I'm with the Configurator Tool trying to configure the "Clock Control" and the "Timer 1" (in Mode 2, 8-bit counter/timer) in order to get the 9600 baud rate what I need it. 

 

I only can change the "SYSCLK Source divider" in "Properties of Clock Control" and "Clock Control 0 prescale" in "Properties of Timers", getting 5918 bauds and 11962 bauds values closer to 9600. 

 

Does anyone know what am I doing wrong? 

 

Thank you guys,

 

Manuel

 

Posts: 14
Registered: ‎11-29-2016

Re: EFM8BB Uart0 baud rate

Ok,

 

I find you can configure Target Overflow Frecuency to achive the baud rate desired.

 

 

Posts: 55
Registered: ‎10-25-2016

Re: EFM8BB Uart0 baud rate

what is external USB -UART???

even i couldn't able to get 9600 baud rate,i am getting 10000 baud rate,but couldn't able to get 9600

Highlighted
Posts: 7,951
Registered: ‎08-13-2003

Re: EFM8BB Uart0 baud rate

[ Edited ]

even i couldn't able to get 9600 baud rate,i am getting 10000 baud rate,but couldn't able to get 9600

 

getting baud rates with T1 is often impossible when not using a "UART frequency" oscillator/

 

in such cases one must use T2 with its finer granulation for the oscillator divide.

 

since that option is not available in the BB1 (argh) you will need to 'tune' the oscillator frequency, maybe use an external crystal such as 11.059MHz

erik
Posts: 55
Registered: ‎10-25-2016

Re: EFM8BB Uart0 baud rate

what is external usb -uart???

even i am facing the same problem of baud rate

 

<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero</font></font> </a> jmg
Posts: 1,107
Registered: ‎04-27-2004

Re: EFM8BB Uart0 baud rate

[ Edited ]

pradnya wrote:

what is external usb -uart???

even i am facing the same problem of baud rate


external USB-UART means a product like CP2102N-MINI, - this allows any PC host to generate almost any serial baud rate, using the formulas

 

ActualBaud = 24M/round(24M/DesiredBaud)
BaudError  = 100*(1-DesiredBaud/ActualBaud) (+ some USB FLL error << 1%)

 

DesiredBaud = 115200
ActualBaud  = 24M/round(24M/DesiredBaud)      = 115384.615
BaudError   = 100*(1-DesiredBaud/ActualBaud)  = 0.16