![](http://datasheet.mmic.net.cn/370000/ST20GP1_datasheet_16733510/ST20GP1_77.png)
ST20-GP1
77/116
13.3.1 Baud rates
The baud rate generator provides a clock at 16 times the baud rate. The baud rate and the required
reload value for a given baud rate can be determined by the following formulas:
where: <ASCBaudRate> represents the content of the
ASCBaudRate
register, taken as unsigned
16-bit integer,
f
CPU
is the frequency of the CPU.
Note that altering the CPU speed selection pins will thus change the baud rate. Software can
accommodate this by reading the
SysRatio
register, see section 10.3, in calculating the CPU
frequency.
The table below lists various commonly used baud rates together with the required reload values
and the deviation errors for the ST20-GP1 using a CPU clock of 33.736 MHz.
Note:
The deviation errors given in the table above are rounded.
13.4 Interrupt control
The ASC contains two registers that are used to control interrupts, the status register (
ASCStatus
)
and the interrupt enable register (
ASCIntEnable
). The status bits in the
ASCStatus
register
determine the cause of the interrupt. Interrupts will occur when a status bit is 1 (high) and the
corresponding bit in the
ASCIntEnable
register is 1.
The error interrupt signal (
ErrorInterrupt
) is generated by the ASC from the OR of the parity error,
framing error, and overrun error status bits after they have been ANDed with the corresponding
enable bits in the
ASCIntEnable
register.
Baud rate
Reload value
(exact)
Reload value
(integer)
Reload value
(hex)
Deviation error
38400
28800
19200
14400
9600
4800
2400
1200
600
300
75
53.28125
71.04167
106.5625
142.0833
213.125
426.25
852.5
1705
3410
6820
27280
53
71
107
142
213
426
853
1705
3410
6820
27280
35
47
6B
8E
D5
1AA
355
6A9
D52
1AA4
6A90
-0.53%
-0.06%
0.41%
-0.06%
-0.06%
-0.06%
0.06%
0.00%
0.00%
0.00%
0.00%
Table 13.1 Baud rates
Baud rate =
16 (<ASCBaudRate>)
<ASCBaudRate> = ( 16 xf
f
CPU
CPU