Asynchronous / synchronous serial interface UM0404
254/564 DocID13284 Rev 2
An auto-reload of the timer with the content of the reload register is performed each time
S0BG is written to. However, if S0R = ‘0’ at the time the write operation to S0BG is
performed, the timer will not be reloaded until the first instruction cycle after S0R = ‘1’.
S0BG (FEB4h / 5Ah) SFR Reset Value: 0000h
Asynchronous mode baud rates
For asynchronous operation, the Baud rate generator provides a clock with 16 times the rate
of the established Baud rate. Every received bit is sampled at the 7th, 8th and 9th cycle of
this clock. The Baud rate for asynchronous operation of serial channel ASC0 and the
required reload value for a given Baud rate can be determined by the following formulas:
(S0BRL) represents the content of the reload register, taken as unsigned 13-bit integer,
(S0BRS) represents the value of bit S0BRS (‘0’ or ‘1’), taken as integer.
Using the above equation, the maximum Baudrate can be calculated for any given clock
speed. The device datasheet gives a table of values for Baudrate vs. reload register value
for S0BRS = 0 and S0BRS = 1.
Synchronous mode baud rates
For synchronous operation, the Baud rate generator provides a clock with four times the
rate of the established Baud rate. The Baud rate for synchronous operation of serial channel
ASC0 can be determined by the following formula:
(S0BRL) represents the content of the reload register, taken as unsigned 13-bit integers,
(S0BRS) represents the value of bit S0BRS (‘0’ or ‘1’), taken as integer.
Using the above equation, the maximum Baud rate can be calculated for any given clock
speed.
10.5 ASC0 interrupt control
Four bit addressable interrupt control registers are provided for serial channel ASC0.
Register S0TIC controls the transmit interrupt, S0TBIC controls the transmit buffer interrupt,
S0RIC controls the receive interrupt and S0EIC controls the error interrupt of serial channel
ASC0. Each interrupt source also has its own dedicated interrupt vector. S0TINT is the
transmit interrupt vector, S0TBINT is the transmit interrupt vector, S0RINT is the receive
interrupt vector, and S0EINT is the error interrupt vector.
1514131211109876543210
- - - Baud Rate
RW
B
Async
=
f
CPU
16 x [2 + (S0BRS)] x [(S0BRL) + 1]
S0BRL = (
f
CPU
16 x [2 + (S0BRS)] x B
Async
) - 1
B
Sync
=
S0BRL = (
f
CPU
4 x [2 + (S0BRS)] x B
Sync
) - 1
f
CPU
4 x [2 + (S0BRS)] x [(S0BRL) + 1]