Omega Vehicle Security OME-PIO-D56 manual Read/Write 8-bit data Register

Page 39

3.3.8Read/Write 8-bit data Register

(Read/Write):wBase+0xc0/0xc4/0xc8/0xd0/0xd4

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

D7

D6

D5

D4

D3

D2

D1

D0

Note. Refer to Sec. 3.1 for more information about wBase.

There are five/three 8-bit I/O ports in the OME-PIO-D56/OME-PIO-D24. Each port is easy to read/write to by access to their own data registers.

outportb(wBase+0xc0,Val);

/* write to D/O port

*/

Val=inportb(wBase+0xc0);

/* read from D/I port

*/

outportb(wBase+0xcc,0x07);

/* configure Port0~Port2 as DO port

*/

outportb(wBase+0xc0,i1);

/* write to Port0

*/

outportb(wBase+0xc0,i2);

/* write to Port1

*/

outportb(wBase+0xc0,i3);

/* write to Port2

*/

outportb(wBase+0xcc,0x01);

/* configure Port0 as DO port

*/

 

/* Port1~Port2 as DI port

*/

outportb(wBase+0xc0,i1);

/* write to Port0

*/

j2=inportb(wBase+0xc4);

/* read Port1

*/

j3=inportb(wBase+0xc8);

/* read Port2

*/

l=inportb(wBase+0xd0);

/* read CON2 Low byte

*/

h=inportb(wBase+0xd4);

/* read CON2 High byte

*/

Val=(h<<8)+l;

/* Val is 16 bit data

*/

outportb(wBase+0xd0,Val);

/* write to CON1 Low byte

*/

outportb(wBase+0xd4,(Val>>8));

/* write to CON1 high byte

*/

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

---- 37

Image 39
Contents User’sGuide Czech Republic CanadaMexico BeneluxOME-PIO-D56/D24 Table of Contents Introduction FeaturesSpecifications Order DescriptionOptions Product Checklist PCI Data Acquisition FamilyOME-PISO-series cost-effective generation, isolated cards Board Layout Hardware configurationI/O Port Location Enabling I/O Operation1 DI/DO Port Architecture CON3 Select Sec RESET\ Sec DI Port Architecture CON2 Do Port Architecture CON1 If INT signal is Low now Æ select the non-inverted input Interrupt OperationMake 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 PIOGetConfigAddressSpace Enable all D/I/O operations of card0Enable 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 MapRESET\ Control Register AUX 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