Omega Vehicle Security OME-PIO-D56 manual Initiallow, activehigh Interrupt source

Page 17

2.4.4Initial_low, active_high Interrupt source

If the PC0 is a initial_low, active_high signal, the interrupt service routine should use INV0 to inverted/non-inverted the PC0 for high_pulse generation as follows: (Refer to DEMO3.C)

Initial setting:

 

 

now_int_state=0;

/* initial state for PC0

*/

 

 

 

 

 

 

 

 

outportb(wBase+0x2a,1);

/* select the non-inverted PC0 */

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

void interrupt irq_service()

 

 

 

 

 

 

 

 

 

{

 

 

 

 

/* now PC0 is changed to LOW

 

*/(c)

if (now_int_state==1)

 

 

{

 

 

 

/* --> INT_CHAN_0=!PC0=HIGH now

 

*/

 

 

 

 

COUNT_L++;

 

/* find a LOW_pulse (PC0)

 

*/

 

 

 

 

If((inport(wBase+7)&1)==0)/* the PC0 is still fixed in LOW

*/

 

 

{

 

 

 

/*

Æ need to generate a high_pulse

*/

 

 

 

 

outportb(wBase+0x2a,1);/*

INV0 select the non-inverted input

*/(d)

 

 

 

 

 

 

/*

INT_CHAN_0=PC0=LOW -->

 

*/

 

 

 

 

now_int_state=0;

 

/*

INT_CHAN_0 generate a high_pulse

*/

 

 

 

 

 

/* now PC0=LOW

 

 

 

*/

 

 

}

 

 

 

/* now PC0=HIGH

 

 

 

*/

 

 

 

 

else now_int_state=1;

 

 

 

 

 

}

 

 

 

/* don’t have to generate high_pulse

*/

 

 

 

 

 

/* now PC0 is changed to HIGH

 

*/(a)

else

 

 

{

 

 

 

/* --> INT_CHAN_0=PC0=HIGH now

 

*/

 

 

 

 

COUNT_H++;

 

/* find a High_pulse (PC0)

 

*/

 

 

 

 

If((inport(wBase+7)&1)==1)/* the PC0 is still fixed in HIGH

*/

 

 

{

 

 

 

/* need to generate a high_pulse

*/

 

 

 

 

outportb(wBase+0x2a,0);/* INV0 select the inverted input */(b)

 

 

 

 

 

 

/* INT_CHAN_0=!PC0=LOW -->

 

*/

 

 

 

 

now_int_state=1;

 

/* INT_CHAN_0 generate a high_pulse

*/

 

 

 

 

 

/* now PC0=HIGH

 

 

 

*/

 

 

}

 

 

 

/* now PC0=LOW

 

 

 

*/

 

 

 

 

else now_int_state=0;

 

 

 

 

 

}

 

 

 

/* don’t have to generate high_pulse

*/

 

 

 

 

 

 

 

 

 

 

 

 

 

 

if (wIrq>=8) outportb(A2_8259,0x20);

 

 

 

 

 

 

 

outportb(A1_8259,0x20);

 

 

 

 

 

 

 

 

 

 

}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(a)

(b)

 

 

(c)

(d)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PC0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

INV0

INT_CHAN_0

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

---- 15

Image 17
Contents User’sGuide Mexico CanadaBenelux Czech RepublicOME-PIO-D56/D24 Table of Contents Introduction FeaturesOptions SpecificationsOrder Description OME-PISO-series cost-effective generation, isolated cards Product ChecklistPCI Data Acquisition Family Board Layout Hardware configuration1 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 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-37 Daughter BoardsOME-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 Pin Assignment All signals are TTL compatibleDI0 DI1 DI2 DI3 DI4 DI5 DI6 DI7 DI8 DI9 Resource-allocated information How to Find the I/O AddressPIO/PISO identification information PC’s physical slot informationPIODriverInit&wBoards, wSubVendor,wSubDevice,wSubAux PIODriverInitWSubVendor=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 ShowPIOPISOwSubVendor,wSubDevice,wSubAux ShowPIOPISOSlot5 0x0A Slot6 0x08 Slot7 0x09 Slot8 0x07 Assignment of I/O AddressAddress Read Write I/O Address MapAUX data Register RESET\ Control RegisterAUX Control 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