SCC Application Notes
AMD
7–10
Table 7–5. Time Constants for Common Baud Rates
Baud
Rate
38400
19200
9600
4800
2400
1200
600
300
150
Divider
Dec
Hex
0000H
0002H
0006H
000EH
001EH
003EH
007EH
00FEH
01FEH
0
2
6
14
30
62
126
254
510
For 2.4576 MHz Clock, X16 Clock Mode
WR14
selects the baud-rate generator as the
RTxC
pin, baud-rate generator disabled,
and internal loopback. The baud-rate generator uses the
RTxC
pin as the clock source
and is not enabled at this time because the SCC initialization is not complete.
7.2.3.2
WR14
enables the baud-rate generator. Bit 0 (LSB) is changed to a ‘1’ to enable the
baud-rate generator; all other bits must maintain the value selected during initialization.
S CC Operating Mode Enables
WR3
enables the receiver. Bit 0 (LSB) is changed to a ‘1’ to enable the receiver; all other
bits must maintain the value selected during initialization.
WR5
enables the transmitter. Bit 3 is changed to a ‘1’ to enable the transmitter; all other
bits must maintain the value selected during initialization.
7.2.4
After initialization, and after all enables have been selected, the SCC is ready for commu-
nication. The transmitter buffer and the receive FIFO are empty. The example shown be-
low is coded to transmit and receive characters.
T ransmit and Rec eive Routines
;Transmit a character
TXCHAR:INPUT RRO ;Read RRO
TEST BIT2 ;Test transmit
buffer empty
JZ TXCHAR;Loop if not empty
OUTPUT CHAR ;Output character to
data port
RET ;Return
;Receive a character
RXCHAR:INPUT RRO ;Read RRO
TEST BIT 0 ;Test Receive
buffer
JZ RXCHAR;Loop if not full
INPUT CHAR ;Input character
from data port
RET ;Return
Figure 7–3. Transmit and Receive Routine