Gpio Example Program-1 - EMAC PCA-6782 User Manual

Table of Contents

Advertisement

C.1.2

GPIO Example Program-1

------------------------------------------------------------
Enter the extended function mode, interruptible double-write
------------------------------------------------------------
MOV DX, 2Eh
MOV AL, 87h
OUT DX, AL
OUT DX, AL
------------------------------------------------------------
Configure logical device 7(GP10~GP17), configuration register CRF0,CRF1,CRF2
------------------------------------------------------------
MOV DX, 2Eh
MOV AL, 07h; point to Logical Device Number Reg.
OUT DX, AL
MOV DX, 2Fh
MOV AL, 07h; select logical device 7
OUT DX, AL
MOV DX, 2Eh
MOV AL, F0h
OUT DX, AL
MOV DX, 2Fh
MOV AL, 00h; 01: Input, 00: output for GP10~GP17
OUT DX, AL
MOV DX, 2Eh
MOV AL, F2h ;
OUT DX, AL
MOV DX, 2Fh
MOV AL, 00h; Set GPIO is normal not inverter
OUT DX, AL;
MOV DX, 2Eh
MOV AL, F1h
OUT DX, AL
MOV DX, 2Fh
MOV AL, ??h; Put the output value into AL
OUT DX, AL
------------------------------------------------------------
Exit extended function mode |
------------------------------------------------------------
MOV DX, 2Eh
MOV AL, AAh
OUT DX, AL
85
PCA-6782 User Manual

Advertisement

Table of Contents
loading

Table of Contents