beautypg.com

Zilog Z16C35 User Manual

Page 201

background image

Application Note
The Z180™ Interfaced with the SCC at MHZ

(Continued)

;external/status interrupt
service routine

ext_stat:

ld

a,10h
out

(scc_cont),a

;reset ext/stat int

in

a,(scc_cont)

;read stat

and

00100000b

;mask off bits other than /cts

rra

;shift into D0 loc

rra
rra
rra
rra
set

1,a

;set interrupt flag

ld

b,a

;save it

ld

a,38h

out

(scc_cont),a

;reset highest ius

ei

;enable int

ret

;return from int

;initialization data table for scc
;table format - register number, then value for the register
;and ends with 0ffh - since scc doesn’t have
;register 0ffh...

scctab:

db

09h

;select WR9

if

scc_a
db

10000000b

;ch a reset

else

db

01000000b

;ch b reset

endif

db

0eh

;select WR15

db

20h

;only enable /cts int

db

01h

;select WR1

db

00000001b

;enable ext/stat int

db

10h

;reset ext/stat int

db

10h

;twice

db

09h

;select WR9

db

08h

;mie, vect not incl. stat

db

0ffh

;end of table

;interrupt vector table

org

inttest + 100h

sccvect:

dw

ext_stat

.block

100h

;reserve area for stack

top_of_sp:

end

Table 12. SCC Test Program – Interrupt for 180/SCC Application Board (Under Mode2 Interrupt) (Continued)

Page 195 of 316

UM011002-0808