Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Silicon Labs Community
- :
- Silicon Labs Community Knowledge Base
- :
- Microcontrollers Knowledge Base
- :
- 32-bit MCU Knowledge Base
- :
- EFM32 LEUART calculate bit errors

- Silicon Labs Community
- Forum
- Welcome and Announcements
- Silicon Labs Knowledge Base
- Microcontrollers
- 8-bit MCU
- 32-bit MCU
- Wireless
- Bluetooth / Wi-Fi
- Mesh
- Proprietary
- Other Products Category
- Optical/RH/Temp Sensor
- Timing
- Interface
- Other Products
- Hardware and Software Tools
- Simplicity Studio and Software
- Discussions
- General Discussions and Suggestions
- Chinese Forum
- ChineseForum
- Share
- Projects
- Contests
- Tools
- Software Libraries
- Development Kits
- Reference Designs
- Third Party Tools
- Training
- Video-Tutorials
- Lectures
- White Papers
- Blog
- Official Blog of Silicon Labs
- Chinese Blog

- Article History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Email to a Friend
- Printer Friendly Page
- Report Inappropriate Content

How do I determine bit time errors using LEUART with EFM32 and EFR32 devices?

The reference manual gives the equations for LEUART optimal sampling point and actual sampling point. If using a fractional divider, bit times will vary in length of time based on these formulas. In some cases, single bits may be transmitted or sampled (received) at the wrong time and a bit error can occur between the two UART devices.

To help simplify bit time error calculations and determine if a particular baud rate divisor will work using a given LFRCO or LFXO frequency range, use the attached LEUART error calculator spreadsheet.

The spreadsheet contains three pages that are configured to use the LFRCO minimum, typical, and maximum frequency as a baud rate clock source.

Cells highlighted in yellow should be modified using parameters specified by the user.

Cells highlighted in gray should not be modified as they are derived from user inputs.

Cells highlighted in green are within specified tolerances.

Cells highlighted in red are outside specified tolerances.

User specified field values:

Target Baud (bps) - the desired UART bitrate for the system in bits per second

LEUART_CLK (Hz) - the LEUART clock in hertz (ie 32768). This calculator should be used three times, once for the minimum frequency, once for typical frequency, and again for the maximum frequency.

CLKDIV - User must enter the desired fractional divider for the LEUART baud rate generator. Use the following formula to calculate a good initial value:

LEUARTn_CLKDIV = 256 x (fLEUARTn/brDESIRED - 1)

Max bit error % - The error % maximum in absolute bit time position of the actual bit time vs the expected bit time. If both UART receivers sample in the middle of a bit time, then a maximum error of 50% can be used. Otherwise this value should be reduced to meet system requirements (ie 25%).

Min bit error % - The error % minimum in absolute bit time position of the actual bit time vs the expected bit time. If both UART receivers sample in the middle of a bit time, then a minimum error of -50% can be used. Otherwise this value should be reduced to meet system requirements (ie -25%).

Once all fields have been entered for a given clock frequency, the calculator will calculate the following values:

Calculated Baud (bps) - The actual baud rate, or average bit rate over all 10 bit-times at 8N1. Since each individual bit time may vary, this value represents the average bit time for all bit times in a frame. The actual baud rate vs target baud rate error percent is shown to the right.

Bit time (us) - The target bit time duration for each bit in microseconds. This specifies the target bit time duration for each bit within the frame.

For each bit time in the frame (10 bits = 1 start + 8 data bits + 1 stop), the calculator shows:

n - the nth bit in the frame (0 = start, 1-8 = data bits, 9 = stop bit)

Scalculated - the ideal sampling point in LEUART_CLK edges

Sactual - the actual sampling point in LEUART_CLK edges

Serror - the error between Sactual vs Scalculated in LEUART_CLK edges

Bit error (us) - Serror in microseconds

Bit error (%) - Bit error (us) in % error of expected bit time (us)

Target cumulative time (us) - the target bit time position in microseconds relative to the start of frame

Calculated cumulative time (us) - the calculated bit time position in microseconds relative to the start of frame

Calculated bit error (%) - the bit time position error in percent

Actual cumulative time (us) - the actual bit time position in microseconds relative to the start of frame

Actual cumulative bit error (%)- the error between actual bit time and target bit time in percent

To use the calculator to determine if any bit time will be out of spec, perform the following steps:

1. Start on the LFRCO - Typ page. This page is configured for LEUART clocked by the LFRCO running at its typical frequency (32768 Hz)

2. Enter the desired baud rate for UART communications in cell F1 (ie 9600 bps)

3. Enter the typical LEUART clock frequency in cell F2 (ie LFRCO typical is 32768 Hz)

4. Enter a CLKDIV value in cell C1 calculated using the following formula:

LEUARTn_CLKDIV = 256 x (fLEUARTn/brDESIRED - 1)

-or-

Use a LEUARTn_CLKDIV value from the reference manual table (ie 616 for 9600 bps using 32768 LFCLK).

5. Check that average bit rate error isn't more than 5% in cell G3 (highlighted in green if within +/- 5% or red otherwise)

6. For each bit time, n = 0 ... 9, verify that actual bit error % does not exceed specified min/max tolerance (green if within tolerance, red otherwise)

7. Repeat steps 1-6 using LFRCO - Min page using the clock minimum frequency and again using LFRCO - Max page using the clock maximum frequency

Users may need to adjust the CLKDIV value to eliminate bit errors or select a higher precision oscillator such as the LFXO. Also choosing a LEUART divider (CLKDIV/256) that is a whole number will ensure that each bit time duration is the same length of time.