Rev. 1.20
124
�an�a�� 2�� 201�
Rev. 1.20
12�
�an�a�� 2�� 201�
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
TXR_RXR register
The TXR_RXRn register is the data register which is used to store the data to be transmitted on the
TXn
pin or being received from the RX
n
pin.
Bit
7
6
5
4
3
2
1
0
Name
TXRX7
TXRX6
TXRX�
TXRX4
TXRX�
TXRX2
TXRX1
TXRX0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
POR
x
x
x
x
x
x
x
x
"x" �nknown
Bit 7~0
TXRX7~TXRX0
: UART Transmit/Receive Data bit 7 ~ bit 0
Baud Rate Generator
To setup the speed of the serial data communication, the UART function contains its own dedicated
baud rate generator. The baud rate is controlled by its own internal free running 8-bit timer, the period
of which is determined by two factors. The first of these is the value placed in the baud rate register
BRG and the second is the value of the BRGH bit with the control register UCR2. The BRGH bit
decides if the baud rate generator is to be used in a high speed mode or low speed mode, which in
turn determines the formula that is used to calculate the baud rate. The value in the BRG register, N,
which is used in the following baud rate calculation formula determines the division factor. Note that
N is the decimal value placed in the BRG register and has a range of between 0 and 255.
UCR2 BRGH Bit
0
1
Ba�d Rate (BR)
f
SYS
/ [64 (N+1)]
f
SYS
/ [16 (N+1)]
By programming the BRGH bit which allows selection of the related formula and programming the
required value in the BRG register, the required baud rate can be setup. Note that because the actual
baud rate is determined using a discrete value, N, placed in the BRG register, there will be an error
associated between the actual and requested value. The following example shows how the BRG
register value N and the error value can be calculated.
BRG Register
Bit
7
6
5
4
3
2
1
0
Name
BRG7
BRG6
BRG�
BRG4
BRG�
BRG2
BRG1
BRG0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
POR
x
x
x
x
x
x
x
x
"x" �nknown
Bit 7~0
BRG7~BRG0
: Baud Rate values
By programming the BRGH bit in UCR2 Register which allows selection of the
related formula described above and programming the required value in the BRG
register, the required baud rate can be setup.
Содержание BS82B12A-3
Страница 33: ...Rev 1 20 33 January 23 2015 BS82B12A 3 BS82C16A 3 BS82D20A 3 Touch Key 8 Bit Flash MCU with LED LCD Driver ...
Страница 34: ...Rev 1 20 34 January 23 2015 BS82B12A 3 BS82C16A 3 BS82D20A 3 Touch Key 8 Bit Flash MCU with LED LCD Driver ...
Страница 35: ...Rev 1 20 35 January 23 2015 BS82B12A 3 BS82C16A 3 BS82D20A 3 Touch Key 8 Bit Flash MCU with LED LCD Driver ...