HT46RU66 Holtek Semiconductor Inc., HT46RU66 Datasheet - Page 39

no-image

HT46RU66

Manufacturer Part Number
HT46RU66
Description
Ht46ru66/ht46cu66 -- A/d Type 8-bit Mcu With Lcd
Manufacturer
Holtek Semiconductor Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
HT46RU66
Quantity:
1 000
Rev. 1.20
K/BPS
Baud
115.2
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 BRG register and the second is the
value of the BRGH bit within the UCR2 control regis-
ter. 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 determines the division factor, N, which is
used in the following baud rate calculation formula.
Note that N is the decimal value placed in the BRG
register and has a range of between 0 and 255.
The following tables show actual values of baud rate and error values for the two values of BRGH.
Rate
19.2
38.4
57.6
0.3
1.2
2.4
4.8
9.6
Baud Rate
UCR2 BRGH Bit
TXEN
The TXEN bit is the Transmitter Enable Bit. When
this bit is equal to 0 the transmitter will be disabled
with any pending transmissions being aborted. In
addition the buffer will be reset. In this situation the
TX pin can be used as a general purpose I/O pin. If
the TXEN bit is equal to 1 the transmitter will be
enabled and if the UARTEN bit is equal to 1 the
TX pin will be controlled by the UART. Clearing the
TXEN bit during a transmission will cause the trans-
mission to be aborted and will reset the transmitter.
If this occurs, the TX pin can be used as a general
purpose I/O pin.
BRG
103
51
25
12
6
2
1
0
f
SYS
Kbaud
17.857
41.667
1.202
2.404
4.807
9.615
62.5
125
=8MHz
[64 (N + 1)]
Error
-6.99
0.16
0.16
0.16
0.16
8.51
8.51
8.51
f
SYS
0
Baud Rates and Error Values for BRGH = 0
BRG
92
46
22
11
5
2
1
0
f
[16 (N + 1)]
SYS
f
=7.159MHz
SYS
Kbaud
111.86
1
1.203
4.863
9.322
18.64
37.29
55.93
2.38
Baud Rates for BRGH=0
Error
-0.83
0.23
1.32
-2.9
-2.9
-2.9
-2.9
-2.9
39
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 be-
tween the actual and requested value. The following
example shows how the BRG register value N and the
error value can be calculated.
Calculating the register and error values
For a clock frequency of 8MHz, and with BRGH set to
baud rate and the error value for a desired baud rate
of 9600.
From the above table the desired baud rate BR
Re-arranging this equation gives N
Giving a value for N
To obtain the closest value, a decimal value of 12
should be placed into the BRG register. This gives an
actual or calculated baud rate value of
BR
Therefore the error is equal to
0 determine the BRG register value N, the actual
BRG
207
51
25
12
[64 (N + 1)]
6
2
1
0
f
[64(12 + 1)]
SYS
f
SYS
8000000
Kbaud
0.300
1.202
2.404
4.808
8.929
20.83
62.5
=4MHz
HT46RU66/HT46CU66
Error
-6.99
0.00
0.16
0.16
0.16
8.51
8.51
9615
(
8000000
9600 64
BRG
x
185
46
22
11
f
5
2
1
0
SYS
)
=3.579545MHz
1
18.643
Kbaud
0.300
2.432
4.661
9.321
55.93
October 2, 2007
1.19
(BRx64)
12.0208
f
SYS
= 0.16%
Error
-0.83
0.00
1.32
-2.9
-2.9
-2.9
-2.9
1

Related parts for HT46RU66