Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 1 month 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:
1 Answer
9 years, 1 month 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)