Rev. 2.10
23�
���� 02� 201�
Rev. 2.10
235
���� 02� 201�
HT68F20/HT68F30/HT68F40/HT68F50/HT68F60
HT68FU30/HT68FU40/HT68FU50/HT68FU60
Enhanced I/O Flash Type 8-Bit MCU with EEPROM
HT68F20/HT68F30/HT68F40/HT68F50/HT68F60
HT68FU30/HT68FU40/HT68FU50/HT68FU60
Enhanced I/O Flash Type 8-Bit 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
207
0.300
0.16
185
0.300
0.00
—
—
—
1.2
51
1.202
0.16
�6
1.190
-0.83
92
1.203
0.23
2.�
25
2.�0�
0.16
22
2.�32
1.32
�6
2.380
-0.83
�.8
12
�.808
0.16
11
�.661
-2.90
22
�.863
1.32
9.6
6
8.929
-6.99
5
9.321
-2.90
11
9.322
-2.90
19.2
2
20.833
8.51
2
18.6�3
-2.90
5
18.6�3
-2.90
38.�
—
—
—
—
—
—
2
32.286
-2.90
57.6
0
62.500
8.51
0
55.930
-2.90
1
55.930
-2.90
115.2
—
—
—
—
—
—
0
111.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
—
—
—
—
—
—
—
—
—
1.2
207
1.202
0.16
185
1.203
0.23
—
—
—
2.�
103
2.�0�
0.16
92
2.�06
0.23
185
2.�06
0.23
�.8
51
�.808
0.16
�6
�.76
-0.83
92
�.811
0.23
9.6
25
9.615
0.16
22
9.727
1.32
�6
9.520
-0.83
19.2
12
19.231
0.16
11
18.6�3
-2.90
22
19.�5�
1.32
38.�
6
35.71�
-6.99
5
37.286
-2.90
11
37.286
-2.90
57.6
3
62.5
8.51
3
55.930
-2.90
7
55.930
-2.90
115.2
1
125
8.51
1
111.86
-2.90
3
111.86
-2.90
250
0
250
0
—
—
—
—
—
—
Baud Rates and Error Values for BRGH=1