GD32F10x User Manual
431
STB[1:0]
stop bit length (bit)
usage description
10
2
normal USART and single-wire modes
11
1.5
Smartcard mode for transmitting and receiving
In an idle frame, all the frame bits are logic 1. The frame length is equal to the normal USART
frame.
A break frame is configured number of low bits followed by the configured number of stop bits.
The transfer speed of a USART frame depends on the frequency of the UCLK and the
configuration of the baud rate generator.
16.3.2.
Baud rate generation
The baud-rate divider is a 16-bit number consisting of a 12-bit integer and a 4-bit fractional
part. The number formed by these two values is used by the baud rate generator to determine
the bit period. Having a fractional baud-rate divider allows the USART to generate all the
standard baud rates.
The baud-rate divider (USARTDIV) has the following relationship to the peripheral clock:
USARTDIV=
U
CLK
16×Baud Rate
(16-1)
For example, when oversampled by 16:
1.
Get USARTDIV by caculating the value of USART_BUAD:
If USART_BUAD=0x21D, then INTDIV=33 (0x21), FRADIV=13 (0xD).
USARTDIV=33+13/16=33.81.
2.
Get the value of USART_BUAD by calculating the value of USARTDIV:
If USARTDIV=30.37, then INTDIV=30 (0x1E).
16*0.37=5.92,
the nearest integer is 6, so
FRADIV=6 (0x6).
USART_BUAD=0x1E6.
Note:
If the
roundness of
FRADIV is 16 (overflow), the carry must be added to the integer
part.
16.3.3.
USART transmitter
If the transmit enable bit (TEN) in USART_CTL0 register is set, when the transmit data buffer
is not empty, the transmitter shifts out the transmit data frame through the TX pin. Clock pulses
can be output through the CK pin.
After the TEN bit is set, an idle frame will be sent. The TEN bit should not be reset while the
transmission is ongoing.
After power on, the TBE bit is high by default. Data can be written to the USART_DATA when
the TBE bit of the USART_STAT register is asserted. The TBE bit is cleared by writing to the
USART_DATA register and will be set by hardware after the data is put into the transmit shift
Содержание GD32F10 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F10x Arm Cortex M3 32 bit MCU User Manual Revision 2 6 Jun 2022 ...
Страница 63: ...GD32F10x User Manual 63 programmed during the chip production ...
Страница 117: ...GD32F10x User Manual 117 010 1 0 011 0 9 ...
Страница 416: ...GD32F10x User Manual 416 shadow register updates every update event ...
Страница 427: ...GD32F10x User Manual 427 value ...
Страница 518: ...GD32F10x User Manual 518 These bits are not used in SPI mode ...