
Rev. 2.50
248
��ne 22� 20��
Rev. 2.50
249
��ne 22� 20��
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
A/D Flash MCU with EEPROM
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
A/D Flash MCU with EEPROM
• Calculating the baud rate and error values
For a clock frequency of 4MHz, and with BRGH set to 0 determine the BRG register value N,
the actual baud rate and the error value for a desired baud rate of 4800.
From the above table the desired baud rate BR=
f
CLKI
[64 (N+1)]
Re-arranging this equation gives N=
f
CLKI
−
1
(BR×64)
Giving a value for N=
4000000
−
1
(4800×64)
=12.0208
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=
4000000
[64 (12+1)]
=4808
Therefore the error is equal to
4808
−
4800
4800
=0.16%
The following tables show the actual values of baud rate and error values for the two value of
BRGH.
Baud
Rate
K/BPS
Baud Rates for BRGH=0
f
CLKI
=4MHz
f
CLKI
=3.579545MHz
f
CLKI
=7.159MHz
BRG
Kbaud
Error(%)
BRG
Kbaud
Error(%)
BRG
Kbaud
Error(%)
0.3
20�
0.300
0.�6
�85
0.300
0.00
—
—
—
�.2
5�
�.202
0.�6
46
�.�90
-0.83
92
�.203
0.23
2.4
25
2.404
0.�6
22
2.432
�.32
46
2.380
-0.83
4.8
�2
4.808
0.�6
��
4.66�
-2.90
22
4.863
�.32
9.6
6
8.929
-6.99
5
9.32�
-2.90
��
9.322
-2.90
�9.2
2
20.833
8.5�
2
�8.643
-2.90
5
�8.643
-2.90
38.4
—
—
—
—
—
—
2
32.286
-2.90
5�.6
0
62.500
8.5�
0
55.930
-2.90
�
55.930
-2.90
��5.2
—
—
—
—
—
—
0
���.859
-2.90
Baud Rates and Error Values for BRGH=0
Baud
Rate
K/BPS
Baud Rates for BRGH=1
f
CLKI
=4MHz
f
CLKI
=3.579545MHz
f
CLKI
=7.159MHz
BRG
Kbaud
Error(%)
BRG
Kbaud
Error(%)
BRG
Kbaud
Error(%)
0.3
—
—
—
—
—
—
—
—
—
�.2
20�
�.202
0.�6
�85
�.203
0.23
—
—
—
2.4
�03
2.404
0.�6
92
2.406
0.23
�85
2.406
0.23
4.8
5�
4.808
0.�6
46
4.�6
-0.83
92
4.8��
0.23
9.6
25
9.6�5
0.�6
22
9.�2�
�.32
46
9.520
-0.83
�9.2
�2
�9.23�
0.�6
��
�8.643
-2.90
22
�9.454
�.32
38.4
6
35.��4
-6.99
5
3�.286
-2.90
��
3�.286
-2.90
5�.6
3
62.5
8.5�
3
55.930
-2.90
�
55.930
-2.90
��5.2
�
�25
8.5�
�
���.86
-2.90
3
���.86
-2.90
250
0
250
0
—
—
—
—
—
—
Baud Rates and Error Values for BRGH=1