Contec F&eIT Series User Manual page 47

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

Advertisement

Using the I/O Address Map
/* ----- Read Data -------------------------------------
*/
void
unsigned char *sts )
{
outp( ADR+0x10, 0x14 );
outp( ADR+0x11, 0xf );
outp( ADR+0x10, ch*5 );
CountData.Byte[ch].lower = (unsigned
char)inp( ADR+0x11 );
CountData.Byte[ch].middle = (unsigned
char)inp( ADR+0x11 );
CountData.Byte[ch].upper = (unsigned
char)inp( ADR+0x11 );
*data = CountData.Whole[ch].count &= 0xffffff;
outp( ADR+0x10, ch*5+1 );
*sts = (unsigned char)inp(ADR+0x11);
}
/* ------ main -----------------------------------------
*/
void
{
unsigned char ch, sts;
unsigned long data;
ch = 0;
CountData.Whole[ch].count = 0x000000;
CompData.Whole[ch].count = 0x000064; /* compare data */
Initialize( ch );
while( !kbhit() ) {
sts );
}
}
/* ------------------------------------- End of file ---
*/
42
ReadData( unsigned char ch, unsigned long *data,
main( void )
ReadData( ch, &data, &sts );
printf("%01dch
%08ld
Status %02x \n", ch, data,
/* data latch */
/* read data */
/* lower */
/* middle */
/* upper */
/* status*/
/* count data */
/* display */
CNT24-2(FIT)GY

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cnt24-2(fit)gy

Table of Contents