Omega Vehicle Security OME-PIO-D56 manual DEMO2

Page 44

4.3DEMO2

/* demo 2 : DI/O demo of CON1, CON2 & CON3

*/

/* step 1 : connect OME-DB-24P to CON3 of OME-PIO-D56/D24

*/

/*

: connect CON1 t0 CON2 of OME-PIO-D56

*/

/* step 2 : run DEMO2.EXE

 

*/

/* step 3 : check the information on screen D/I will same as D/O

*/

/*

: check the result on screen will same as CON3 input

*/

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

 

*/

#include "PIO.H"

 

 

WORD wBase,wIrq;

 

 

int main()

 

 

{

i1,i2,i3,j1,j2,j3;

 

 

int

 

 

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

 

 

WORD wSubVendor,wSubDevice,wSubAux,wSlotBus,wSlotDevice;

 

char c;

 

 

long i;

 

 

clrscr();

 

 

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

*/

 

.

 

 

 

.

 

*/

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

/* /RESET -> 1

outportb(wBase,1);

*/

/* step3 : configure I/O direction

 

*/

outportb(wBase+0xcc,0x00);

/* set CON3 as D/I ports */

i=1;

 

 

 

for (;;)

{

gotoxy(1,7);

i1=i&0xff;

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

outportb(wBase+0xd0,i1);

outportb(wBase+0xd4,i2);

j1=inportb(wBase+0xd0);

j2=inportb(wBase+0xd4);

printf("\nDO = [%2x,%2x], DI = [%2x,%2x]",i2,i1,j2,j1); if ((j1!=i1)(j2!=i2))

{

printf("\n\nError ......");

}

else printf("\nO.K. ......");

j1=inportb(wBase+0xc0);

j2=inportb(wBase+0xc4);

j3=inportb(wBase+0xc8);

printf("\n\nD/I of CON3 [PA, PB, PC] = [%2x,%2x,%2x] ",j1,j2,j3); i=i<<1;

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

if (kbhit()!=0) return;

}

PIO_DriverClose();

}

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

---- 42

Image 44
Contents User’sGuide Canada MexicoBenelux Czech RepublicOME-PIO-D56/D24 Table of Contents Features IntroductionOptions SpecificationsOrder Description OME-PISO-series cost-effective generation, isolated cards Product ChecklistPCI Data Acquisition Family Hardware configuration Board Layout1 DI/DO Port Architecture CON3 I/O Port LocationEnabling I/O Operation Select Sec RESET\ Sec DI Port Architecture CON2 Do Port Architecture CON1 Make sure the initial level is High or Low If INT signal is Low now Æ select the non-inverted inputInterrupt Operation Interrupt Block Diagram of OME-PIO D56/D24 Interrupt output signal of OME-PIO-D56/OME-PIO-D24, INT\ isINTCHAN0/1/2/3 Initialhigh, activelow Interrupt source COUNTL++Initiallow, activehigh Interrupt source Muliti-Interrupt Source PC0 PC1 PC2 PC3Read all interrupt state Daughter Boards OME-DB-37OME-DN-37 OME-DB-8125OME-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 All signals are TTL compatible Pin AssignmentDI0 DI1 DI2 DI3 DI4 DI5 DI6 DI7 DI8 DI9 How to Find the I/O Address Resource-allocated informationPIO/PISO identification information PC’s physical slot informationPIODriverInit PIODriverInit&wBoards, wSubVendor,wSubDevice,wSubAuxWSubVendor=0x80 wSubDevice=1 wSubAux=0x40 For D56/D24Printf\nThrer are %d Piopiso Cards in this PC,wBoards OME-PISO-P32C32 Enable all D/I/O operations of card1 PIOGetConfigAddressSpaceEnable all D/I/O operations of card0 ShowPIOPISO ShowPIOPISOwSubVendor,wSubDevice,wSubAuxAssignment of I/O Address Slot5 0x0A Slot6 0x08 Slot7 0x09 Slot8 0x07I/O Address Map Address Read WriteAUX data Register RESET\ Control RegisterAUX Control Register INT Mask Control Register Aux Status RegisterInterrupt Polarity Control Register 7 I/O Selection Control RegisterRead/Write 8-bit data Register How to install software & utility? Demo programPiopiso PIOPISO.EXE for Windows DEMO1 DEMO2 DEMO3 COUNT=0COUNT++ DEMO4 COUNT++ DEMO5 PC3CNTL1=CNTL2=CNTL3=CNTL4=0 Page WARRANTY/DISCLAIMER Temperature