English
Language : 

Z85233 Datasheet, PDF (182/317 Pages) Zilog, Inc. – The Zilog SCC Serial Communication Controller
Application Note
The Z180™ Interfaced with the SCC at MHZ
Table 12. SCC Test Program – Interrupt for 180/SCC Application Board (Under Mode2 Interrupt)
;*
B register returns status info:
;*
Bit D0: current /cts stat
7
;*
D1set: /cts int received
;*
.z800
;Read in Z180 register names and
*include 180macro.lib
;macro for Z180 new instructions
;SCC
Registers
scc_ad:
scc_ac:
scc_bd:
scc_bc:
equ
0C3h
equ
0C2h
equ
0C1h
equ
0C0h
;addr of scc ch a - data
;addr of scc ch a - control
;addr of scc ch b - data
;addr of scc ch b - control
scc_a:
equ
000h
;set 0ffh to test ch a
;clear 00h to test ch b.
scc_cont:
scc_cont:
if
else
endif
scc_a
equ
equ
scc_ac
scc_bc
org
09000h
;top of user ram area
inttest:
ld
sp,top_of_sp
;init sp
ld
a,high sccvect and 0ffh
;init i reg
ld
i,a
im
2
;set interrupt mode 2
call
initscc
;initialize scc
ld
b,0
;clear status
ei
;enable interrupt
wait_loop:
bit
1,b
jr
z,wait_loop
;check int status
;if not, loop again
wait_here:
jr
$
;interrupt has been received
;you can set breakpoint here!
;subroutine to initialize scc registers
;initialization table format is
;register number, then followed by the data to be written
;and the register number is 0ffh, then return
initscc:
init0:
ld
hl,scctab
ld
a,(hl)
cp
0ffh
ret
z
out
(scc_cont),a
inc
hl
ld
a,(hl)
out
(scc_cont),a
inc
hl
jr
init0
;initialize scc
;get register number
;reached at the end of table?
;yes, return.
;write it
;point to next data
;get the data to be written
;write it
;point to next data
;then loop
UM010901-0601
6-47