Академический Документы
Профессиональный Документы
Культура Документы
Chapter16
i
)
:
)
I
.7
h
a
1,1
t
)
,
:
l
THE G EN ER A LI N S T R U M E N TC P l 6 0 0
The CP1600 and the TMS 9900 were the first two NMOS 16-bit microprocassors
commericiallyavailable.Even
a superficialinspectionof the CP1600showsit to be morepowerfulthan the NationalSemiconductor
Pace(or8900),
yet the CP1600 is not widely used.This is becauseGenerallnstrumentdoesnot supportthe CP1600to the extent
that NationalSemiconductor
supports.Pace,
or most manufacturers
supporttheir 8-bit microprocessors.
GeneralInstrument'smarketing philosophyhas been to seek out very high-volumecustomers;GeneralInstrument supportslow-volumecustomersonly to the extentthat this supportwould not requiresubstantialinvestmenton
the part of GeneralInstrument.
Fromthe viewpointof the low-volumemicroprocessor
user.GeneralInstrument's
marketingphilosophyis unfortunate.
The CP1600is an idealmicroprocessor
for the moresophisticated
videogamesthat areappearing,
and its rich instruction set and capablearchitecture
makeit an idealchoicefor data.processing
terminalsand home computersystems.
However,due to its limitedsupport,potentiallow-volume
CP1600customers
are likelyto chooseanotherequallycapable oroduct.
Three CPl600 parts are avaitable,differentiatedonly by the ctock speedsforwhich they irave been designed.
The CP1600requiresa 3.3 MHz.two-phaseclockand generatesa 600 nanosecond
machinecycle time.
The CP1600requiresa 4 MHz.two-phaseclockand generates
a 500 nanosecond
machinecycle time.
The CP'l6'l0 requiresa 2 MHz.two-phaseclockand generatesa 1 microsecond
cycletirr,e.
ln addition to the CPl600 microprocessorsthemselves, the CPl68O Input/Output Buffer (lOB) is described in
this chapter. Additional support devices for the CPl600 may be found in Volume 3.
The solesourcefor the CP1600is:
INSTRUMENT
GENERAL
M icroelectronics
Division
600 West John Street
Hicksville,
New York 11802
There is no secondsource for the CPl600. GeneralInstrumenthas a policyof discouraging
seconds ourcesfor its
productline.
The CP1600is fabricatedusing NMOSion implantLSI technology:the deviceis packagedas a 40-pin DlP.
Threepowersuppl iesare required'.
+12V, *5V and -3V.
T HE C P1 6 0 0M IC R O C O MP U TESRY S T E MO V E RV I E W
Logic of our general microcomputer system which has been implemented by the cP1600 cPU is illustratsd in
Figure 16-1.
obs.ervethatthecP16oorequiresexternal|ogictocreateitsvarioustimingandc|ocksigna|s.
Some bus interfacetogic is shown as absent becausaa numberof devicesmust surroundthe CPl600; theserntl
'c luoe:
a
1) An addressbuffer.sincedata and addresses
are multiplexedon a single16-bitbus.
2l Bufferamplifiersto providethe powerrequiredby the type of memoryand l/O devicesrnat will normallybe connectedto a CP1600CPU.
3) A one-of-eight
decoderchip to createeight rndividualcontrolsignalsout of threecontrolsoutput by the CP1600.
4J A one-of-sixteen
multiplexchip to funnel sixteenexternalstatus signalsinto the CP1600 if using external
b ranches.
ro- |
Clock Logic
[]
fl
Arithmetic and
lnair
svvre
cP1600cPU
cP1680t / O
I l^i+
v"r r
InterruptPriority
Arbitration
S e r i a l to Pa r a lle l
I n t e r f a ce L o g ic
ROM Addressing
and :
InterfaceLogic
l,/O Ports
Interface Logic
to-z
RAM Addressing
and
Interface Logic
REGISTERS
CPl 600 PROGRAMMABLE
The CPl600 has eight 16-bit programmableregisters, which may be illustrated as follows:
JJ
a
=
c
)
=
'i
RO
R ')
RZ )
R 3,
Rl
I
R5 t
RO
R7
Dcta Countcrs
Oau Countc6 whh
suto-incramcnt
Stack Pointcr
Program Countcr
UJ
o
o
u,
d
ul
z
o
The way in'which the registersillustratedaboveare used is unusualwhen comparedto other microcomputers
describedin this book. All eight 16-bit registerscan be addressedas though they were generalpurposeregisters;
however,only RegisterR0 has no otherassigned
function.We may thereforelookupon RegisterR0 as the PrimaryAccumulatorfor this CPU.
Registers
R1,R2,and R3 serveas generalpurposeregisters,
but may also be usedas Data Counters.
o
E
o
Registers
R6 and R7, in additionto beingaccessible
as generalpurposeregisters,
alsoserveas a StackPointerand a
ProgramCounter,respectively.
Havingthe StackPointeraccessibleas a generalpurposeregistermakesit quite simpleto maintainmore than one
Stackin externalmemory;also,you can easilyaddressthe Stackas data memoryusingthe StackPointeras a Data
Counter.
Havingthe ProgramCounteraccessible
as a generalpurposeregistercan be usefulwhen executingvarioustypesof
conditionalbranchlogic.
While havingthe StackPointerand the ProgramCounteraccessible
as though they were generalpurposeregisters
may appearstrange.this is a featureof the PDP-I1 minicomputer
- and is a very powerfulprogrammingtool.
C P1 6 0 0M EMO R YA D D R E S S IN G
M O DE
The CPl60O addressesmmory and l/O devices within a single addressspace.
Whan referencingexternal memory, you can use direct addressing,implied addressing,or implied addressing
with auto-incremsnt.
Direct addressinginstructions are all two or more words long, where the second or last
word of the instruction object code provides a 16-bit direct address.
CP1600 DIRECT
ADDRESSING
16-3
Were -u,:u
to impl ementa 16-bitwide programmemory,then you coulddirectlyaddressup to 65,536wordsof memory: hcv'rever,
six bits of the first oblectprogramword for everyinstructionin programmemorywould be wasted.This
mav be illustrated
as follows:
Program
Memory
O
Bit Number
{--
Three memory
reference
instructions
that specify
direct addressi
Six unused
birs in each
of these
memory locations
Two single
word instructions
Instructions that reference memory using implied addressing identify general purpose
RegisterRl, R2. or R3 as containingthe implied address.
A memory referenceinstructionwhich identifiesRegisterR4 or R5 as providingthe external
memoryaddresswill alwayscauseRegisterR4 or R5 contentsto be incremented
followingthe
memoryaccess;thus you have impliedmemoryaddressingwith auto-increment.
c P1 6 0 0
IMPLIED
ADDRESSING
SDBD
Programmemory
MV I R I,R O
PP
oo
16-4
Data memory
SDBD
=
,'-
MVI R5,RO
Program memory
J
2
:
h
f,l
3
,h
PP
oo
Data memory
z
3
The SDBDinstructionmay alsoprecedean immediateinstruction.Now the i mmedi ate data w i l l be fetchedfrom the
low-orderbyte of the next two sequentialprogrammemorylocations.
This mav be i l l ustrated as follows:
Memory
RO
XX
I o-5
Ju r : r inS t rl(
r , ' t t On S
U Sed i re C t m e m O ry a d d re S S i ng.Jump i nS truC ttOnS
are all three words long.The direct addressis
o r nDut ec if r om t h e s e c o n d a n d th i rd me mo ry w ords as fol l ow s'
FI
JR or JSR
Word 2
tt
Word 3
AAAAAABEEBBBBBBBJump address(binary)
yy are enable/disable
bits for interrupts
xx ioentify the register where the return address wilr be stored for JSR
xx and yy are describedin detdil in Table 16-4.
or Jump-to-subroutine
instruction.
The only difference
betweena Jump instructionand a Jump-to-Subroutine
instructionis that the Jum p-to-Subroutine
instruction
savesthe Programcountercontentsin Register
4,5. or 6. The two high-oiderbits (xx)or the secondJumpto-Subroutine
objectcode word specifieswhich of tne threeregisterswill be used to hold the return
address.
Jump-to-Subroutine
instructions.
like the Jump instruction,
allowdirect memoryaddressing
only.
CP 16 0 0 S T AT U S A N D C ON T R OLFLAGS
The cPl600 cPU has four of the standardstatus ftags; in addition, it
has some unusualcontrol signals.
These are the four standard status flags:
sign fs) Thisstatusis set equal to the high-orderbit of any arithmetic
operationresult.
zero rzl rhis statusis set to 'l when any instruction's
executioncreatesa zeroresult. Thestatusis set to 0 for a nonzero
result
The Carry(C)and Overflow(O)statusesare standardcarryand overflow,
as describedin Volume1.
Fourcontrolsignals(EBcAo - EVcA3l are output duringa Eranch-on-Externat
(BExn instruction.Thesefour signalsare outputto reflect the low-orderfour bits of the BEXTinstruction's
objectcode.Externallogicreceives
thesefour
signalsand (depending
on their state).may or may not returna high input via EBCI.lf EBcl is reiurnedhigh.
then the
BEXTinstruction
will performa branch;if EBCIis returnedlow,thenthe BEXTinstructionwill
causethe nextsequential
instruction
to be executed.
The four controlsignalsEBcAo- EBCA3thereforeprovidethe cp1600 with
a meansof testing 16 externalconditions.
CP 1 6 0 0 C PU P IN S A N D S IGN A L S
.f
Q2a=.-
r 6-6
r40
239
338
137
536
635
734
833
932
r0
cPt6m
11
CPU
12
13
14
15
16
17
18
ts
?o
EECl
MSYNC
8C1
rcz
80lR
nr(
:J
o14
o l3
D1 2
:-
ur
=
i
D9
o8
oo
5
)
D7
06
o5
D4
D3
a
J
JJ
z
3
e
3
rclT
GNO
ol
o2
vDD
vBB
vcc
BDRDY
ffi
31
BUSRO
30
29
zg
27
26
zs
24
23
22
21
HALT
BUSAK
INTR
]ffi
TCI
EECAO
E8CA1
EBCA2
EBCA3
D2
Pin ?{ame
Oscriotion
Tvpc
DO- Dr5
BO|R,rcr, BC2
ol. (D2
MSYNC
EBCAO
- EBCA3
TnstEt., Elidirecrionrl
Output
lnput
lnput
E_!g!
rcrT
BDRDY
STPST
HALT
ivfi.ffi
tu
ffio
BUSAK
vB& vCC. VDO, GND
Output
lnput
Inp{Jl
Input
Inpur
OutPut
lnput
Output
Input
Output
16-7
n n n- r nt ar nr nt 2hlci n a tru C ti Oni S b e i n g e x e C u te d.then the H al t S tatew i l l nOt berng unl rl C Ompl eti onOf next int er r upt able
rn s t r uc t ion' s ex ec u ti o n . T h e H a l t s ta te w i l l l ast untrl external l ogrc i nputs another hi gh-to-l ow ffi
t r anst t ion. at
w h i c h t im e t he H a l t o u tp u t w i l l b e re tu rn e d l ow and normal programmrng executi on w rl l conti nue. E xecut ion of t he
H L T r ns t r uc t ion a i s o c a u s e s th e C P1 6 0 0 to e nter a H al t state. as descri bed above
L e t us now look a t i n te rru p t s i g n a l s .
The CP1600 has two interrupt request inputs - INTR ana lffiT.
lffi
has higher prioriry than lffiRT lTfiR- cann o t be dis abled Ty p i c a l l y ,T N T H " w i l lb e u s e d t o tri gger an i nterrupt upon pow er fai l ure or other catast r ophes.
Th e int er r upt ac k n o w l e d g e s i g n a l i s c re a te d by external togi c w hi ch must decode the B C 1 , B C z, and BDI R sign a l s , as s hown in T a b l e 1 6 -' i . O b s e rv e th a i t here are, i n fact. tw o i nterrupt acknow l edge si gnal s: the f ir st iI NTAK)
a ck nowledgest he i n te rru p t i ts e l f.w h i l e th e s e cond (D A B ) i s used as a strobe for external l ogrc to return an I nt er r upt add re s s v ec t or . T he i n te rru p t s e q u e n c e i s d e s c ri bed l ater i n thrs chapter
Th e CP 1600 has tw o a d d i ti o n a l i n te rru p t-re l atedsi gnal s w hrch are unusual w hen compared to other m icr ocom put er s
d e sc r ibed in t his b o o x
TCI is out put high w h e n a n En d -o f-l n te rru p trnstructi on i s executed. Thi s srgnal makes i t easy for ext er nal logic t o
.rp n or z t o; nr or r , , n rn r;6 1 i 1 i gw
g h i c h e x te n d a c rossthe executi on of an i nterrupt servi ce routi ne. W e have discussed t his
su bjec t in s om e de ta i l w h i l e d e s c ri b i n g th e 8 259 P ri ori ty Interrupt C ontrol U ni t i n C hapter 4.
,vPr
Y'l
BC 2
BDIR
SIGNAL
FUNCTION
NACT
BAR
'l
IAB
'i
DWS
ADAR
DW
'I
ut 6
,]
,l
INTAK
16-8
MC
ll
rri r2 i.r 3
T1tT2
tl
T3l T4
I
Undefined
state
preceding
data output
BAR
M C1
11i
lll
DTB
MC3
NACT
MC2
12:' 13114
rr l
12i 13lto
r ll
r llttl13
Ir
Instruction
address out
Instruction
obiect code in
Frgure16-4. CP1600lnstructionFetchTimrng
16-9
FETCH
INSTRUCTION
READ
TEMoRY
I
BAR
NACT
M C2
DTB
MC3
lJl
Itll
ttl
I
I
NACT
t- I
,,1,"1,,1.,1
T2 ,,i*1,'i,,
-^
Mc1
'l
tr l
- I.t- ^i ll- 4 .- r, z l
lJl
l tl
l .i
aan
MC 1
I
|
NAcr
MC 2
I
|
DTB
MC3
llit
llirr.lr r i rr rzlrslrellirzlrsi'o
r'irzi
i'ri l
I
Data in
Y v" e v
"rrmr qn: ninn" m :n h i q g c y c l e th a t ro u ti n e l y s eparatestw o C P 1600 B us access machi ne cycl es.The obj ect code f or t he
a cc es s ed r ns t r uctto ni s re tu rn e d d u ri n g th e thi rd machi ne cycl e
Fi g ur e 16- 5 illustra te s ti mi n g fo r th e s i m p l est memory read i nstructi on' s executi on. In thi s case the dat a m em or y
a d dr es s is t ak en f r c m o n e o f th e C P U re g i s te rs There
.
i s no di fferencebetw een ti mrng for the three mach ine cycles of an
i n st r uc t r c n [ et c h c : a d a ta m e m o ry re a d . As i l l ustratedi n Fi gure 16-5. a si mpl e memory read i nstruction'sexecut icn
ccns is ls of t wo t h re e -ma c h i n e c y c l e me mo ry read operati ons.separated by a spaci ng no operati on m achine cycle
to- tu
MEMORYWRITE
FETCH
INSTRUCTION
BAR
M c1
I lt
NACT
DTB
fr v/lczlMca
| llt
lt
BAR
NACT
NACT
DW
DWS
t:l
lr l
rs!rc
rz!ralrcT1i:T2 i T31ra rrlrzi,mjr+lrrI rz!rslrclrrlrzlrs!rrlrr!,rz!
rr!rz t.lli rz
i*
l
l
al
trrl
l
l
l
l
l
l
l
i*lrr!
i'.i
ltl
Data out
Direct Addressing
Memory Write
Machine Cycle
Fetch first instruction
obiect code word
OTB
NACT<-Spacing
DTB
machinecycle--=-*NACT
z BAR
BAR r
NAcr|
ADAR){-Fetch
NACTI
DTB ,/
NACT*-Spacing
secondinstrucriong<
object code word
machine cycle----*
BAR )
Memoryread
NACT> <-machine
cycte
DTB ,
Memorywrite
machinecrcre--)i
16-11
| r'racr
ADAR
| ruaCr
\ DTB
NACT
(:,11,
;**
DWs
lr
t ll
TllTzltglra
I
t
t'
T H E C P l 6 0 0 WA IT S T A T E
The CPl600 has a Wait state equivalentto thosedescribed
for othermicrocomputers
in this book.Externaliogicthat
requiresmoretime to respondto an accessmust input EDRDYlow beforethe end of the BARmachinecycle,durinq
which an addr essis output and the deviceis selected.
Timing is illustratedin Figure16-7.
lf you examineFigures16-4.16-5and 16-6.you will seethat an addressis outputduringa BARmac hinecycleto initiate any externaldeviceaccess.The BARmachinecycleis alwaysfollowedby an NACTmachinec.ycle;in the middleof
T1 duringthisNACTmachinecycle,theCPl600samplesffiRDTl{B-5'FDY
is low.then a sequenceof NACTmachine
cyclescccursInthemiddleof T4foreveryNACTmachinecycle,theCP1600samplesEDffiTagain.Upondetect
EffiDY high.the CP1600resumesinstructionexecutionwith a DTB machinecycle.
A Wait state must last for less than 4O microseconds,since the CPl600 is a dynamicdevice.
T H E C P16 0 0 H A L T S T A T E
The GPl600 has a Halt state which may follow executionof the Halt instruction,or may be initiatedby external
logic.
When the Halt instructionis executed,then.followingthe instructionfetch machinecycle,the H,ALTsignalis output
high and a sequenceof NACT machinecyclesis executed.
Externallogicinitiatesa Haltstateby makingthe STPSTinputundergoa high-to-lowtransitionFollowingexecutionof
the next interruptableinstruction,a Halt state begins The HALT signal is output high and a sequenceof NACT
machinecyclesis executed. ,
A Halt state.whetherit is initiatedby executron
of a Halt instructionor by a high-to-lowtransitionof STPST.must be
terminatedby a high-to-lowtransitionof STPST.This will causethe Halt stateto end at the conclusionof the next
NACTmachrnecycle.Timrngfor a Haltstatewhich is initiatedand terminatedby STPSTmay be illustrated
as follows:
STPST
HALT
HALT STATE
16-12
rcTTREOUEST
SEOUENCE
CPl 600 INITIALIZATION
The CPl600 is initialized by inputting the ili$ilCfirst applied to the GPU.
MSYNC
C P l60 0 D M A L OGIC
CPl609 DMA logic is quite standard.When extarnal logic wishes to transfer data under DMA control, it inputs
BUSRO low. At the conclusion of the next interruptable instruction's execution, the CPU floats the
'Data/Address Bus and enters a Wait state, during which a saquenco of NACT machine cycles is executed.
EmT
is output low at the beginning of the first NACT machine cycle.
The NACT machinecycles that occur duringa DMA operationrefreshthe CPU.NACTmachinecyclesthat occur
duringa Wait statedo not refreshthe CPU.This meansthat any numberof NACTmachinecyclescan occurduring a
DMA break,while a Wait statemust be shorterthan 40 microseconds.
The DMA breakends'g1engternal logicinputsE'[SF-O-high
sampledduring1t of eveE PMA NACT
again.EIISFO-is
machinecycle.WhenEUSROissampledhigh,two additionalNACT
machinecyclesareexecuted.then BUSAKis output high and normalprogramexecutionresumes.
DMA timing is illustratedin Figure 16-8.
16-13
Last machinecycle
of an inlerruptable
instruction's
executron
NACT
NACT
trl
lll
Tl l T2tT3rT4
l tl
lll
T1 I T2 I T3 lT4
lll
* , n/\
INTAK
NACT
trt
rl l
T l l T 2 r T 3l T 4
tl l
I
I
I tl
I
t.l
-tl
I
_^t
_I
rJl
I
fi i'.1,,i'{
l',i'i[,i'.1,,i
"i"1
-i',i'.1',
BDIR
D0D15
Current Program
Counter contents
wnnen to memory
stack
Extemal
logic inputs
staning
address
for Interrupt
service routine
16-'14
Start executing
interrupt
serviceroutine
EXECUTE/FETCH
INSTRUCNON
INSTRUCTON
FETCH
DTB
NACT
BAR
MC1
It
rtrcs
r',rcz I
r
r
lr
BAR
trtl
lrrtlrlr
DTB
MC3
I
rrireira!ralrr rslrarr!rz!rslre
rr ! rz r3l 14lrrlrz!rairolrrlrzlrs!
I
NACT
MC2
-l',,i:ij
Mc1
ttl
3
=
i
tl
t
a
a
{
uJ
2
o
:
c
lnstruction
address out
Next instruction
address out
TCI instruction
object code in
Next instruction
obiect code in
T HE CP1 6 0 0I N TE R R U PLOGIL
T
The CPl600 uses a vsctored interrupt processingsystom.
Externallogic requestsan interruptby inputtinga low signalateithertheJNffi'oriffi'plns.
Followingthe executionof the next interruptable
the interruptby pushing
instruction.the CP1600acknowledges
RegisterR7 contents(theProgramCounter)onto the Stack:then the CP1600outputs111, followedby 010 at BC1,
Bus.These16 bits of data
BC2.and BDIR.Externallogic must respondby placing16 bits of dataon the Data/Address
will be loadedintoRegisterR7.the ProgramCounter,thus causingprogramexecutionto branchto an interruptservice
routinededicatedto the interrupt.Timing is illustratedin Figure16-9.
TheElTsrgnal is output low followiirgexecutionof a softwareinterruptinstruction(SlN).This is the only microcomputerdescribedin this bookwhich allowsexternallogicto respondto a softwareinterruptin this fashion.Allowingexternallogic to respondto a softwareinterruptonly makessensewhen you anticipateyour productbeing used in a
minicomputer-like
Typically.the softwareinterruptwill interfaceto logic of a front panelor console.
environment.
When an SIN instructionis executed.a one-machine
cycle low PCITpulseis output
in
You may.if you wish.end an interruptserviceroutineby executinga TerminateCurrentInterrupt(TCl)instruction.
which casethe TCI signalwill be output high.
Timing for TCI is given in Figure 16-10.
Followingan interruptacknowledge,
the interruptserviceroutinemust executeinstructionsin orderto disableinterR7.the ProgramCounter,which is autoruptsand savethe contentsof registers
on the Stack.Theexceptionis Register
mati callypushedonto the Stackfollowingan interruptacknowledge.
Externallogic is entirelyresponsible
for any type of interruptpriorityarbitrationwhich may occur,and for the generation of the interruptvectoraddresswhich must be input {ollowingan interruptacknowledge.
16-15
Ivv
vvr '
T H E CPl 6 0 0 IN S TR U C TION
SET
The CP1600instructionset is relatively
straightforward.
Addressing
modes.whichwe havealreadydescribed.
aresimple.anCinstructions
aretypicalof thosewe haveseenand described
for othermicrocomputers
Unusualfeaturesretating to addressingmodesavailablewith individualinstructionsare summarizedin Table 16-2, which describesthe
CP1600instructionset
lf you have never programmeda PDP-11minicomputer,then you should pay particularattention to programming techniques that result from the Stack PointEr and Program Counter being accessed as ganeral purpose
registers.
A wide varietyof Register
Operateinstructions
allowyou to computedataand loadthe resultdirectlyinto RegisterR7.
the ProgramCounter.In effect,thesebecomecomputedJump instructions.
The abilityto manipulateRegisterR6.the StackPointer,as though it werea generalpurposeregistermeansthat it is
easyto maintaina numberof differentStacksin externalreadlwritememory.
The Jump-to-Subroutine
instructionhas a minicomputerflavorto it. Ratherthan savingthe returnaddresson the
Stack.RegisterR7 contentsare movedto GeneralPurposeRegisterR4 or R5.A numberof minicomputers
will savea
subroutinereturnaddressin a generalpurposeregisterin this fashion.The'problem
with this logicis thatyou mustexecutean additionalinstructionwithin the subroutineto savethe returnaddresson the Stackif you are going to use
nestingsubroutines.
lf you arepassingsubroutineparameters,
however,this is an excellentarrangement.
for the Jumpto- Subroutine
instructionplacesthe addressof the parameterlist directlvin a DataCounterwithauto-increment.
We
havedescribedthe conceptof parameterpassingin Volume1. Chapter7.
Note that the CPi600 instructionset lacksa logicalOR.
ln Tables16-2 and 16-4.instructionlengthis given in termsof "words" ratherthan "bytes".as we havedone in previouschapters.Sinceonlythe lower10 bits of theCP1600objectcodearepresentlyused,systemconfigurations
need
not havethe full '16-bitword size Hencea "word" may be 10 to 16 bits wide.dependingon the implementation.
The followingnotationis used in Table16-2:
AD DR
cond
DATA
DISP
E
EBCA0-3
EBCI
LABEL
ffi
RB
RD
RM
RR
RS
Statuses
'16-16
SW
32r
B'r No.
Ffzfofc-l
StatusWord
When the statusword is copiedinto a register,it goesto the upper half of each byte:
)
J
r RRJ
t swr
)
W hen th e s ta tu s w o rd i s l o a d e d fro m a regi ster.i t comes from the upper hal f of the l ow er b yt e:
7
J7
a
t
tswl
)
x<y.z>
(.21
t1
tt tl
A
tA
_
Bits y through z.of the Registerx. For example,R7<'15.8) representsthe upper byte of the program
Counter
lndicatesthat the operand".2" is ootional
A low pulse
Contentsof locationenclosedwithin brackets.lf a registerdesignationis enclosedwithin the brackets.
then the designatedregister's
contentsare specified.lf a memoryaddressis enclosedwithin the brackets,
then the contentsof the addressed
memorylocationare specified.
lmpliedmemoryaddressing:
the contentsof the memorylocationdesignated
by the contentsof a register.
LogicalAND
LogicalExclusive-OR
Additionor subtractionof a displacement.
dependingon the sign bit in the ob;ectcode.
Data is transferredin the directionof the arrow.
-)
16-17
;e
ag
gg
:;
i,6t
:9 6
.eP.gE?;E
p.g'=.'6*FE
EgP
ri o;!E ITP P
UJ
E
o
? E E E:
E f ilt = . . E ii
E!'=i
1l
u)
9. = :
n
!;E! ss'! E
a
U
o.
z
o
P .g
3 9 4 - s r >9 9 o o
.='6.9.900
2219
:;3
P P tE
;
g
! E E g
FF'=t=
i:gg
tt:E
9 9 3 3 F g E E ii
is e e : ! e g 5 -t
oo
9979
EEEF
!-e
E'E
!9'!
FF!'
.Et.g ==
_= ._=
;iEas
.!P
r ' :.9;o
5- o,!
E
U
;1
.>Z'3;
56aFi
=, 2t EE
g-$! ! t
;;g
E E
E
1i= 2 a i- lg g
E
E
E
2
E
2
=
E
e
E
=
E
E 89=Eaa=a
i
He>sp'="
3EgE3F giF = FF SaEEgESE
< i' < F + s * *
E,EEF
^e
U)
-r-a ,
2E
^;^;acatr=E
'u
lr lr CE= gX
H '
;E ;E :9=9
I o
E:
I o
t =
I s
;E J : e =E=E,iF;
E iE E ai- E 3 3Er e : e ; ea[s
;
aP ;l .S l E f
E :.tr
:
g
o
o
xxxxxx
tt
xxxxxX ;4X X X
xxxxxxxxxx
ai
o
o
o
3
ah
.too
rE 9c.gcE o
AF
z
g
A
=
E
r
z
E
.r.
E
-o
Q>
?Gp'r
=Q
E e e;
^G-s^SnS-S
- !so
3==
3 3 N:tU3 J3 U
AEOW3 W ONV
to- t6
.r-'
='
7? l F
..-
E = e =e E
F
oN V
=-
O/t A U V ON O3S S
=
3
7
'-
E
o
a
o
o
n
o
.>
.9
.2
-a
,-
'-
.g
;
=
o
u
E
o
c
b!'
8.9=
i E!t
O!
'=
-
(J
E
E
.EH9E
3 E=Es
l*+o:
o)
iEF.:f
o'
.c
ie
E ()E
e-
nEa
7e
.iEP
c
;
:{c
.cb>E!
=oo
fE TE E
b9
!gioE
3 .E
o:
I
o
I
_c D z
.:c .i
-x'tJ
6
Eg.
E:
e;
6'-
.!
E E 9ei
o
:r}
@=
3-
==95b
g'dE
=
H
l;
Eg
o'
G,
.E5;
3 E; ;
'AF 8 e ' ;
EEsE
xsa
oo
.Eet
'af'66
9-9-.
:>
- .= o
b
.EE
b:
i
5 .9 o
;xE
.E -?
:
@
6
ge
oE
=
9
.a
JP
E5
qt
;s
E9
O.
>
2A
UI
4
E lE ' ;
sise
z trE
EsEsE
.:< :kF
^-a]!:noAE
o:o!9
rO
v)
6b
IF<F<@:F;
EI EJ EI
: ! = E: 6 ==7 i
E< E( a t s ( J t s <E u
=;
I 'a
F:
e:ei ieE+
? 3E C; E;E :
lnl:rFlOl=
^+E
i
E;
: i B:
_, 9
: :.:
s Ff
:::s '-
- .-.
6
.:z
2Z
QR
IE
-! 6i
=-
r .!
EEijcEE
sE r-E
?L.
.9,EoAE
- 9.l tr 9
Es$HE
'a
3t
UJ
o
C)
xxx
at,
xxxxx
xxxxx
3n
)
c.j
an
-o
F
o
o
dN
o<
<1
oo( , o o
ff
NN
3
o
z
E
U
< U;
'U
3 9
EB
FFFFF
JE
Ed
9
z
E
U
z
E
=:
s 5 r 5
U'
(J
:F
bx
3tvtoShtt tl
3tvu3do 3lvl03l/\lt ll
16-19
dnnf
N Ot1tON OC
N O H 9N V U 8
o
I
CD
'3
o
EJ
-oo
3i
.Oo
3E
3
!
c
a
.=6
o.
-.=
'=
5tg
'zlo
ao
E; '
6 t=
:oi
:6 i ;.2
seS
tE
:P 9 :E r
58
E=gg
:F!Z
g- .o- - - 3 2 :
.3PEEE
> ; g
;AFtEE
!r = o- 7:-
rt
gEEsig
-o
o
.B:Ete
E' FE22sg
B H 2
E 'g;
3
3
o
E $ s
a ; ';
g B
8s
;;
:E :E .gE
CD
g
o
o
c
o
EA s s E E_r-*
s;
E
e
E
iE e* 3e
E
e , E 'a . Y T 2
i i E =a:E -;=E -;
FE +gF ; e i i e"eC
i i E ;C rE E ei C : e F
A s p!i E i ;i s i F* r
c=c<P 6 E d P - P6
E!
-E o
o
o
o
o
.t
e := : -
F:i :-e
E
o
o
o
F.
.n
xxx
xx
xxxxxx
xxxxxx
xxxxxxx
oxxxxxxx
<n
z
{
c ! ooooo
u;
ui
G.G,lrEEGG
u;
ui
u;
vi
(E
U)
G,
G,
TE
E.
.E
t
z
o
=
w
z
E
55s E 5E
oof > z o
Ef , E
( ) F =O
o
o
0
w
z
()
G
1 -" * *
I
L*
3-tvuldo u3rs1glac
u3tsr0r8-u3l.sr93u
16-20
J
J
U'
3
Q
'
o
o
:,
C)
ul
E
o
)
)
o
o
E
u
I
c
t
z
9
,
)
E
U
q
o
o
o
o'
CD
o
't
I
a
@
6E
(D
-o
ax
6, 9.
-6
'
o
o
o
'I
t-
o
o
E
o
@
:6
ure
v,
q)
3
u)
)
U'
a
u
(t,
o
()
F
vt
x
x
x
X
x
X
x
x
==
E(E
x
X
o)
F
ah
CE
3
I
o
z
ll
U
NN
o-
I
z
o
E
z
E
(J
J
E.
J
@
o-
U)
r6-21
..
gE
a9
=6
;r
:a
.t
2.9
d
.-2
@:
E rc
oo
d+
*g
.;=
=4-
e9g
v:
(t
oc
tt
4iiEgg
Ei
iia r i g
iiEEFIi
>.=
?6
I3
Aq V6
!:
s;6
r!':;Fee s e
aol-c.-(J
:E
si g :.Pe'F
tl
.z
d3
ee 6F
aA
I":+
= 6A9EEE
E' Foqoq E E
lH
>-;
l- c!6 ..:.:.2 .:
EiEo o o oo
u)
VE
h.E 9== 5 s 8 5
00
6Q
Q6
-P
6
F-
6-X;66@6
-6',:EEEE
EE
90
iE ;
:t
n o
qoE
alrF
Eif;;;;
E 8E
BEP
p : ; E
-!
.-958;;
.E ' E
a
E
:
>o
tn>
c =16666
;3i
g: E
iEe
=o
*9
- '-
o-
:1.
Ea
x
X
x
o
c!
th
o
o
3
- F OO O O
o
.'UU
z
N
JJ
gg??
t)
<<J - r J J 6c )
2
o
:
U
z
=
a3
cc
= sSPqeqE
T CVIS
u)
(JL)
cltJU
snl'vts
l'dnHu3rNl
t6-22
o*-
E d.E = eE .i
EsiEE
tt)
lr g
v=? O
o=
!bcr
!:68
=,:
- E.=
os65
5dd
E.Eoo
; = r 'E 'l
gf-e
fipi
6 Er
o_q
a6
q*,Y.Y
-==l
><vv
u
oo
sgi
3o
-=
o-
;sbb
d6zE
!E;
;t
bb
U
G
so 6 t
@@
o
E
o
r
s;!
IEE
9:
iE
fi
;
le;g
is;
Codes
Table 16-3. CP1600BranchConditionsand Corresponding
MiIEMONIC
c
LGT
NC
LLT
ov
NOV
PL
)
i,0
I
E
EO
t{zE
NEO
LT
G
LE
ERANCH CONDITION
OBJECTCODE
DESIGNANOT{
d)r
C =l
Catry
{bgiccl gr!.tr
C =0
fb Cr.ry
lbqi:d 16
rhrr)
l @1
thm)
O=l
Or.rfiow
O =0
@10
r0r0
l,lo ovrfiow
S =0
Phr.
mil
s:1
Mnur
10tI
Z =l
Zro l.Crdl
Z =O
fforucro {rcr cquel}
'- . . , \
S r *O =l
0r@
t6r d[,1
'-=;r
S Y O=O
Graarr drrn or cquel
zV {S Y OI = I
1r@
o101
t rol
ol r0
GT
usc
ESC
z v(SvOl = O
Crartr thln
. _
-'
C Y S =t
.-'trqUrip
md clry
C Y S :O
i -- Equd dgn lrid c-ry
1lt0
otil
ltlt
Whereten digitsare shown,they are the ten low-orderbits of a 10 to 16-bitword. (Wordsizedependson the system
notationfor an entireword (10 to '16
Where four digitsare shown,they representthe hexadecimal
implementation.)
bits).
Two bits indicatingone of the first threegeneralpurposeregisters
bb
Fourbits giving the branchcondition.as shown in Table 16-3
cccc
Threebits indicatinga destinationregister.RD
ddd
Four bits giving the externalbranchcondition,E
eeee
llll
One word of immediatedata
mmm Threebits indicatinga DataCounterRegisterRM
m
One bit indicatingthe numberof rotatesor shifts:
0 one bit oosition
1 two bit positions
p
One bit of immediateaddress
P
digit (4 bits)of immediateaddress
One hexadecimal
rr
Two bits indicatingone of the first four generalpurposeregisters
sss
Threebits indicatinga sourceregister.RS
z
I
,
16-23
t
Table 16-4 CPi 600 Insrrucrron
Set OblecrCodes
MA C H IN E
MA C H IN E
C Y C LE S
ADCR RO
ADO ADDR,RD
A D D @ .R M , R D
ADDI DATA,RO
0 0 m i0 1 d d d
10',il000ddd
PPPP
1 0 1 lm m m d d d
'1011111ddd
ADDR RS,RD
AND ADOR,RO
iltl
0O11sssddd
11100@ddd
ANOA RM,RD
ANDI DATA,RO
PPPP
1 l lOm m m d d d
1 1 ]0 11ld cld
ANDR RS,RD
B OISP
Bcond DISP
BEXT DISP,E
at
MVII DATA,RD
PPPP
lfficccc
PPPP
10@z1eee
PPPP
CMP.'I RM,RS
CMPI DATA,RS
CMPR RS,RO
COMR RD
O E C RR D
ots
EIS
GSWD RR
HLT
INCRRD
J
4O t r L
PPPP
I1 0 lm m m sss
1 1 0 1 1 1 lsss
ml
0 l0 1 sssd d d
om@r 1ddd
000001oddd
rrrl?
ffi2
0OOOI10Or
0000
0000001ddd
0004
I 1ppppppOo
8//11
0@4
l1 p p p p p p 1 0
JR RS
JS R R B , L A E E t
7/9
7 /A
stN (2)
l0
S LL R R (.2)
S LLC R R (,2}
8//11
S LR R R (,2)
S U 8 A D D R ,R O
S U B @ R M,R D
SUBT DATA,RD
o
b
S U B R R S ,B D
SWAP RR(.2}
TCI
TSTR RS
X OR A D OR ,R O
17
X OR t(i ]R M,B D
XORI DATA.FD
X OR R R S .R D
MOVE RS,RO
MVI ADDR,RD
0004
bbppppppO't
PPPP
0OI osssddd
r 0 lm o o d d d
MVI , RM,RD
PPPP
l0 lOm m m d d d
to-14
C Y C LE S
o
b
0@10l Omn
1l
A /e
0OO1110mn
00OO1
1 lsss
6/8
0@l l 0l mn
0OO11l 'l mrr
0001
0007
0@01'l 0l 1m
00O10O
lmn
0OO101l mn
0@t lOomn
11o@oodctd
PPPP
l lOommmddd
o
R/9
6/8
4
6
6/8
6/8
6/8
10
8//11
I r00l I l ddd
lill
0'lOosssddd
00O1O@nn
0005
0olOssssgs
11 t l000ddd
PPPP
'I l l l mmmddd
111111l ddd
1a
0004
bbppppppOO
PPPP
JSRE R8,LA8EL
PPPP
10O1I lOsss
101011oddd
QTT'
PPPP
@ 1 0 sssl1 l
0004
b b p p p p p p1 0
PPPP
PSHR RS
SAR RR(,2)
SARC RR(.2)
SDBD
7/9
0004
' I lp p p p p p o l
JSRD R8,LA8EI
lill
0000100ddd
OO@l 10l Om
l0OOZOt0oO
ruLR RD
RLC RR(,2}
R R C R R I,2)
RSWD RS
PPPP
JE LABEL
N E GR R D
N OP (2)
NOPP
PPPP
JO LABEL
PPPP
l 0Ol mmmsss
'l 0Oll 1'l sss
o
l0
ffi
0 1 1r d d d d d d
1 ' 1 0 1 o @ sss
MV OO R S ,R M
MVOI RS,OATA
8//11
Qa
CIRR RD
CMP ADOR,RS
MV O R S ,A OOR
10101I l ddd
iltl
l@1Ooosss
10
ilil.
0 I l0sssddd
10OOz@O0O
OB JE C T C OD E
iltl
0l l l sssddd
A
6/8
6/ /7
8//11
8
/:
THE BENCHMARKPROGRAM
1
I
'
.
!
IOBUF.R4
TABLE,Rl
R1.R5
CNT,R2
ADDRESS
INTOR4
STARTING
LOADTHEI/O BUFFER
TABLE
ADDRESS
THE
INTOR1
STARTING
LOAD
LOADADDRESS
OF F|RSTFBEETABLEWORD|NTOR5
LOADWORDCOUNTINTOR2
MVr@ R4,Ro
LoADNExrDATAwoRDFRoMroBUF
loop
3
INNEXT
TABLE
WORD
;
MVO@ RO,Rs
STORE
woRDcouNT
l
Rz
DEcREMENT
oecn
tFNor END
RETURN
BNzE LooP
3
=MVo@ R 5 ' R 1 R E T UR N A D D R E S S o F N E XTFREETABLEBYTE
ii
S
TABLE.
a
a:
a
l,l
2
)
!
h
f
E
3
\)
16-25
cP 1600
SystemBus
Signals
8080A
SystemBus
Signals
AO
A 15
High-order
byte
Loar-order
D7 I
byte
Dot
Dot
D7t
BC't
BC2
I of 8 Decoder
BD IR
INT
INT
BUSEN
HOLD
BDYIN
WAIT
lfrSVNe
rr.r;
STSTP
HALT
Tr'l
EBCAO
EBCA3
EBCI
16-26
)l
?
wFRD
DO
D7
D8
D15
AO
A1
A2
A15
6tt3
oDl
wR-
WR
FN
AO
A1
AI
:dE
Ltr
16-27
5tc5
PPI
svstem
busses
aresinsularlv
incompatibre.
Youshourd
norarrempt
touseMC6800
supp(
lff::t;t,,? il: yrtttt:
=iei
IMSKO
2
3
tlt
vq
D6
ffiT
rcLB
PDO
PD l
PD2
PD3
PD4
PD 5
PD6
PD7
P i nN a me
D 0 -D 7
i
P O o- PD 1 5 I
B D IRBC
, 1 ,B C z
cK l
'.- .
LE
PE
AN
INTR_O
Ter
IMSKI
IMSKO
EFFOF
FdH'
vcc, vDD,cND
5
6
7
I
9
10
1l
12
mm
JY
IMSKI
38
37
nl
D3
40
EL
JO
cP 1680
loB
t5
to
35
34
33
32
31
30
29
28
27
26
25
M'RbF
GN D
VDo
PE
ffi
P D15
P D14
P D13
PO12
P D 11
PD1O
PD9
PD8
17
td
IJ
Description
CPU Data/Address Bus
Peripherall/O Port
8us Control signals
Clocksignal
Chip Enable
l/O handshakecontrol
l/O handshakecontrol
lnterrupt request
Terminatecurrent interrupt
Daisy chain priority
Daisychain priority
Error interrupt request
Reset
Power. Ground
BC2
BDIR
Tvpe
Bidirectional,tristate
Bidirectional
Input
Input
lnput
Output
Input
Output
Input
Input
Output
Input
Input
Io-lu
F
<
;E
>d
o- sE F - - >
63H8 2 ? 6 " i
3d
UV
U OUU S
:rud
3d
HV
unuHl
!rud
tM
o-
.\
t
fi
i!
FEHg
s?E
16-29
BUFFER(IOB}
THE CPl680 INPUT/OUTPUT
The CPl680 IOB is a parallell/O device designedspecificallyfor the CPl600 CPU.This device providesa singte
15-bit parallell/O port, which may optionatlybe configuredas two 8-bit l/O ports. Primitivehandshakingcontrol
signals are available with the parallel l/O logic. Elementaryinterval timer and prioritized interrupt logic is also
provided.
Figure16-1 also illustratesthat part of our generalmicrocomputersystem logic which has been implementedon
the cPl680 toB.
The CP1600IOBis packagedas a 40-pin DlP.lt requirestwo powersupplies,*5V and +12V. All inputsareTTL compatible.The deviceis implementedusing N-channelMOStechnology.
Figure 16-13 illustratesa CPl600 microcomputersystem with three CPl680 IOB devices in the configuration.
CP 1 E8 O I O B P IN S A N D S IGN A L S
The CPl680 IOB pins and signalsare illustratedin Figure16-12.We willsummarize these signalsand the functions they serve before examining device operationsin detail.
Let us begin by lookingat the interfacebetweenthe CP1680IOBand the CP1600CPU.
D0 - D7 provide an 8-bit parallel Data/AddressBus via which all communicationsbetvrieenthe CPU and IOB occur. This bus must connectto the low-ordereight bits of the 16-bitCPU.Data/Address
Bu$.
The three bus controlsignals,BCl, BC2, and BDIR,connectthe CPl68O tothe CPl60O as itlustratedin Figure
16-13. The CP1680IOBdecodesthesethreebus controlsignalsinternally.
A clock input is requiredby the CP1680.This clock input {CK1}is used by internal logic to determinewhen BCl,
BC2, and BDIR are valid. CK1 must have the followinqwaveform:
rl l
ll
r r fr z
13 IT4
I
I O-JU
TneffiF-O'H'input
is
\
, IMSKI and IMSKO are interrupt priority input and interrupt priority output signals,respectively.Thesesignalsare
used to generatedaisychain interruptprioritiesbetweenCP1680IOBdevices.as illustratedin Figure16-13.We will
describeCP1680interruptprioritiesin moredetaillaterin this chapter.
TiEEF is the master reset control input for the CPl68O.Thissignalmust be input low for at least10 milliseconds
in
orderto resetthe CP1680lOB.
REGISTERS
CP1680ADDRESSABLE
The CP1680 has eight addressablelocations,which may be illustrated as follows:
Theseeightaddressable
locationsareall 8-bit registers;
they areaddressed
usingthe firsteightaddresses
in a 256-addressblock,as follows:
Register
Control
Data buffer.low-orderbyte
Data buffer.high-orderbyte
Timer.low-orderbyte
Timer.high-orderbyte
l/O interruplvector
Timerinterruptvector
Errorinterruptvector
1 6 -3 ' r
Address
\J
1
o7
D8
O
a
D 15
D0---D7atCPl680
00000Y
Y Y
M a y b e 0 0 0 , 0 0 1 , 0 1 0 , 0 1 1 . 1 0 0 , 1 0 1 . 'l 1 0 . t I I
43210
No.
#-Bir
This.is.called
the
r/o active 1
I o - parailer
o'l'
1 1 - Parattet
l/o inactivef ::aoJ
l-E:HEAOV
16-32
I\
I
O : even parity
t : odd ParitY
lnnin
Controlregisterbit 5 is usedto enableand disableCP1680intervaltimer logic.lf this bit is 0, the intervaltimerwill not
decrement.
Bits6 and 7 reporlthe parityof tne high-order
byteand low-orderbytefordatathat is inputoroutputvia PD0- PD15.0
indicateseven paritywhile 'l indicatesodd parity.
't
The CPU inputs and outputs data via the CPl680 IOB by executing MVI and MVO instructions,respectively.
The CPUmust accessthe CP1680in byte mode,sincean 8-bit Data/Address
Bus (D0- D7)connectsthe CPUand the
CP1680lOB.Whetherthe l/O port PD0- PD'15is configuredas a single'16-bitport or as two 8-bit portshasno bearing
on the fact that the CPU must accessthe CP'1680in bvte mode.
The most efficient way of accessingthe CPl680 is by using the SOBO instructionwith implied memory addressing.Considerdata input.lf PDO- PD'15is configuredas two 8-bit l/O portsand you wish to access,ustone of
thesel/Oports.thenyoucanuseimpliedmemoryaddressingviaRl.R2.orR3
Wemayillustrateinputf romrhehighorderbvte cf l/O Pc:t PDB- PD15 as follo,,vs
Register0l
4F
I O-JJ
lf PDO- Pll15 3re configuredas tv/oB-bit| 'O oortsor as a single16-bitl/O port.and you want to readboth lrO oorts.
therryor: shoulduse the SDBDinstructionwith rmplredmemoryaddressing
via R4 or R5 This may be iilustraredas
iollows:
IN iRO
:)i iAf
Frgure16-14 PD16B0Handshaking
wrth Data Inpur
16-34
The CpU will acknowledgethe interruptrequest.as describedearlierin this chapter,by outputtingINTAKvia BC1.
BC2.and BDIR.Logic internalto the CP1680usesINTAKto resetINTROhigh again
Thereare manywaysin which externallogiccan determinewhen to setl-R high again.ln Figure16-14we show exterthe CPUmust haveacknowledged
nal logicusingPEto setAFhigh. Clearly.when PEmakesa low-to-hightransition,
m lo;; thereioreexternatlogiccan now setffi'nign. Now that El: nign again,externallogiccan input new data.An
alternative
schemewould be for externallogicto constantlyholdAR-low.usingthe levelof the PEoutputto determine
When PE is high,externallogicwill transmitnew data to the CP1680once.As
when new data couldbe transmitted.
soonas it transmitsnew data,externallogicwillstrobethe datawith a short,highARpulse"then wait for PEto go low
and high againbeforeinputtingmoredata.This may be illustratedas follows:
AF
-+
CPUis
ready
Extemal
logic inputs
data
agai n
for input
DO - D7
PE
AH
iNTFO
INTAK
for DataOutput
Figure16-15.PD1680Handshaking
16-35
Extemal
logic inputs
data
The most important point to note is that there is no control bit which specifiesdata input mode or data output
mode.Thus, the signalseguenceswe describedfor data input and those we are about to describefor data output occur automatically;the input or output mode is purely a function of CPU and external logic interpretation.
WhenevertheCPUoutputsdatatothePDl630,thearrival
of dataforcesPEoutputhighllPD0-PDiShasbeeirconfiguredas two 8-bit ports,then the arrivalof a singledata byte to eitherport will causePEto be output hi-ohlf PDOPD'15is configuredas a single'16-brtl/O port, then PD will not be output high untrl two byresof data have been
receivedfrom the CPU bv the PD1680.
OncePEis outputhigh.nothingmorehappensu'ntilexternallogicresponds.
Externallogiccannottell by the simpleinspectionof any controlsignalswhethera data inputoperationor a data outputoperationis in progress.
lt is up to you.
when designingyour system.to dedicateCP1680devicesto inputor output;or you mustgenerateyourown identificaIn Figure16-15we simplyassumethat externallogic knows
tion logic in the eventthat a CP1680IOBis bi directional.
if the data is 8 bitswide.external
data is to be read,and knowswhetherthe data is 16 bitsor 8 brtswide.Furthermore.
logicmustknowwhich 8 bits to read ln any event.when externallogichascompletedits undefinedoperations.
it must
inputAR low.The high-to-lowtransitionof AF'forces
PElow again.and if interruptsareenabled.an interruptwill be requestedvia IIITFt'. When the CPU acknowledges
the interruptby outputtingINTAKvra BC1. BC2. and BDIR.the
PDl680 usesthe INTAKpulseto resetINTRQnign.
The methodusedby externallogicto resetA-Fhighagainis undefined.In Figure16-15.we show PEgoing high as the
triggerwhich externallogicusesto resetAR high.This is clearlya viablescheme;PEwill not go high againtrntilfresh
datahasbeenoutput,at which point it is safeto assumethat the CPUknowspriordatahasbeenreadby externallogic.
It would be equallyviablefor externallogicto holdffi-continuouslylow, transmittinga short.high pulsewheneverit
readsdata.This mav be illustratedas follows:
rE
- t-
+
I
CPU has
output
oata
Extemal
logic has
read data
CPUhas
outplJt
more data
External
logic has
read data
Becausethere are no control signalswhich identify the PD1680 operatingin input mode or output mode, there
is no straightforwardscheme for handlingbidirectionaldata transferswith a single PD1680 device.
T HE C P 1 6 8 0 IN T E R V A LT IME R
The CP1680 has very elementaryintervaltimer logic.A 16-bitTimerregister.addressed
as two separate8-bit locations,decrementsonceeveryeight CK'l pulses,providingthe timer has beenenabled You enableand disabletimer
logicvia Controlregisterbit 5. As a separateevent,timer interruptsmay be disabledvia Controlregisterbit 4. lf timer
interruptsare enabled.then when the timerdecrements
to 0. an interruptrequestwill occur.ffimer interruptlogic is
describedwith otherCP1680interruptlogiclaterin this chapter)lf timer interruptsare not enabled.then the timer itself is effectivelydisabled.sinceyou cannottest any timer statusflag to see if the timer timed out; nor can you accuratelyreadthe contentsof the Timerregisters
on the fly. sincethereis no protectionagainstreadingtimer contents
while it is in the processof being decremented.
The only timer programmableoption you have is to load an initial value before the timer is enabled.The timer
has no buffer; therefore, once it times out it begins decrementingagain, if still enabled,beginningwith the
value FFFF15.This may be illustratedas follows:
Timeintervals-
[<-
Load
Timer
stanrn9
valu e XXXX
a no s t an
Timer
xxxx.8.cKr -+F-
r ---'{*-FFFF.8..K
Time out.
Restarl
Time out.
Restart
16-36
fime out.
Restan
IJ
=
,J,
.lJ
s
c.J'
o
{
gJ
z
c
,o
c
E
o
Yt
REGISTEB
CONTENTS
IOB,RO
;INPUTCONTROL
4
AND
BITS
5
CFH.RO ;ZERO
TO CONTROL
REGISTER
RO.|OB
;RETURN
TIMER
LOW-ORDER
2AH.R0
;TRANSMIT
RO,|OB+3 ;lNlTlALBYTE
TIMER
HIGH-ORDER
34H.R0
;TRANSMIT
R0,JOB+4 :lNlTlALBYTE
REGISTER
CCNTENTS
|OB.RO
:LOADPRIORCONTROL
30H.R0
;SETBITS4 AND 5
R0.|OB
:STARTTIMER
CPl6 8 0 I N T ER R U P TL OGIC
A CPl680 IOB will generate an interrupt request by outputting a low signal atTtiffiE if any one of these three
conditionsoccurs:
1) A low input atmE6fi-'.Externallogiccan requestan rnterruptvia the CP1680using theffi-OF input.
2\ Theffi-handshakingcontrolinput makesa high-to-lowtransitionThis is illustratedin Figures16-14and 16-15
from 1 to 0.
3) The lntervalTimerdecrements
One controlbit appliesto
Recallthat therearetwo separateinterruptenable/disable
controlbits in the Controlregister.
Timer.while the othercontrolbit appliesto both tfreffi'handshakinganOEH-RG-interrupts.
the l.nterval
Interrupt prioritiesamong the three sourceswithin a single CP1680 IOB are as follows:
hiohesr
EF'FOR-'
IT"
na-nOsbat<ing
Timer lowest
When more than one CPl680 IOB is presentin a CPl6O0 microcomputersystem, then daisy chain priority is implemented using the MSKI input signaland the MSKOoutput signal.Signalconnectionsare illustratedrn Figure
16-13.The manner in which intarruptprioritiesare handledby the CPl680 is a little unusual.
Two or more CP1680devicesmay combinetheir interruptrequestsignals.which are wired ORedand inpul to the
CP1600 viaTfriJEdTheCP1600acknowledges
an interruptvia the INTAKcombinationof BC'l. BCz.and BDIR.We de-
16-37
16-38
DATA SHEETS
\
I f nir sectioncontainsspecificelectricaland timing data for the followingdevices:
:ffitrs,-li:,*",
l
16-D1
c P l 6 0 0 . C P 16 0 0 A .C P 1 6 1 0
BUs TIHING OIAGRAH
ll
6z
s cf,naa00-0t5
<
OI'TPW
rF+
OI'TPUTFC+I TO
FETCHDISPUCEIIXT
.H
Pf,OGRAT
@UNER
EBCI-
lr Pttr
EEXI IXSTRUCNOI
CIRE+
00r'r clR
G...,.il.;
Ir
94v
OEY
I
lz
l;
ll
tl
tl
ll
il
I
I
I
I
I
lFla,
Frrs
g cl, tc? ,
80Il
-J
-1
rsYrci
tro
l-
EUS
c]{lrgtrc Ftfl
Flolr st rc
ourrul r@
lr#
tBF -
r-
i /
t a , -1
8rJ3
8u5'
ouTPurour.Gtic rhol
Y LtD ourryr rcot ro
FLOrrr00t
Flsz
k-+l
trpul
rrSrRuol0r
oR D rr
OPRTXO
Data sheets on pages 16-D2 through 16-D6 reprinted by permission of General Instrument Corporation.
16-D2
cP1600
(CPl600)
ELECTRTCAL
CHARACTERTSTTCS
llerlmum Ratlngr'
voltags
Voo,Vcc,GNDandall otherinpuVoutput
with resgectto Vrr
-0.3v to +18.0v
. -55oCto +150'C
Temperature
Storage
.0"C to +70oC
OperatingTemperature
'E x c e e d i n g t h e s e r a t i n g s c o u l d c s u 3 o
prmanent dameg6 to thege devicos.
Functional ogoration at thes cgnditions is
not implied-ope16ting conditions aro
specified below.
;
)
:
Tvp"
trr
Syn
Hln
Vrxc
Vr lc
10.4
0
V oo
0.6
VrrVr r
0
2.4
0.65
Vcc
Vr xr
3.0
Vcc
VoH
Vor
2:
0.5
v
v
lor = 1@pA
lor = 1.6mA
lor = 2.0mA
lor-= 1.6mA
Vcc
0.45
0.45
Vor
Vol
Unltr
Condltlonr
AC CHARACTERISTICS
r 62, r O 2
ns
120
I t 2, t z t
Olo'ci Period
tcy
0.3
tr, tt
15
ns
tms
30
ns
t ao
120
ns
tg r
tg r
te z
;
r0
ns
2.0
t au
tro
tTw
ns
ns
ns
t oc
120
n3
ns
ns
150
200
300
t oe
trr
lrS
n3
150
400
n3
ns
CAPACITAI{CE
61, 62 Clock Input capacitance
Input Crplclt nc.
DO-D1 5
AllOthe r
Output Crp.clt nc.
DO-OI5 in high impedancestate
,)
co1,cc,
20
30
pF
c lN
o
5
't2
10
pF
9F
Co
15
pF
II
I
16-D3
cP 16 0 0 A
(C P 1 6 0 0A )
E LE CT RI CA Lc H A R A C T E R IS T IC S
Marlmum Rstlngt'
Yoltages
Voo,Vcc.GNDandall otherinpuvoutput
-0.3Vto +18.0V
rvilhrespectlo Vrr
. -55oCto+150'C
StorageTemperature
. 0oC to +70'C
Temperature
Operating
'E x c e e d i n g l h e s e r a t i n g s c o u l d c a u se
p e r m a n e n l d a m a g e t o t h e s e d e v i ce s.
Functional operation at thes conditions is
n o t i m p l i e d - o p e r a t i n g c o n d i t i o n s ar e
soecifiedbelow.
0.2mA(typ), 2mA(max.)
70mA(typ), 140mA(max.) Vss=-3V11oo,i.
Voo=+12V:5%,
OperatingTemperature(Te)=ooCto +70"C
12mA(typ), 25mA(max.)
Vcc=+5V+5%,
Chrrlclcrlttlc
DC CHARACTERISTICS
Clock Inputr
Hig h
Low
Loglc Inputr
Low
High (All Lines exceptBOROY)
High (8us Data ReadyLine
See Note)
Loglc Outputr
Hig h
Low (OataBus Lines DO-D15)
Low (BusControl Lines,
BC1.BCz. BDr R)
Low (All Others)
Tvp"
Mar
Unltr
10.4
V oo
0.6
v
v
Vr l
Vr x
0
2.4
0.65
Vcc
Vr *r
3.0
Vcc
Vo*
Vor.
2:
Sym
Mln
Vr xc
Vr r c
Vcc
0.5
0.45
0.45
Vor
Vou
Condlllonr
l ox = 1@pA
l or = 1.6mA
l or = 2.0mA
l or= 1.6mA
AC CHARACTERISTICS
Clock Pslrc lnputr, 61 or 02
PulseWidth
Skew(61, 62 delay)
62, r62
I r 2, t 2t
ns
oc
0
o.25
ns
Clobk Period
tcy
tr, tf
15
ns
lms
30
ns
t eo
o<
ns
t ar
t gr
tsa
<.v
tsu
tro
ttw
ns
ns
ns
t:"
10
loc
200
ns
ns
ns
ns
150
200
300
t oe
lr r
pS
150
400
ns
NS
lI
CAPACITAXCE
61, 62 Clock Input capacitance c61,c6/
lnput C.p.ctt nc.
DO-D15
All Other
Oulpul Crprcltrncc
OO-O15in high impedancestate
VD
"l
20
30
pF
6
t
12
10
pF
pF
15
pF
16-D4
cP 1 .6 1 0
(CP1610)
CHARACTERTSTTCS
ELECTRTCAL
Marlmum Rallngr'
voltages
Voo,Vcc,GNDandall otherinpuvoutput
-0.3Vto +18.0V
with respectto Vrr
. -55"Cto +150"C
StorageTemperature
.0"C to +70oC
Temperature
Operating
'E x c e e d i n g t h e s e r a t i n g s c o u l d c a u s g
p e r m s n o n l d a m a g e t o t h e s o c l e v i c o 3.
Functional opsration at thes conditions i3
not implied-opefating conditions at6
sgecitied below.
-lJ
=
)
:
Charactcrlrllc
OC CHARACTERISTICS
Clock Inputr
High
Low
I nput current
Loglc Inputr
Lorv
High (All LinesexceplEDRDY)
High (Bus DataReadyLine
See Note)
.t
3
't,
n
J
)l
Loglc Outputt
High
Low (DataBus Lines DO-O15)
Low (BusControlLines,
BC1 ,BC2,B Dt R)
Low (All Others)
3
!
n
3
sym
Ml n
Vr xc
10.0
"r'
Typ"
Mrr
Unltr
V oo
v
v
0.6
t5
mA
Condlllonr
Vnc = Voo -1
v
v
Vr r
Vr x
0
2.4
0.65
Vr xa
1n
Vcc
Vor
Vo r
,:
0.5
v
v
lox = 100rrA
lor = 1.6mA
0.45
0.45
v
v
lor = 2.0mA
lor = 1.6mA
I"
Vcc
Vol
Vor-
AC CHARACTERISTICS
.)
r62, r62
250
r12 tzl
0
0.5
ns
ns
Clobk Period
tcy
Rise& FallTimes
Mr3ter SYNC:
Delaylrom 6
DO-O158ur Slgnrlr
Output delay trom dl
(tloatto output)
Outputdelaylrom 62
(outputto lloat)
Input setuptime before61
Input hold time after d1
Bur Control Slgnrlr
8C1.BC2.BDrR
Outputdelayfrom 61
tr, tt
2.0
15
tms
30
ns
t ao
200
ns
ns
ns
ns
II
lar
t ar
t aa
;
10
10
t oc
t gu
lr o
trw
150
M
300
t oe
t er
/rs
ns
26
ns
ns
ns
ns
150
400
ns
ns
CAPACITANCE
d1, 62 Clock Input capacitance co1,c6:
lnpul Crp.cltrnc!
c lN
DO-D1 5
All Othe r
Outpul C.p.cltrnc.
OO-O15in high ampedsncestale
Co
20
30
pF
12
10
9F
pF
15
pF
16-D5
roB1680
E LE CT RI CA LC H A R A C T E R T S T IC S
M ax im umRat l n g s '
V99 and Vsg and all other input/outoutvoltages
........
with respe ctto G ND. .
. - 0 . 3 v t o +1 8 V
. . . . . - 5 5 o c t o +1 5 0 " C
Sto rag eTemg er at ur e
.......0oCto-70oC
Ope ratin gTemp er at ur e
'E x c e e d i n g t h e s e r a t i n g s co u l C ca u se
permanentdamage.Functionatoperationof
t h i s d e v r c e a t t h e s e c o n d i ti o n s i s n o t
implied-operating ranges are specitied
Derow.
V66:
Characterlgllc
Ml n
Tvp"
Mar
Unll
Condlllon
O C C H A R A C T ERIST ICS
Clock Input:
Logic Inputs:
Hig h
Vinc
Low
v itc
Voo
0
Hig h
L o g i c O u t p u t s:
Vcc
z.q
Low
Vi,
Hig h
voh
Low
Vot
0
2.4
lon = 100pA
l o ,= 1 . 6 m A
Vcc
A C C H A R A C TERIST ICS
Clock Inputr
Ctocxperiod
eRi
lPc
4.0
0.4
,:
Clo ck w idt h
Rise & F all t im es
tcr,tct
10
ps
ns
ns
12
10
V,n = 0V
pF
V'"= ov
1<
cor,
pF
TIMING
D I AGRAM
1 T Si1
r_l
' T S2 1
lT S3 p
lTS cq
tTS l t
1TS 31
'TS 21
l TS al
tTS l t
1TS 21
|---.1
'rS3p
tlc --------------tl
cK1'
-r
EO|F
a.t
q.r
r/*
--'tJ
toc F-
C I R C U I T D E S C RIPT ION
T h i s c i r c u r l r s d e sid n e d to p r o vr d e a ll th e d a ta b u tte ri ng and
c o n t r o l t u n c t , c n s r e q u ir e cj wh e n In te r ta cin g th e Se ti es l 600
M r c r o p r o c e s s c r S y sle m lo a sr m p le p e r a p h e r adl e vice. Oata i s
t r a n s l e r r e d l o a n d lr o m lh e p e r ip h e r a lo n 1 6 b id ir e clio nall l nes.
e a c h o f w h r c n c a n b e co n sid e r e d to b e a n in p u l o r o u lput. The
t r a n s t e r o t I n l o r m atio n with th e CP1 6 0 0r sa cco m g lish e dvraan 8b i t h i g h w a y , t h e 1 6 - b r tsb e tn g tr a n ste r r e da s two 8 - b it b ytes.the
r e g i s t e r a d d r e s s e s a r e a ssr g n e d CP1 6 0 0 m e m o r y lo cati ons.as
l o l l o w s ( N i s a n a r b r tr a r y sta r tin g a d d r e ss) :
R egl !l er A ddre3r
N
N .1
N '2
N *3
N *4
N .5
N .6
N *7
16-D6
Oercrlpllon
C ontrol R egtster
D ata R egi ster Low Order 8-bi ts
Oata R egi ster H i gh Order 8-bi ts
Ti mer Low Order 8-bi ts
Trmer H rgh Order 8-bi ts
P ertpheralInterrupt A ddress V ector
Ti mer Interrupt A ddress V ector
Error Inlerruol Actdress Vector