![VersaLogic VL-12CT96 Скачать руководство пользователя страница 56](http://html.mh-extra.com/html/versalogic/vl-12ct96/vl-12ct96_reference-manual_1006747056.webp)
6-8
VL-12CT96/7 Analog & Digital I/O Card
Parallel Port Interrupt Mode Code Example
The following code example shows how to operate the digital I/O port using interrupts. In this example,
half of the port signals are arbitrarily defined as inputs. Signal activity on MD0, MD1, MD2, or MD3
(as selected by jumper V13) will generate an interrupt request.
The key program sections are:
MAIN :
System initialization and calling syntax.
INIT_188 :
Initializes the VL-188 (CPU) interrupt controller to accept interrupts from the
STD Bus. Installs interrupt vector into low RAM.
INIT_1296 :
Enables parallel port interrupts on the VL-12CT96/7.
INIT_PAR :
Defines the signal direction of the parallel port channels. All output channels
are turned off.
ISR :
Interrupt Service Routine. This subroutine is responsible for reading, and
processing the parallel port input from the VL-12CT96/7.
0000 .model small
0000 .stack
0000 .data
0000 ???? dir dw ? ;Port direction pattern
0002 .code
0000 vector segment at 0 ;CPU Interrupt Vector Table
0000 vector ends
;VL-12CT96/7 I/O PORT ADDRESSES
= 0300 control equ 0300h ;Control Register
= 0300 status equ 0300h ;Status Register
= 0301 select equ 0301h ;Channel Select Register
= 0302 convert equ 0302h ;Convert Register
= 0303 adclo equ 0303h ;A/D Data Low Register
= 0304 adchi equ 0304h ;A/D Data High Register
= 0309 clrflg equ 0309h ;Clear Flags Register
= 030A parlo equ 030Ah ;Parallel Port Data Low Register
= 030B parhi equ 030Bh ;Parallel Port Data High Register
= 030C dac0lo equ 030Ch ;D/A Channel 0 Data Low Register
= 030D dac0hi equ 030Dh ;D/A Channel 0 Data High Register
= 030E dac1lo equ 030Eh ;D/A Channel 1 Data Low Register
= 030F dac1hi equ 030Fh ;D/A Channel 1 Data High Register
;VL-188 I/O PORT ADDRESSES
= FF22 eoi equ 0FF22h ;80188 EOI Register
= FF3A int1 equ 0FF3Ah ;80188 INT1 Control Register
0000 main:
main:
main:
main:
main: ;MAINLINE CODE
0000 B8 0000s mov ax,@data ;Set data segment register
0003 8E D8 mov ds,ax
0005 B8 00FF mov ax,00FFh ;Parallel port direction control
0008 E8 002E call init_par ;D15 0 MD0 Direction = Input
;D14 0 MD1 Direction = Input
;D13 0 MD2 Direction = Input
;D12 0 MD3 Direction = Input
;D11 0 MD4 Direction = Input
;D10 0 MD5 Direction = Input
;D9 0 MD6 Direction = Input
;D8 0 MD7 Direction = Input
;D7 1 MD8 Direction = Output
;D6 1 MD9 Direction = Output
;D5 1 MD10 Direction = Output
;D4 1 MD11 Direction = Output
Software Examples — Parallel Port Interrupt Mode
Содержание VL-12CT96
Страница 2: ...ii VL 12CT96 7 Analog Digital I O Card ...
Страница 26: ...2 20 VL 12CT96 7 Analog Digital I O Card ...
Страница 32: ...3 6 VL 12CT96 7 Analog Digital I O Card ...
Страница 62: ...7 4 VL 12CT96 7 Analog Digital I O Card ...
Страница 65: ...VL 12CT96 7 Analog Digital I O Card 8 3 VL 12CT96 7 Parts Placement Reference ...