Справочник Пользователя для National Instruments PCI-DIO-96

Скачать
Страница из 93
Chapter 6
Programming
©
 National Instruments Corporation
6-21
PCI-DIO-96 User Manual
Mode 1 Strobed Input Programming Example
The following example shows how to set up interrupts for mode 1 input 
for port A.
Write (8255Cnfg, 0xB0)
Set mode 1-port A is an input
Write (8255Cnfg, 0x09)
Set PC4 to enable interrupts 
from the 82C55A
Write (IREG2, 0x04)
Set INTEN bit
Write (IREG1, 0x01)
Set AIRQ0 to enable PPI A,
port A interrupts
Mode 1 Strobed Output Programming Example
The following example shows how to set up interrupts for mode 1 
output for port A.
Write(8255Cnfg, 0xA0)
Set mode 1-port A is an output
Write(8255Cnfg, 0x0D)
Set PC6 to enable interrupts 
from 82C55A
Write(IREG2, 0x04)
Set INTEN bit
Write(IREG1, 0x01)
Set AIRQ0 to enable PPI A,
port A interrupts
Mode 2 Bidirectional Bus Programming Example
The following example shows how to set up interrupts for mode 2 
output transfers.
Write (8255Cnfg, 0xC0)
Set mode 2 — port A is
bidirectional
Write (8255Cnfg, 0x0D)
Set PC6 to enable interrupt 
from 82C55A
Write (IREG2, 0x04)
Set INTEN bit
Write (IREG1, 0x01)
Set AIRQ0 to enable PPI A,
port A interrupts
The following example shows how to set up interrupts for mode 2 input 
transfers.
Write (8255Cnfg, 0xC0)
Set mode 2 - port A is 
bidirectional
Write (8255Cnfg, 0x09)
Set PC4 to enable interrupt 
from 82C55A
Write (IREG2, 0x04)
Set INTEN bit
Write (IREG1, 0x01)
Set AIRQ0 to enable PPI A,
port A interrupts