jmp
d3
ret
delays endp
org
300h
;TABLE
; RYG
RYG
dc
0EBh
;1110 1011 G R
dc
0FBh
;1111 1011 O R
dc
0EBh
;1110 1011 G R
dc
0FBh
;1111 1011 O R
dc
0EBh
;1110 1011 G R
dc
0FBh
;1111 1011 O R
dc
0EBh
;1110 1011 G R
dc
0FBh
;1111 1011 O R
dc
0DBh
;1101 1011 Y R
dc
0BEh
;1011 1110 R G
dc
0BFh
;1011 1111 R O
dc
0BEh
;1011 1110 R G
dc
0BFh
;1011 1111 R O
dc
0BEh
;1011 1110 R G
dc
0BFh
;1011 1111 R O
dc
0BEh
;1011 1110 R G
dc
0BFh
;1011 1111 R O
dc
0BDh
;1011 1101 R Y
end
Program description
The program begins (1) by setting the value of the port control register to
determine which port bits are output and inputs. In this case each port bit
of port control register PAC is set to 0 as all bits in this port are used as
outputs. As the illuminated condition of the red, yellow and green lights is
fixed a table read instruction can be used to determine their values as
shown in section (2), however the values must first be setup. Because the
last page TABRDL instruction is used the table data is setup from address
300h. The highest address is 3FFh. In section (5) the table pointer is
incremented. In section (2) the display status of the LEDs is obtained from
the table, this value being placed on the output port as shown in (3). Due
to different timing delays being required for correct traffic light operation
several procedures exist within the program to provide different timings as
shown in (4) delayl, (7) delaym and (6) delays.
Chapter 15 Input/Output Applications
191
Summary of Contents for HT-IDE
Page 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Page 12: ...HT IDE User s Guide 2 ...
Page 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Page 24: ...HT IDE User s Guide 14 ...
Page 70: ...HT IDE User s Guide 60 ...
Page 76: ...HT IDE User s Guide 66 ...
Page 92: ...HT IDE User s Guide 82 ...
Page 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Page 94: ...HT IDE User s Guide 84 ...
Page 148: ...HT IDE User s Guide 138 ...
Page 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Page 154: ...HT IDE User s Guide 144 ...
Page 192: ...HT IDE User s Guide 182 ...
Page 194: ...HT IDE User s Guide 184 ...
Page 218: ...HT IDE User s Guide 208 ...
Page 235: ...P a r t V Appendix Part V Appendix 225 ...
Page 236: ...HT IDE User s Guide 226 ...
Page 250: ...HT IDE User s Guide 240 ...