...the world's most energy friendly microcontrollers
2014-07-02 - Gecko Family - d0001_Rev1.30
224
www.silabs.com
16.3.3.1 Frame Format
The frames used in synchronous mode need no start and stop bits since a single clock is available to
all parts participating in the communication. Parity bits cannot be used in synchronous mode.
The USART supports frame lengths of 4 to 16 bits per frame. Larger frames can be simulated by
transmitting multiple smaller frames, i.e. a 22 bit frame can be sent using two 11-bit frames, and a 21
bit frame can be generated by transmitting three 7-bit frames. The number of bits in a frame is set using
DATABITS in USARTn_FRAME.
The frames in synchronous mode are by default transmitted with the least significant bit first like in
asynchronous mode. The bit-order can be reversed by setting MSBF in USARTn_CTRL.
The frame format used by the transmitter can be inverted by setting TXINV in USARTn_CTRL, and the
format expected by the receiver can be inverted by setting RXINV, also in USARTn_CTRL.
16.3.3.2 Clock Generation
The bit-rate in synchronous mode is given by Equation 16.3 (p. 224) . As in the case of asynchronous
operation, the clock division factor have a 13-bit integral part and a 2-bit fractional part.
USART Synchronous Mode Bit Rate
br = f
HFPERCLK
/(2 x (1 + USARTn_CLKDIV/256))
(16.3)
Given a desired baud rate brdesired, the clock divider USARTn_CLKDIV can be calculated using
Equation 16.4 (p. 224)
USART Synchronous Mode Clock Division Factor
USARTn_CLKDIV = 256 x (f
HFPERCLK
/(2 x brdesired) - 1)
(16.4)
When the USART operates in master mode, the highest possible bit rate is half the peripheral clock rate.
When operating in slave mode however, the highest bit rate is an eighth of the peripheral clock:
• Master mode: br
max
= f
HFPERCLK
/2
• Slave mode: br
max
= f
HFPERCLK
/8
On every clock edge data on the data lines, MOSI and MISO, is either set up or sampled. When CLKPHA
in USARTn_CTRL is cleared, data is sampled on the leading clock edge and set-up is done on the
trailing edge. If CLKPHA is set however, data is set-up on the leading clock edge, and sampled on the
trailing edge. In addition to this, the polarity of the clock signal can be changed by setting CLKPOL in
USARTn_CTRL, which also defines the idle state of the clock. This results in four different modes which
are summarized in Table 16.8 (p. 224) . Figure 16.15 (p. 225) shows the resulting timing of data
set-up and sampling relative to the bus clock.
Table 16.8. USART SPI Modes
SPI mode
CLKPOL
CLKPHA
Leading edge
Trailing edge
0
0
0
Rising, sample
Falling, set-up
1
0
1
Rising, set-up
Falling, sample
2
1
0
Falling, sample
Rising, set-up
3
1
1
Falling, set-up
Rising, sample
Summary of Contents for EFM32G
Page 505: ......