Zilog Z16C35 User Manual
Page 205

Application Note
The Z180™ Interfaced with the SCC at MHZ
7-28
(Continued)
Table 14 lists a program example for the Z180/SCC DMA transfer test.
Table 14. Test Program – Z180/SCC DMA Transfer
;
;* Test program for 180 DMA/SCC
;*
;* Test 180’s DMA function with SCC
;*
;* 180 dma - dma0 for scc rx data
;* dma1 for scc tx data
;* async, X1 mode, 1 stop, speed = pclk/4
;* self loop-back
;* Connect W/REQ to DREQ0 of 180
;* DTR/REQ to DREQ1 of 180
;*
;* B register returns status info:
;* Bit D0 set : Tx DMA end
;* D1 set : Rx DMA end
;* D2 set : Data doesn’t match
;*
.z800
;
Read in Z180 register names and
*include 180macro.lib
;macro for Z180 new instructions
;SCC Registers
scc_ad:
equ
0C3h
;addr of scc ch a - data
scc_ac:
equ
0C2h
;addr of scc ch a - control
scc_bd:
equ
0C1h
;addr of scc ch b - data
scc_bc:
equ
0C0h
;addr of scc ch b - control
scc_a:
equ
00h
;if test ch. a, set this to 0ffh
;for ch.b, set this to 00h
if
scc_a
scc_cont:
equ
scc_ac
scc_data:
equ
scc_ad
else
scc_cont:
equ
scc_bc
scc_data:
equ
scc_bd
endif
length:
equ
1000h
;transfer length
org
09000h
;top of user ram area
sccdma:
ld
sp,tx_buff
;init sp
ld
a,(high z180vect) and 0ffh
;init i reg
ld
i,a
ld
a,00h
;init il
out0
(il),a
im
2
;Set interrupt mode 2
call
fill_mem
;initialize tx/rx buffer area
call
initscc
;initialize scc
Page 199 of 316
UM011002-0808