ICP DAS USA PEX Series User Manual page 20

Analog output boards
Table of Contents

Advertisement

ГК Атлант Инжиниринг – официальный представитель в РФ и СНГ
+7(495)109-02-08 sales@bbrc.ru www.bbrc.ru
PEX/PIO/PISO-DA Series Card
Analog Output Boards
/* ------------------------------------------------------------------------------------------------------- */
/* Note : 1.The hold_time of INT_CHAN_0 & INT_CHAN_1 must long
/*
enoug.
/*
2.The ISR must read the interrupt status again to
/*
identify the active interrupt source.
/*
3.The INT_CHAN_0 & INT_CHAN_1 can be active at the same
/*
time.
/* --------------------------------------------------------------------------------------------------- */
void interrupt irq_service()
{
/* now ISR can not know which interrupt is active
new_int_state=inportb(wBase+7)&0x03;
int_c=new_int_state^now_int_state;
if ((int_c&0x01)==1)
{
if ((new_int_state&1)==0)
{
INT0_L++;
}
else
{
INT0_H++;
}
invert=invert^1;
}
if ((int_c&0x02)==2)
{
if ((new_int_state&2)==0)
{
INT1_L++;
}
else
{
INT1_H++;
}
invert=invert^2;
}
now_int_state=new_int_state;
outportb(wBase+0x2a,invert);
if (wIrq>=8) outportb(A2_8259,0x20);
outportb(A1_8259,0x20);
}
/* read all interrupt
/* signal state
/* compare new_state to */
/* old_state
/* INT_CHAN_0 is active
/* INT0 change to low now
/* INT0 change to high now
/* generate high_pulse
/* INT_CHAN_1 is active
/* INT1 change to low now
/* INT1 change to high now
/* generate high_pulse
/* update interrupt status
/* generate a high pulse
User Manual/ Ver. 3.1/ Oct. 2013/ PMH-0010-31/ Page: 20
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/

Advertisement

Table of Contents
loading

Table of Contents