16. USART2
A96G150 User's manual
242
UBAUD (USART Baud-Rate Generation Register) FCH
7
6
5
4
3
2
1
0
UBAUD7
UBAUD6
UBAUD5
UBAUD4
UBAUD3
UBAUD2
UBAUD1
UBAUD0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Initial value: FF
H
UBAUD [7:0]
The value in this register is used to generate internal baud rate in
asynchronous mode or to generate XCK clock in synchronous or SPI
mode. To prevent malfunction, do not write ‘0’ in asynchronous mode,
and do not write ‘0’ or ‘1’ in synchronous or SPI mode.
UDATA (USART Data Register) FDH
7
6
5
4
3
2
1
0
UDATA7
UDATA6
UDATA 5
UDATA 4
UDATA 3
UDATA 2
UDATA 1
UDATA 0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Initial value: 00
H
UDATA [7:0]
The USART Transmit Buffer and Receive Buffer share the same I/O
address with this DATA register. The Transmit Data Buffer is the
destination for data written to the UDATA register. Reading the
UDATA register returns the contents of the Receive Buffer.
Write this register only when the UDRE flag is set. In SPI or
synchronous master mode, write this register even if TX is not enabled
to generate clock, XCK.
FPCR (USART Floating Point Register) 1019H
7
6
5
4
3
2
1
0
FPCR7
FPCR6
FPCR5
FPCR4
FPCR3
FPCR2
FPCR1
FPCR0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Initial value: 00
H
FPCR [7:0]
USART Floating Point Counter
8-bit floating point counter
NOTE:
BAUD RATE compensation can be used in the following ways:
Example 1
Condition: sysclk = 16MHz, Baud rate = 9600 bps, Asynchronous Normal Mode (U2X = 0)
Baud rate = sysclk / 16 x (UBAUD + 1)
Calculated UBAUD = (1000000 / Target Baud rate) – 1 = 103.17, Error rate = 0.17
⇒
UBAUD = 104
UCTRL4 = 0x04, Enable baud rate Compensation
Calculated FPCR = (UBAUD - Calculated UBAUD) x 256 = (104 – 103.17) x 256 = 212.48
⇒
FPCR = 213
Example 2
Condition : sysclk = 16MHz, Baud rate = 115,200 bps, Asynchronous Normal Mode (U2X = 0)
Baud rate = sysclk / 16 x (UBAUD + 1)
Calculated UBAUD = (1000000 / Target Baud rate) – 1 = 7.68, Error rate = 0.68
⇒
UBAUD = 8
UCTRL4 = 0x04, Enable baud rate Compensation
Calculated FPCR = (UBAUD - Calculated UBAUD) x 256 = (8 – 7.68) x 256 = 81.92
⇒
FPCR = 82
Содержание A96G150
Страница 126: ...12 Timer 0 1 2 3 4 5 A96G150 User s manual 126 Figure 43 16 bit Timer Counter Mode Operation Example...
Страница 136: ...12 Timer 0 1 2 3 4 5 A96G150 User s manual 136 Figure 51 16 bit Timer Counter Mode Operation Example...
Страница 147: ...A96G150 User s manual 12 Timer 0 1 2 3 4 5 147 Figure 59 16 bit Timer Counter Mode Operation Example...
Страница 157: ...A96G150 User s manual 12 Timer 0 1 2 3 4 5 157 Figure 67 16 bit Timer Counter Mode Operation Example...
Страница 171: ...A96G150 User s manual 14 12 bit ADC 171 Figure 79 ADC Operation Flow Sequence...
Страница 333: ...A96G150 User s manual Revision history 333 Revision history Revision Date Notes 1 00 2022 06 22 First creation...