![IEI Technology WAFER-4821 Скачать руководство пользователя страница 37](http://html1.mh-extra.com/html/iei-technology/wafer-4821/wafer-4821_user-manual_4123066037.webp)
37
Appendix C Digital Input and Output
Digital Input and Output, generally, are control signals. You can use these signals
to control external devices that needs On/Off circuit or TTL devices. The register
address is 340H. This register is designed to latch the output data.
•
CN16: Digital I/O
PIN Signal
Name
PIN Signal
Name
1 GND 6 VCC
2 DO3 7 DO2
3 DO1 8 DO0
4 DIN3 9 DIN2
5 DIN1 10 DIN0
Below is the specifications of WAFER-4821 Digital I/O:
‧
Digital Input/Output channels : 4 bits
‧
TTL Devices compatible
‧
Digital Logic level 0: +0.5V max
‧
Digital Logic level 1: 3.5V to 5V
‧
Register Address: 340H
Example program:
PORT_ADRESS = 340H
G_LOOP: MOV DX, PORT_ADDRESS
IN AL, DX
CMP AL, P_STATUS
JNE W_LOOP
CMP X_STATUS, 0
JE G_LOOP
OUT DX, AL
MOV X_STATUS, 0
JMP G_LOOP
W_LOOP: MOV P_STATUS, AL
MOV X_STATUS, 1
;
; WAIT HERE
;
JMP G_LOOP
X_STATUS DB 0
P_STATUS DB