Omega Vehicle Security OME-PIO-D56 manual DEMO1

Page 43

4.2DEMO1

/* demo 1 : D/O demo of CON3

*/

/* step 1

: connect a OME-DB-24C to CON3 of OME-PIO-D56/D24

*/

/* step 2

: run DEMO1.EXE

*/

/* step 3

: LEDs of OME-DB-24C will turn on sequentially

*/

/* --------------------------------------------------------------

*/

#include "PIO.H"

WORD wBase,wIrq;

int main()

{

int i1,i2,i3; long i;

WORD wBoards,wRetVal,t1,t2,t3,t4,t5,t6;

WORD wSubVendor,wSubDevice,wSubAux,wSlotBus,wSlotDevice; char c;

clrscr();

 

/* step1 : find address-mapping of PIO/PISO cards

*/

wRetVal=PIO_DriverInit(&wBoards,0x80,0x01,0x40);/* for OME-PIO-

 

D56/D24*/

printf("\n(1) Threr are %d OME-PIO-D56/D24 Cards in this PC",wBoards);

if ( wBoards==0 ) exit(0);

The Configuration Space --------------

");

printf("\n\n--------------

for(i=0;i<wBoards;i++)

 

 

{

 

 

PIO_GetConfigAddressSpace(i,&wBase,&wIrq,&wSubVendor,

 

&wSubDevice,&wSubAux,&wSlotBus,&wSlotDevice);

 

printf("\nCard_%d:wBase=%x,wIrq=%x,subID=[%x,%x,%x],SlotID=

 

[%x,%x]",i,wBase,wIrq,wSubVendor,wSubDevice,

 

wSubAux,wSlotBus,wSlotDevice);

 

printf(" --> ");

 

 

ShowPioPiso(wSubVendor,wSubDevice,wSubAux);

 

}

 

 

PIO_GetConfigAddressSpace(0,&wBase,&wIrq,&t1,&t2,&t3,&t4,&t5);

 

 

/* select card_0 */

/* step2 : enable all D/I/O port

*/

outportb(wBase,1);

/* /RESET -> 1

*/

/* step3 : configure I/O direction

*/

outportb(wBase+0xcc,0x07);

/* set CON3 as D/O ports */

i=1; for (;;)

{

i1=i&0xff;

i2=(i>>8)&0xff;

i3=(i>>16)&0xff;

outportb(wBase+0xc0,i1);

outportb(wBase+0xc4,i2);

outportb(wBase+0xc8,i3);

delay(10000);

i=i<<1;

i=i&0x0ffffff; if (i==0) i=1;

if (kbhit()!=0) break;

}

PIO_DriverClose();

}

OME-PIO-D56/OME-PIO-D24 User Manual (Ver.2.1, Oct/2003)

---- 41

Image 43
Contents User’sGuide Czech Republic CanadaMexico BeneluxOME-PIO-D56/D24 Table of Contents Introduction FeaturesOrder Description SpecificationsOptions PCI Data Acquisition Family Product ChecklistOME-PISO-series cost-effective generation, isolated cards Board Layout Hardware configurationEnabling I/O Operation I/O Port Location1 DI/DO Port Architecture CON3 Select Sec RESET\ Sec DI Port Architecture CON2 Do Port Architecture CON1 Interrupt Operation If INT signal is Low now Æ select the non-inverted inputMake sure the initial level is High or Low Interrupt output signal of OME-PIO-D56/OME-PIO-D24, INT\ is Interrupt Block Diagram of OME-PIO D56/D24INTCHAN0/1/2/3 COUNTL++ Initialhigh, activelow Interrupt sourceInitiallow, activehigh Interrupt source PC0 PC1 PC2 PC3 Muliti-Interrupt SourceRead all interrupt state OME-DB-8125 Daughter BoardsOME-DB-37 OME-DN-37OME-ADP-20/PCI OME-DB-24PD Isolated Input Board OME-DB-24RD Relay Board OME-DB-24PRD, OME-DB-24POR, OME DB-24C Daughter Board Comparison Table Pin Assignment All signals are TTL compatibleDI0 DI1 DI2 DI3 DI4 DI5 DI6 DI7 DI8 DI9 PC’s physical slot information How to Find the I/O AddressResource-allocated information PIO/PISO identification informationD56/D24 PIODriverInitPIODriverInit&wBoards, wSubVendor,wSubDevice,wSubAux WSubVendor=0x80 wSubDevice=1 wSubAux=0x40 ForPrintf\nThrer are %d Piopiso Cards in this PC,wBoards OME-PISO-P32C32 Enable all D/I/O operations of card0 PIOGetConfigAddressSpaceEnable all D/I/O operations of card1 ShowPIOPISOwSubVendor,wSubDevice,wSubAux ShowPIOPISOSlot5 0x0A Slot6 0x08 Slot7 0x09 Slot8 0x07 Assignment of I/O AddressAddress Read Write I/O Address MapAUX Control Register RESET\ Control RegisterAUX data Register Aux Status Register INT Mask Control Register7 I/O Selection Control Register Interrupt Polarity Control RegisterRead/Write 8-bit data Register Demo program How to install software & utility?Piopiso PIOPISO.EXE for Windows DEMO1 DEMO2 COUNT=0 DEMO3COUNT++ DEMO4 COUNT++ PC3 DEMO5CNTL1=CNTL2=CNTL3=CNTL4=0 Page WARRANTY/DISCLAIMER Temperature