- Silicon Labs Community
- Welcome and Announcements
- Silicon Labs Knowledge Base
- 8-bit MCU
- 32-bit MCU
- Bluetooth / Wi-Fi
- Other Products Category
- Optical/RH/Temp Sensor
- Other Products
- Hardware and Software Tools
- Simplicity Studio and Software
- General Discussions and Suggestions
- Chinese Forum
- Software Libraries
- Development Kits
- Reference Designs
- Third Party Tools
- White Papers
- Official Blog of Silicon Labs
- Chinese Blog
04-13-2017 02:40 AM
I'm programming EFM32LG330 to communicate to external module via UART. As I already used USARTs for other purposes choosing LEUART seemed like a good idea as having high speed clock would allow high baud rates.
However, I didn't recognize that LEUART0 shares pins with High Speed External Clock. Nevertheless, I thought routing these pins to other location (#1) should have positive effect. That didn't help - as I enable LEUART0 clock whole system doesn't manage to start up.
My question is: How should I get clock up and running for LEUART0 without having to sacrifice high speed external oscillator? Is it doable at all?
Solved! Go to Solution.
04-13-2017 04:33 AM
I am not sure I understand your issue or not, do you mean you are checking how to configure the clock source for LEUART peripheral?
Not sure if below KB helps:
04-13-2017 04:57 AM
My Clock setup function looks like this:
/* Set up High Frequency Crystal Oscillator and Disable RC Oscillator */
CMU_OscillatorEnable( cmuOsc_HFXO, true, true);
CMU_OscillatorEnable( cmuOsc_HFRCO, false, false );
/* Enable clock for HF peripherals */
/* Enable clock for GPIO pins */
/* Enable clock for USART0 module - communication with modem */
/* Enable clock for USART1 module - interface with a computer */
/* Enable clock for USART2 module - I2S compatible interface */
/* Enable clock for LEUART0 module, which is interfacing GNSS module */ /* MCU doesn't work if on */
/* Enable clock for LEUART1 module - interface with a SIM card */
/* Enable clock I2C0 module */
As I run this code, microprocessor freezes. As I comment CMU_ClockEnable for LEUART0, everything other than this UART works fine. I've connected my LEUART connected to PE14 and PE15 external oscillator to PB13 and PB14 which are default pins (position #0) for LEUART0.
04-13-2017 11:52 PM
You haven't enabled a clock for the LEUART.
The LEUARTs use the LFBCLK source, but you haven't selected a source for the LFBCLK.
By default, the LFACLK and LFBCLK default to the LFRCO (see the CMU_LFCLKSEL register description), but you haven't enabled the LFRCO, so nothing will happen.
Furthermore, synchronization between the HF and LE clock domains is necessary, but you also haven't enabled the HFLE clock (cmuClock_HFLE), so you need to do that.
Take a look at the examples for the LEUART in app note AN0017. They'll show all of the clock enabling/selection steps you need.
04-21-2017 06:26 AM
I added CMU_ClockEnable(cmuClock_CORELE) and CMU_ClockSelectSet(cmuClock_LFB, cmuSelect_CORELEDIV2), enabled cmuClock_LFA and LFB, but can't find cmuClock_HFLE to sinchronise clock and therefore get slightly slower baud rate. My MCU is EFM32LG330F128
04-21-2017 07:50 AM
Looked into how HFLE is written and used by my Keil and got to conclusion that such thing is now handled automatically. Also, spotted that I used wrong structure name to set initial parameters of LEUART0. It works now fully as expected.