English
Language : 

EFM32WG Datasheet, PDF (496/834 Pages) List of Unclassifed Manufacturers – The EFM32WG Wonder Gecko is the ideal choice for demanding 8-, 16-, and 32-bit energy sensitive applications.
...the world's most energy friendly microcontrollers
The clock divider used in the LEUART is a 12-bit value, with a 7-bit integral part and a 5-bit fractional
part. The baud rate of the LEUART is given by :
LEUART Baud Rate Equation
br = fLEUARTn/(1 + LEUARTn_CLKDIV/256)
(19.1)
where fLEUARTn is the clock frequency supplied to the LEUART. The value of LEUARTn_CLKDIV thus
defines the baud rate of the LEUART. The integral part of the divider is right-aligned in the upper 24
bits of LEUARTn_CLKDIV and the fractional part is left-aligned in the lower 8 bits. The divider is thus a
256th of LEUARTn_CLKDIV as seen in the equation.
For a desired baud rate brDESIRED, LEUARTn_CLKDIV can be calculated by using:
LEUART CLKDIV Equation
LEUARTn_CLKDIV = 256 x (fLEUARTn/brDESIRED - 1)
(19.2)
Table 19.2 (p. 496) lists a set of desired baud rates and the closest baud rates reachable by the
LEUART with a 32.768 kHz clock source. It also shows the average baud rate error.
Table 19.2. LEUART Baud Rates
Desired baud rate
[baud/s]
300
600
1200
2400
4800
9600
LEUARTn_CLKDIV
27704
13728
6736
3240
1488
616
LEUARTn_CLKDIV/256
108,21875
53,625
26,3125
12,65625
5,8125
2,40625
Actual baud rate
[baud/s]
300,0217
599,8719
1199,744
2399,487
4809,982
9619,963
Error [%]
0,01
-0,02
-0,02
-0,02
0,21
0,21
19.3.4 Data Transmission
Data transmission is initiated by writing data to the transmit buffer using one of the methods described
in Section 19.3.4.1 (p. 496) . When the transmission shift register is empty and ready for new data,
a frame from the transmit buffer is loaded into the shift register, and if the transmitter is enabled,
transmission begins. When the frame has been transmitted, a new frame is loaded into the shift register
if available, and transmission continues. If the transmit buffer is empty, the transmitter goes to an idle
state, waiting for a new frame to become available. Transmission is enabled through the command
register LEUARTn_CMD by setting TXEN, and disabled by setting TXDIS. When the transmitter is
disabled using TXDIS, any ongoing transmission is aborted, and any frame currently being transmitted is
discarded. When disabled, the TX output goes to an idle state, which by default is a high value. Whether
or not the transmitter is enabled at a given time can be read from TXENS in LEUARTn_STATUS.
After a transmission, when there is no more data in the shift register or transmit buffer, the TXC flag in
LEUARTn_STATUS and the TXC interrupt flag in LEUARTn_IF are set, signaling that the transmitter is
idle. The TXC status flag is cleared when a new byte becomes available for transmission, but the TXC
interrupt flag must be cleared by software.
19.3.4.1 Transmit Buffer Operation
A frame can be loaded into the transmit buffer by writing to LEUARTn_TXDATA or LEUARTn_TXDATAX.
Using LEUARTn_TXDATA allows 8 bits to be written to the buffer. If 9 bit frames are used, the 9th bit
will in that case be set to the value of BIT8DV in LEUARTn_CTRL. To set the 9th bit directly and/or
use transmission control, LEUARTn_TXDATAX must be used. When writing data to the transmit buffer
2013-05-08 - Wonder Gecko Family - d0233_Rev0.50
496
www.energymicro.com