Ttl I/O (Di-0/Di-1, Do-0/Do-1) Programming - FabiaTech Fanless Series User Manual

Small system - expansion box
Hide thumbs Also See for Fanless Series:
Table of Contents

Advertisement

FabiaTech Corporation

TTL I/O (DI-0/DI-1, DO-0/DO-1) programming

The following is an Assembly program, which demonstrates how to set the GPIO
(DI-0/DI-1, DO-0/DO-1) type and how to read and write values.
;------------------------------------------------------------------------------------------
; Enter the extended function mode, interruptible double-write
;------------------------------------------------------------------------------------------
Mov
dx, 2eh
Mov
al, 87h
Out
dx,al
Out
dx,al
;------------------------------------------------------------------------------------------------------
; Configures logical device7, configuration register CRF0, CRF1, CRF2
; CRF0 (DI-0/DI-1, DO-0/DO-1 selection register.)
;
When set to a "1", respective DI-0/DI-1port is programmed as input port.
;
When set to a "0", respective DO-0/DO-1 port is programmed as an output port.
; CRF1 (DI-0/DI-1/DO-0/DO-1 data register.)
;
If a port is programmed to be an output port, then its respective bit can be read
or written.
;
If a port is programmed to be an input port, then its respective bit can only be
read.
; CRF2 (DI-0/DI-1, DO-0/DO-1 inversion register.)
;
When set to a "1", the incoming/outgoing port value is inverted.
;
When set to a "0", the incoming/outgoing port value is same as in data register.
;------------------------------------------------------------------------------------------------------
Mov
dx,2eh
Mov
al,07h
Out
dx,al
Mov
dx,2fh
Mov
al,07h
Mov
dx,al
Mov
dx,2eh
Mov
al,f0h
Out
dx,al
Mov
dx,2fh
Mov
al,03h
Out
dx,al
Mov
dx,2eh
Mov
al,f1h
Out
dx,al
Mov
dx,2fh
In
al,dx
And
al,03h
Mov
ah,0ch
Or
al,ah
Out
dx,al
;------------------------------------------
; Enter to extended function mode
; point to Logical Device Number Reg.
; Select Logical Device 7
;Select CRF0
;Set DI-0/DI-1(Bit 0/1) is input and DO-0/DO-1(Bit 2/3) is output
;Update CRF0 with value 03h
;Select CRF1
;Read DI-0/DI-1 (Bit 0/1) Input value
;Write DO-0/DO-1 (Bit 2/3) Output value is "xxxx11xxb"
; update CRF1 with value
70

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx5637Fx5637s1Fx5637s2

Table of Contents