Contec F&eIT Series User Manual page 50

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

Advertisement

/* ----- Initialize ------------------------------------
*/
void
{
outp( ADR+0x10, ch*5+1 );
outp( ADR+0x11, 0x8c );
outp( ADR+0x10, ch*5+2 );
outp( ADR+0x11, 0x4 );
outp( ADR+0x10, ch*5+4 );
outp( ADR+0x11, 0x1 );
outp( ADR+0x10, 0x16 );
outp( ADR+0x11, 0xff );
outp( ADR+0x10, ch*5 );
outp( ADR+0x11, CountData.Byte[ch].lower ); /* lower */
outp( ADR+0x11, CountData.Byte[ch].middle );
*/
outp( ADR+0x11, CountData.Byte[ch].upper ); /* upper */
outp( ADR+0x10, ch*5+3 );
outp( ADR+0x11, CompData.Byte[ch].lower );
outp( ADR+0x11, CompData.Byte[ch].middle ); /* middle */
outp( ADR+0x11, CompData.Byte[ch].upper );
outp( ADR+0x10, 0x19 );
outp( ADR+0x11, 0xff );
}
/* ----- timer set -------------------------------------
*/
void
{
outp( ADR+0x10, 0x15 );
outp( ADR+0x11, 0xf );
outp( ADR+0x10, 0x17 );
outp( ADR+0x11, 0xff );
outp( ADR+0x11, 0x2c );
outp( ADR+0x11, 0x31 );
outp( ADR+0x11, 0x1 );
}
/* ----- change vector ---------------------------------
*/
void
{
OrgVect = _dos_getvect( IntVector[IrqLevel] );
_disable();
_dos_setvect( IntVector[IrqLevel], inthandler );
if ( IrqLevel > IRQ7 ) {
PicMask[IrqLevel] );
} else {
PicMask[IrqLevel] );
}
_enable();
}
/* ----- display ---------------------------------------
*/
void
{
int
j = intcnt;
for (i = 0; i < CH; i++) {
CountData.Whole[i].count );
}
printf("interrupt count = %03d \n", intcnt);
}
/* ------ restore vector -------------------------------
*/
CNT24-2(FIT)GY
Initialize( unsigned char ch )
Interval( void )
ChgVect( void )
outp( 0x21, ( OrgMasterImr = inp( 0x21 ) ) & 0xfb );
outp( 0xa1, ( OrgSlaveImr = inp( 0xa1 ) ) &
outp( 0x20, 0x62 );
outp( 0xa0, IsrClear[IrqLevel] );
outp( 0x21, ( OrgMasterImr = inp( 0x21 ) ) &
outp( 0x20, IsrClear[IrqLevel] );
Display( void )
i, j;
printf("%01dch %06lXH
Using the I/O Address Map
/* mode set */
/* z-pulse set */
/* digital filter set */
/* sense reset */
/* initial data set */
/* compare data set */
/* one-shot pulse set */
/* mask clear */
/* timer set */
/* IMR and mask clear */
/* ISR clear (master) */
/* ISR clear (slave) */
/* IMR and mask clear */
/* ISR clear */
", i,
/* middle
/* lower */
/* upper */
/* 1 sec */
/* enable */
45

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cnt24-2(fit)gy

Table of Contents