Contec F&eIT Series User Manual page 51

Isolated counter module
Hide thumbs Also See for F&eIT Series:
Table of Contents

Advertisement

Using the I/O Address Map
void
{
_disable();
if ( IrqLevel > IRQ7 ) {
} else
_dos_setvect( IntVector[IrqLevel], OrgVect );
_enable();
}
/* ----- interrupt handler -----------------------------
*/
void
{
unsigned char i;
_enable();
for (i = 0; i < CH; i++) {
}
intcnt++;
outp( ADR+0x10, 0x16 );
outp( ADR+0x11, 0x10 );
_disable();
if ( IrqLevel > IRQ7 ) {
} else
}
/* ------ main -----------------------------------------
*/
void
{
unsigned char i;
for (i = 0; i < CH; i++) {
*/
}
Interval();
ChgVect();
outp( ADR+0x2, IntEnable[IrqLevel] ); /* interrupt level
*/
outp( ADR+0x10, 0x18 );
outp( ADR+0x11, 0x1 );
while( intcnt < 10 )
Display();
outp( ADR+0x10, 0x18 );
outp( ADR+0x11, 0x0 );
outp( ADR+0x2, 0x0 );
ResVect();
}
/* ------------------------------------- End of file ---
*/
46
ResVect( void )
outp( 0x21, OrgMasterImr );
outp( 0xa1, OrgSlaveImr );
outp( 0x21, OrgMasterImr );
_interrupt _far inthandler( void )
outp( ADR+0x10, 0x14 );
outp( ADR+0x11, 0xf );
outp( ADR+0x10, i*5 );
CountData.Byte[i].lower = (unsigned char)inp( ADR+0x11 );
CountData.Byte[i].middle = (unsigned char)inp( ADR+0x11 );
CountData.Byte[i].upper = (unsigned char)inp( ADR+0x11 );
CountData.Whole[i].count &= 0xffffff;
outp( 0xa0, 0x20 );
outp( 0xa0, 0x0b );
if ( !inp( 0xa0 ) )
outp( 0x20, 0x20 );
main( void )
CountData.Whole[i].count = 0x000000; /* count data */
CompData.Whole[i].count = 0x000064;
Initialize(i);
Display();
/* disable */
/* restore IMR */
/* restore orgvect */
/* channel */
/* data latch */
/* read data */
/* count interrupt */
/* sense reset */
/* disable */
outp( 0x20, 0x20 );
/* compare data
/* initialize */
/* change vector */
/* timer start */
/* display
/* display
/* timer stop */
/* interrupt level */
/* restore vector */
CNT24-2(FIT)GY
/* enable */
/* enable */
/* lower */
/* middle */
/* upper */
/* EOI */
*/
*/

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cnt24-2(fit)gy

Table of Contents