7 years ago.

Using the LEUART

Is there an example of how to use the LEUART? It appears to transmit data but the baud rate is not working properly; it transmits at 125000 when set to 9600. It's clearly a clock issue but what's the proper way to resolve it. I'd like to use it in the high and low energy levels.

Question relating to:

Silicon Labs' EFM32™ Giant Gecko ARM® Cortex®-M3 based 32-bit microcontrollers (MCUs) provide flash memory configurations up to 1024 kB, 64-128 kB of RAM and CPU speeds up to 48 MHz, …

1 Answer

7 years ago.

Hi Brian,

we are currently fixing this, and the fix should be out early next week. What is happening is that, in the current version of mbed, LEUART only supports the HF clock tree as reference clock. Since you're on the Giant Gecko STK, that means a 48MHz crystal, divided internally by 4 = a 12MHz input to the LEUART peripheral. Since the internal baudrate divisor of that peripheral is only 7 bits, the minimum baudrate supported by that configuration is 95kbaud.

What we are doing now is enabling mbed to also choose the LF clock tree as input to the LEUART peripheral, which will enable it to select baudrates lower than the 95k, and in addition, enable it to go into a lower power sleep mode while still doing a transaction. The pull request for this fix is open now ( https://github.com/mbedmicro/mbed/pull/1340/ ), and I expect it to get merged into mbed pretty soon, which means it will be available for the next release (on Tuesday, I think)

Accepted Answer

That's great news, Steven. Thanks!

posted by Brian Ramos 25 Sep 2015

I am looking to use the LEUART on Jade or Pearl Gecko. On these devices, it can be on virtually any pin. How do I select LEUART as the serial port and set the pins? I would like to run it from the HF clock.

Thanks, Tom

posted by Tom Russell 10 Oct 2016