English
Language : 

Z85233 Datasheet, PDF (187/317 Pages) Zilog, Inc. – The Zilog SCC Serial Communication Controller
Application Note
The Z180™ Interfaced with the SCC at MHZ
(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
;
*include 180macro.lib
Read in Z180 register names and
;macro for Z180 new instructions
;SCC Registers
scc_ad:
scc_ac:
scc_bd:
scc_bc:
scc_a:
scc_cont:
scc_data:
scc_cont:
scc_data:
if
else
endif
equ
equ
equ
equ
equ
scc_a
equ
equ
equ
equ
0C3h
0C2h
0C1h
0C0h
00h
scc_ac
scc_ad
scc_bc
scc_bd
;addr of scc ch a - data
;addr of scc ch a - control
;addr of scc ch b - data
;addr of scc ch b - control
;if test ch. a, set this to 0ffh
;for ch.b, set this to 00h
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
6-52
UM010901-0601