R65C51 Asynchronous Communications: Prelimlnary
R65C51 Asynchronous Communications: Prelimlnary
R65C51 Asynchronous Communications: Prelimlnary
ASYNCHRONOUS COMMUNICATIONS
PRELiMlNARY
DESCRIPTION FEATURES
The Rockwell CMOS R65C51 Asynchronous Communications Low power CMOS N-well silicon gate technology
Interface Adapter (ACIA) provides an easily implemented, pro- Direct replacement for NMOS R6551 ACIA
gram controlled interface between 8-bit microprocessor-based Full duplex operation with buffered receiver and transmitter
systems and serial communication data sets and modems.
Data set/modem control functions
The ACIA has an internal baud rate generator. This feature elim- Internal baud rate generator with 15 programmable bau
inates the need for multiple component support circuits, a crystal rates (50 to 19,200)
being the only other part required. The Transmitter baud rate . Program-selectable internally or’externally controlled receive
can be selected under program control to be either 1 of 15 dif- rate
ferent rates from 50 to 19,200 baud, or at l/16 times an external . Programmable word lengths, number of stop bits, and pant
clock rate. The Receiver baud rate may be selected under pro- bit generation and detection
gram control to be either the Transmitter rate, or at l/16 times Programmable interrupt control
the external clock rate. The ACIA has programmable word
Program reset
lengths of 5, 6, 7, or 8 bits; even, odd, or no parity; 1, 1'12, or
Program-selectable serial echo mode
2 stop bits.
Two chip selects
The ACIA is designed for maximum programmed control from 1 or 2 MI-Q operation
the microprocessor (MPU), to simplify hardware implementa- 5.0 Vdc t 5% supply requirements
tion. Three separate registers permit the MPU to easily select 28-pin plastic or ceramic DIP
the R65C51’s operating modes and’ data checking parameters
Full TTL compatibility
and determine operational status.
Compatible with. R6500, R6500/’ and R65COO micro-
The Command Register controls parity, receiver echo mode, processors
transmitter interrupt control, the state of the RTS line, receiver
interrupt control, and the state of the DTR line.
The Transmitter and Receiver Data Registers are used for tem-
porary data storage by the ACIA Transmit and Receiver circuits.
ORDERING INFORMATION
- Frequency Range:
1 = 1 MHz
2 = 2 MHz
Package:
C = Ceramic
P = Plastic
Figure 1. R65C51 AClA Pin Configuration
TRANSMIT
I
I
CONTROL l-
I
CTS
t
1 , *
> TRANSMIT ’ TRANSMIT
I DATA > SHIFT __) TxD
; __c REGISTER REGISTER
& .
4p Dcd
STATUS
REGISTER + DSR
l
’ BAUD N RxC
a CONTROL c RATE -XTLt
cI REGISTER GENERATOR __c XTl_O
L
a COMMAND ’ tDTR
cc REGISTER ,RTS
RSl ------ 1
$2 RECEIVE
TIMING 1 t SHIFT RxD
RES L REGISTER
* REGISTER
I RECEIVE
CONTROL
1
2-297
R&C51 Asynchronous Communications Interface Adapter (ACIA
STATUS REGISTER Parity Error (Bit 0), Framing Error (Bit l), and
The Status Register indicates the state of interrupt conditions
Overrun (2)
and other non-interrupt status lines. The interrupt conditions are None of these bits causes a processor interrupt to occur, t
the Data Set Ready, Data Carrier Detect, Transmitter Data Reg- they are normally checked at the time the Receiver Data Re
ister Empty and Receiver Data Register Full as reported in bits ister is read so that the validity of the data can be verified. The
6 through 3, respectively. If any of these bits are set, the Inter- bits are self clearing (i.e., they are automatically cleared at:
rupt (IRQ) indicator (bit 7) is also set. Overrun, Framing Error, a read of the Receiver Data Register).
and Parity Enor are also reported (bits 2 through 0 respectively).
7 6 5 4 3 2 1 0
t ,
Receiver Data Register Full (Bit 3)
IRG DSR DCD TDRE RDRE OVRN FE PE
This bit goes to a 1 when the ACIA transfers data from :’
4
Receiver Shift Register to the Receiver Data Register. and go.
Bit 7 Interrupt (IRQ) to a 0 (is cleared) when the processor reads the Receiver D;
0 No interrupt Register.
1 Interrupt has occurred
76543210
0 -1-I 1 0 0 0 0 Hardware reset
- -/-(- - 0 - _ ’ Program reset
1
2-298
m
-
R65C5 1 Asynchronous Communications Interface Adapter (ACIA)
2-299
R65C51 Asynchronous Communications Interface Adapter (ACIA
NOTE
‘The transmitter is disabled immediately. The receiver is
disabled but will first complete receiving a byte in process
of being received.
2-300
5s
Asynchronous Communications Interface Adapter (ACIA)
_2. *e-a srows the ACIA interface signals associated with the The iis1s pin is an interrupt output from the interrupt control logic.
-&zrocessor and the modem. It is an open drain output, permitting several devices to be con-
nected to the common m microprocessor input. Normally a
high level, m goes low when an interrupt occurs.
1
cl
cessor and the ACIA. These lines are bi-directional and are nor-
DATA & mally high-impedance except during Read cycles when the
-_) TxD
SHIFT ACIA is selected.
REGISTERS
c-OCD
.--iz% Chip Selects (CSO, a)
I/O W RxC
CONTROL BAUD The two chip select inputs are normally connected to the pro-
RATE * XTLI cessor address lines either directly or through decoders. The
GENERATOR --c XTLO ACIA is selected when CSO is high and C%i is low. When the
ACIA is selected, the internal registers are addressed in accor-
dance with the register select lines (RSO, RSl).
62
RES
I COMMAND
REGISTER I Register Selects (RSO, RSl)
The two register select lines are normally connected to the pro-
cessor address lines to allow the processor to select the various
C Rx0 ACIA internal registers. Table 1 shows the internal register
select coding.
2-301
R65C51 Asynchronous Communications Interface Adapter (ACIA
ACIA/MODEM INTERFACE Clear to Send (m)
The Cm input pin controls the transmitter operation. The enabl
Crystal Pins (XTLI, XTLO) state is with CTS low. The transmitter is automatically disable
These pins are normally directly connected to the parallel mode if CTS is high.
external crystal (1.8432 MHz) to derive the various baud rates.
Alternatively, an externally generated clock can drive the XTLI Data Terminal Ready (m)
pin, in which case the XTLO pin must float. XTLI is the input
This output pin indicates the status of the ACIA to the moderr
pin for the transmit clock.
A low on DTR indicates the ACIA is enabled, a high indicate:
it is disabled. The processor controls this pin via bit 0 of the
Transmit Data (TxD) Command Register.
The TxD output line transfers serial nonreturn-to-zero (NRZ)
data to the modem. The least significant bit (LSB) of the Transmit Data Set Ready (m)
Data Register is the first data bit transmitted and the rate of data
The m input pin indicates to the ACIA the status of the
transmission is determined by the baud rate selected or under modem. A low indicates the “ready” state and a high, “not.
control of an external clock. This selection is made by program- ready. ”
ming the Control Register.
The processor must then identify that the Transmit Data Reg-
Request to Send (m)
ister is ready to be loaded and must then load it with the next
The m output pin controls the modem from the processor. data word. This must occur before the end of the Stop Bit, other-
The state of the RTS pin is determined by the contents of the wise a continuous “MARK” will be transmitted. Figure 5 shows
Command Register. the continuous Data Transmit timing relationship.
PROCESSOR MUST
PROCESSOR /
\ LOAONEWOATA
INTERRUPT \ IN THIS TIME
PROCESSOR.REAOSSTATUS
(TRANSMIT OATA INTERVAL; OTHERWISE,
REGISTER, CAUSES IRO
REGISTER EMPTY) CONTINUOUS “MARK”
TO CLEAR
IS TRANSMITTED
2-302
Asynchronous Communications Interface Adapter (ACIA)
--- -
PROCISSOR / \ \
INtERRUrT OCCURS/
PROCESSOR MUST READ I
ABOUT 0110 INTO \ \ RECEIVER DATA IN THIS
LAST STOP SIT.
PROCPSIOR READS STATUS TIME INTERVAL; OTblERWISE.
PARITY. OVERRUN.
REGISTER. CAUSES %8 OVERRUN OCCURS
AND FRAMING ERROR
TO CLEAR
ALSO, UPOATED
_ CHARACTER _
TIME
I
/
IRa
Iu , Ill
I
PROCESSOR
INTERRUPT
FOR DATA
REGISTER ’ ,&j
EMPTY
PROCESSOR NEW DATA, TRANShllSSION STARTS
READS NO DATA IS IMMEDIATELY AND INTERRUPT
STATUS TRANSMITTEO OCCURS, INDICATING TRANSMIT
REGISTER DATA REGISTER EMPTY
2-303
R65C5 1 Asynchronous Communications Interface Adapter @CIA)
TX0
IRQ
I I n-l m
f
IS NOT ASSERTED
AGAIN UNTIL m
NOT CLEAR-TO-SEND GOES ‘Ow
t
CLEAR-TO-SEND
Rx0 ~,~~,~I~lr~
PROCESSOR \
RECEIVER DATA REGISTER
INTERRUPT PROCESSOR
NOT UPDATED. BECAUSE
FOR RECEIVER
PROCESSOR DID NOT READ
DATA REGISTER
PREVIOUS DATA, OVERRUN
FULL REGISTER
BIT SET IN STATUS
I REGISTER
Rx0 $‘l~~l:_I~,~,~
I I I
1
I
J
I I
CONTINUOUS “MARK” UNTIL Ffs GOES LOW
I I
/ I 1 ,
‘I I I \
1 r . . ..
TxO p Ist&=tl S,, 1 S, 1 1 ‘N 1 P
3 GOES
TO
“FALSE” CONDITION
NORMAL -
RECEIVER DATA
REGISTER FULL
INTERRUPTS
2-305
a
R65CSl Asynchronous Communications Interface Adapter (ACM
/ i
) I
IRQ
\
t 1
\ nJ 1 RI
A
b
t
PROCESSOR PROCESSOR FINALLY TxO DATA
INTERRuFT READS RECEIVER RESUMES
FOR RECEIVER DATA REGISTER.
OATA REGISTER REAO RECEIVER LAST VALIO
CHARACTER (=nb
PROCESSOR
PROCESSOR
OVERRUNOCCURS INTERRUPT
REAOS
TxO GOES To FOR CHAR *JI
STATUS
“MARK” IN RECEIVER
REGISTER DATA REGISTER
CONDITION
Framing Error
Framing Error is caused by the absence of Stop Bit(s) on checked for the Framing Error. Subsequent data words a
received data. A Framing Error is indicated by the setting of bit tested for Framing Error separately, so the status bit will alwa
4 in the Status Register at the same time the Receiver Data reflect the last data word received. See Figure 13 for Framl
Register Full bit is set, also in the Status Register. In response Error timing relationship.
to m, generated by RDRF, the Status Register can also be
RX0
(EXPECTED)
RR0
(ACTUAL)
/
cl
MISSING
I
STOP
PROCESSOR
NOTES: 1. FRAMING ERROR DOES NOT SIT
INTERRUPT,
INHISIT RECEIVER OPERATION.
FRAMING
ERROR
2. IF NEXT DATA WORD IS OK.
BIT SET
FRAMING ERROR IS CLEARED.
gmt of on Receiver
:z J i
-ccem output Indicating the status of the carrier-fre- Once such a change of state occurs, subsequent transitions will
_;s;ec:.on clrcult of the modem. This line goes high for not cause interrupts or changes in the Status Register until the
, I=Q :! I-arr:er. Normally, when this occurs, the modem will first intermpt is serviced. When the Status Register is read by
s L.5, .- c:ng data some time later. The ACIA asserts IRQ the processor, the ACIA automatically checks the level of the
-be? 72
_ changes state and indicates this condition via DCD line, and if it has changed, another ii% occurs (see Figure
-.Js -9.*he Status Register. 14).
CONTINUOUS ‘MARK”
x
1 ’ III--T--
t t
NORMAL PROCESSOR
AS LONG AS NO INTERRUPT
PROCESSOR INTERRUPT
cicD IS HIGH. WILL OCCUR
FOR
INTSRRupT PROCESSOR NO FURTHER PROCESSOR HERE. SINCE
RECEIVER
INTERRUPT INTERRUPTS INTERRUPT RECEIVER IS NOT
DATA
FOR m FOR RECEIVER FOR DC0 ENAELEO UNTIL
GOING HIGH WILL OCCUR GOING LOW FIRST START BIT
DETECTED
‘s possible to select 1% Stop Bits, but this occurs only for trailing half-Stop Bit. Figure 15 shows the timing relationship for
.Dlt data words with no parity bit. In this case, the IRQ asserted this mode.
r Receiver Data Register Full occurs halfway through the
CHARtin CHARC~+I
t
PROCESSOR INTERRUPT
OCCURS HALFWAY
THROUGHT THE 112
STOP BIT
2-307
R65C51 Asynchronous Communications Interface Adapter (ACIA)
PERIOD DURING
I
WHICH PROCESSOR
-
- - SELECTS
CONTINUOUS POINT AT wnlcn ‘PROCESSOR’
“BREAK” MODE PROCESSOR INTERRUPT
NORMAL SELECTS TO LOAD
INTERRUPT NORMAL TRANSMIT
TRANSMIT DATA
MOGE
-_ \
CONTINUOUS “BREAK”
RX0
rl
Sl
-_ I lsNl p lst~pli,,
I
1
I
PROCESSOR
PROCESSOR INTERRUPT
I WITH
/m-NO--j
MORE
INTERRUPTS
\NOlNTERRUPT
SINCE RECEIVER
DISABLE0 UNTIL
FIRST STOP BIT
NORMAL
I
RECEIVER
INTERRUPT
BREAK AND FRAMING ERROR SET. INTERFltJPl
FOR
RECEIVER EVEN PARITY CHECK WILL ALSO
DATA REGISTER GIVE A PARITYERROR BECAUSE
FULL AU ZEROS (CONTINUOUS BREAK)
REPRESENT EVEN PARITY.
*-_2 Z’ r-0 soecial funCtiOnS of the various status bits, there 1. If Echo Mode is selected, %!? goes low.
5 3 st;Sej:eo sequence for checking them. When an interrupt
2. If Bit 0 of Command Register (m) is 0 (disabled), then:
Lz_‘s. :“1 XIA should be interrogated, as follows:
sycK m (Bit 7) in the data read from the Status Register 3. Odd parity occurs when the sum of all the 1 bit? in the data
word (including the parity bit) is odd.
. not sel. :he interrupt source is not the ACIA.
4. In the receive mode, the received parity bit does not go into
:?eCK =c3 and DSR the Receiver Data Register, but generates parity error or no
parity error for the Status Register.
These must be compared to their previous levels, which must
lave oeen saved by the processor. If they are both 0 (modem 5. Transmitter and Receiver may be in full operation simulta-
on-line I and they are unchanged then the remaining bits neously. This is “full-duplex” mode.
qust be cnecked.
6. If the RxD line inadvertently goes low and then high right
Cfieck RDRF (Bit 3) after a Stop Bit, the ACIA does not interpret this as a Start
Bit, but samples the line again halfway into the bit to deter-
Check ior Receiver Data Register Full. mine if it is a true Start Bit or a false one. For false Start Bit
detection, the ACIA does not begin to receive data, instead,
Check Parity, Overrun, and Framing Error (Bits O-2) if the only a true Start Bit initiates receiver operation.
Receiver Data Register is full.
7. Precautions to consider with the crystal oscillator circuit:
Check TDRE (Bit 4)
a) The external crystal should be a “series” mode crystal.
b) The XTALI input may be used as an external clock input.
ChecK ior Transmitter Data Register Empty.
The unused pin (EXTALO) must be floating and may not
be used for any other function.
If none of the above conditions exist, then 5 must have
gone to the false (high) state.
8. m and DSR transitions, although causing immediate pro-
cessor interrupts, have no affect on transmitter operation.
Data will continue to be sent, unless the processor forces
transmitter to turn off. Since these are high-impedance inputs.
PROGRAM RESET OPERATION they must not be permitted to float (un-connected). If unused,
they must be terminated either to GND or Vcc.
A program reset occurs when the processor performs a write
speration ro the ACIA with RSO low and RSl high. The program
GENERATION OF NON-STANDARD BAUD RATES
‘eset operates somewhat different from the hardware reset
$RES pin) and is described as follows:
Divisors
The internal counter/divider circuit selects the appropriate divi-
1. Internal registers are not completely cleared. Check register sor for the crystal frequency by means of bits O-3 of the AClA
formats for the effect of a program reset on internal registers. Control Register, as shown in Table 2.
2. The DTR line goes high immediately. Generating Other Baud Rates
By using a different crystal, other baud rates mav be generated.
3. Receiver and transmitter interrupts are disabled immediately.
These can be determined by:
If IRQ ;s low when the reset occurs. rt stays low until ser-
viced. unless interrupt was caused by DCD or DSR transition.
Crystal Frequency
Baud Rate =
4. DCD and DSR interrupts are disabled immediately. If IRQ is Divisor
--
low and was caused by DCD or DSR. then it goes high, also
DCD and DSR status bits subsequently will follow the input Furthermore. it is possible to drive the ACIA with an offchIP
lines. although no interrupt will occur. oscillator to achieve other baud rates. In this case, XTALI (pin
6) must be the clock input and XTALO (pin 7) must be a no-
5. Overrun cleared. If set. connect.
R65C51- Asynchronous Communications Interface Adapter (ACIA)
I
0 0 0 0 I
I
No Divisor Selected
I
I
16 x External Clock
at
-. Pin RxC
..- I
16 x External Clock
at Pin RxC
1.6432 x lad F
/ 0 0 0 1 36.064 = 50
36,864 36,864
1.8432 x 106 F
0 0 1 0 24,576 = 75
24.576 24,576
i I I 1
I 1.8432 x 16 F
0 0
1
I I
1 1
I
I I
16,769
= 109.92
I
16,769
F
II
1.8432 x 106
0 1 0 0 13,704 = 134.51
13.704 13,704
k
1.8432 x 10 F
0 1 0 1 12,288 = 150
12,288 12,280
I
[ 1.8432 x l@ F
[ 0 1 1 0 6,144 f 300
1 6,144 6,144
t 1.8432 x 108 F
1 0 1 1 1 3,072 = 600
f 3,072 3,072
I 1.8432 x 106 F
i 10 0 0 1,536 = 1,200
1,536 1,536
1.6432 x 16 F
= 1,800
L 1,024 1.024
I I I
F
I
1.8432 x lO*
i 766 = 2.400
1 l0l0 1 I 768 I 768
ItIlOl1I 1 512
I 1.8432 x 10’
= 3,600
F
I 512 , 512
I
i I 1.8432 x 106 F
= 4,800
384 384
I 1.8432 x 108 F
1 1 0 1 256 = 7,200
!D 1.8432
256x 106 256
F
i 1 1 1 0 192 = 9,600
E 192 192
1.8432 x loa F
11
1
1 1 1 1 96 96 = 19,200 I 96
1
1
Asynchronous Communications Interface Adapter (ACIA)
&@,osflC LOOP-BACK OPERATING MODES
ii g-3 -ec =
XK diagram for a system incorporating an ACIA loop-back operation. In this way, the processor can easily per-
i) $.m- ? =$Lre 18. form local loop-back diagnostic testing.
_-1. ,=s-Back
Control Register bit 4 must be 1, so that the transmitter clock
equals the receiver clock.
: _-~_~acK Yom the point of view of the processor. In this
_le :r,e ,Modem and Data Link must be effectively discon-
Command Register bit 4 must be 1 to select Echo Mode. ,
--L::ec ?,?a :he ACIA transmitter connected back to its own
.yYtr~r ~3 fhat the processor can perform diagnostic checks c
Command Register bits 3 and 2 must be 1 and 0, respec-
-- :l.e system. excluding the actual data channel. L
tively to disable IRQ interrupt to transmitter.
*- MODEM
TxD
SEL 1Y
2Y DTR
I, STB 3Y RfS
1
1: 4Y -
74157
+5
i NOTES: 1. HIGH ON LLB SELECTS LOCAL LOOP-BACK MODE.
2. HIGH ON 74157 SELECT INPUT GATES “B” INPUTS
- 48 4A- TO “Y” OUTPUTS; LOW GATES “A” TO “Y”.
1 I
TxD ‘K-
*tlRQ’
IRQ
(CLEAR)
CHARACTERISTICS
1 MHz 2 MHz
parameter Symbol Mln Max Min Max Unit
22 :,c:e Yme
.
bYC 1000 - 500 ns
#- VIH
VIH
CSO,B,, RSo, AS,
VIL
I
/
VIL
tDCW _!_--- tHW--.+i
t-
VIH
DATA BUS
VIL
/I
I--WCR- “IL
I
It---- tCQR-’
DATA BUS
2-313
r
f
”
q
ABSOLUTE MAXIMUM RATINGS’ ‘NOTE: Stresses above those listed may cause permaner
damage to the device. This is a stress rating only and functionc
operation of the device at these or any other conditions abov
those indicated in other sections of this document is not implies
Exposure to absolute maximum rating conditions for extende
periods may affect device reliability.
OPERATING CONDITIONS
DC CHARACTERISTICS
(Vcc = 5.OV f5%, Vss = 0, TA = TL to T”, unless otherwise noted)
1 02 GIN
- 10 PF f = 2 MHz
T, 3: 25%
Output Capacitance COUT
- 10 PF
Notes:
1. All units are direct current (dc) except for capacitance.
2. Negative sign indicates outward current flow, positive indicates inward flow.
3. Tvolcal values are shown for Vrr = 5.OV and TA = 25°C.