S1C88348/317/316/308 TECHNICAL SOFTWARE
EPSON
II-25
6 OUTPUT PORTS (R PORTS)
Source List
(1)
Control of output port (R port)
public
initoutput_normal,output_normal
public
init_hiz,output_hiz
public
fout_init,fout_control
;
br_io
equ
0ffh
;base reg. address (set i/o area)
hzr_ex
equ
00ff70h
;expand output control reg.
hzr3
equ
00ff72h
;r3x output control reg.
r3d
equ
00ff76h
;r3x output data
r5d
equ
00ff78h
;r5x output data
rtm_mode
equ
00ff40h
;timer mode set reg.
code
(1) Normal DC output
;************************************************************************
;*
*
;*
r(output) port control (normal)
*
;*
r37
<- "l" then "h
(complementary)
*
;*
r36,35 <- "h","l"
(complementary)
*
;*
*
;************************************************************************
;*** initialize routine
initoutput_normal:
ld
br,#br_io
;set br reg. address to 0ffxxh
ld
[br:low hzr3],#00000000b
;set r3x complementary output
ret
;************************************************************************
;*** control routine
output_normal:
ld
br,#br_io
;set br reg. address to 0ffxxh
and
[br:low r3d],#01111111b
;r37 <- "l" output
or
[br:low r3d],#10000000b
;r37 <- "h" output
ld
a,[br:low r3d]
;r3x output port read
and
a,#10011111b
or
a,#01000000b
ld
[br:low r3d],a
;r36 <- "h" and r35 <- "l" output
ret
(2) High impedance output control
;************************************************************************
;*
*
;*
r(output) port control (hi-z)
*
;*
r50,51 <- "h","h"
(complementary at init.)
*
;*
*
;*
<- "hi-z"
*
;*
<- "l","l"
(complementary)
*
;*
*
;************************************************************************
;*** initialize rotine
init_hiz:
ld
br,#br_io
;set br reg. address to 0ffxxh
or
[br:low r5d],#00000011b
;r51,50 <- "h"
and
[br:low hzr_ex],#00111111b
;r5x <- complementary output
ret
;************************************************************************
;*** control routine
output_hiz:
ld
br,#br_io
;set br reg. address to 0ffxxh
or
[br:low hzr_ex],#11000000b
;r5x <- high impedance ("hi-z")
and
[br:low r5d],#11111100b
;r51,50 <- "l" output
and
[br:low hzr_ex],#00111111b
;r5x <- complementary output
ret
;
(2)