The LEUART provides full UART communication running from a 32.768 kHz clock input. It allows UART communication down to EM2 as well as data transmission and reception using DMA.
The LEUART is limited to 9600 baud due to the low frequency clock that it runs from. If you want to try this example using the WSTK VCOM, we need to change its baud rate from the default 115200. It's also possible to simply connect an external UART<->USB converter instead of using the VCOM, in which case these instructions are not needed.
To change the WSTK VCOM settings we need to connect to the WSTK via serial port to access the board controller.
To change the settings through serial connection, we can use the console in Simplicity Studio:
Once the console session is opened you’ll be shown the WSTK command prompt. If you write serial vcom it will print out the existing settings.
C:\SiliconLabs\SimplicityStudio\versionX\developer\sdks\gecko_sdk_suite\versionY\platform) to the project
This example makes use the LEUART Start Frame and Signal Frame features. Essentially these allow the LEUART to generate an interrupt upon receiving a pre-configured byte allowing enhanced energy savings and more fine control over what gets read by the LEUART. Briefly this is how the examples operates:
Note: The DMA will only copy 20 bytes after the start frame (including the signal frame) so if more bytes are sent then the 21st byte will have the same functional effect as sending the signal frame so that the LEUART doesn't become blocked.
Here is a screenshot showing what happens in the terminal when we send "*My Device#" into the LEUART (*My Device# is sent to the LEUART and echoed on the terminal). A scanning device would see the device name as being My Device.
And here is the Energy Profiler with the larger current spike corresponding to the LEUART activity.