Sample Code-Controlling Gpo Registers; Sample Code-Read Gpi Status - Dell Embedded Box PC 5000 Technical Manualbook

Hide thumbs Also See for Embedded Box PC 5000:
Table of Contents

Advertisement

Sample code—Controlling GPO registers
The following example is written in Intel 8086 assembly language.
1.
Enter the Extended Function Mode:
MOV DX, 2EH
MOV AL, 87H
OUT DX, AL
OUT DX, AL
2.
Configure the GPO register:
MOV DX, 2EH
MOV AL, 07H
OUT DX, AL
MOV DX, 2FH
MOV AL, 08H
OUT DX, AL (select Logical Device 8 for GPO)
MOV DX, 2EH
MOV AL, E1H
OUT DX, AL (select CRE1)
MOV DX, 2FH
MOV AL, 01H (update GPO register with value 01H (GPO0 = HIGH, GPO1 to GPO7
= LOW)
OUT DX, AL
3.
Exit the Extended Function Mode by:
MOV DX, 2EH
MOV AL, AAH
OUT DX, AL
Sample code—Read GPI status
The following example is written in Intel 8086 assembly language.
1.
Enter the Extended Function Mode:
MOV DX, 2EH
MOV AL, 87H
OUT DX, AL
OUT DX, AL
2.
Configure GPO register:
MOV DX, 2EH
MOV AL, 07H
OUT DX, AL
MOV DX, 2FH
MOV AL, 07H
OUT DX, AL (select Logical Device 7 for GP1)
MOV DX, 2EH
MOV AL, F5H
OUT DX, AL (select CRF5)
MOV DX, 2FH
IN AL, DX ; (Get value of GPI0 to GPI7)
3.
Exit the Extended Function Mode:
MOV DX, 2EH
MOV AL, AAH
OUT DX, AL
54

Advertisement

Table of Contents
loading

Table of Contents