Omega Engineering OME-PIO-D96 manual DEMO2

Page 42

4.3

DEMO2

*/

/* demo 2 : DI/O demo of CN2 - CN3

/* step 1 : connect CN2 t0 CN3 of OME-PIO-D96

 

*/

: run DEMO2.EXE

*/

/* step 2

/* step 3

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

*/

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

#include "PIO.H"

WORD wBase,wIrq;

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=1;

clrscr();

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

*/

.

 

 

.

 

*/

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

/*

outportb(wBase,1);

/RESET -> 1 */

/* step3 : configure I/O direction

/* set CN2

*/

outportb(wBase+0xdc,0x07);

as D/O ports */

outportb(wBase+0xec,0x00);

/* set CN3

as D/I ports */

for (;;)

{

gotoxy(1,6);

i1=i&0xff;

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

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

outportb(wBase+0xd0,i1);

outportb(wBase+0xd4,i2);

outportb(wBase+0xd8,i3);

j1=inportb(wBase+0xe0);

j2=inportb(wBase+0xe4);

j3=inportb(wBase+0xe8);

printf("\nD/O = [%2x,%2x,%2x] , D/I = [%2x,%2x,%2x] ",i1,i2,i3,j1,j2,j3);

if ((j1!=i1)(j2!=i2)(j3!=i3))

{

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

}

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

i=i<<1;

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

if (kbhit()!=0) return;

}

PIO_DriverClose();

}

OME-PIO-D96 User Manual (Ver.1.1, Mar/2003)

---- 40

Image 42
Contents User’sGuide Benelux CanadaMexico Czech RepublicOME-PIO-D96 Table of Contents Features IntroductionSpecifications Order DescriptionOptions PCI Data Acquisition Family Product Check ListOME-PISO-series cost-effective generation, isolated cards Hardware configuration Board LayoutEnable I/O Operation I/O port LocationRefer to DEMO1.C for demo program D/I/O Architecture Interrupt Operation Make sure the initial level is High or LowInterrupt Block Diagram of OME-PIO-D96 INTCHAN3INTCHAN0/1/2/3 Initialhigh, activelow Interrupt source COUNTL++Initiallow, activehigh Interrupt source Muliti Interrupt Source Read all interrupt state OME-DN-37 & OME-DN-50 Daughter BoardsOME-DB-37 OME-DB-8125OME-ADP-37/PCI & OME-ADP-50/PCI OME-DB-24P/24PD Isolated Input Board OME-DB-24R/24RD Relay Board OME-DB-24PR/24POR/24C Daughter Boards Comparison Table All signals are TTL compatible Pin AssignmentVCC GND OME-PIO/PISO identification information How to Find the I/O AddressResource-allocated information PC’s physical slot informationPIODriverInit PIODriverInit&wBoards, wSubVendor,wSubDevice,wSubAuxWSubVendor=0x80 wSubDevice=1 wSubAux=0x10 /* for PIOD96 Current sinking PIOGetConfigAddressSpace Enable all D/I/O operation of card0Enable all D/I/O operation of card1 ShowPIOPISO ShowPIOPISOwSubVendor,wSubDevice,wSubAuxAssignment of I/O Address Slot5 0x0A Slot6 0x08 Slot7 0x09 Slot8 0x07I/O Address Map Address Read WriteRESET\ Control Register AUX Control RegisterAUX data Register INT Mask Control Register Aux Status RegisterInterrupt Polarity Control Register INV3 INV2 INV1 INV07 I/O Selection Control Register Read/Write 8-bit data Register How to install software & utility? Demo programPiopiso PIOPISO.EXE for Windows DEMO1 DEMO2 DEMO3 COUNTL++ DEMO4 COUNTL++ DEMO5 CNTL1=CNTL2=CNTL3=CNTL4=0 Page WARRANTY/DISCLAIMER Temperature