![Apex Digital STX104 Reference Manual Download Page 82](http://html.mh-extra.com/html/apex-digital/stx104/stx104_reference-manual_2952893082.webp)
low_count = 10L;
/* 1 microsecond intervals */
high_count = time_interval_ns / 1000;
while
( high_count > 65536L )
{
high_count = high_count >> 1;
low_count = low_count << 1;
}
while
( high_count < 2L )
{
high_count = high_count << 1;
low_count = low_count >> 1;
}
#ifdef
STX104_DEBUG_MODE
fprintf( stdout, "low_count=%ld, high_count=%ld\n",low_count,high_count);
fprintf( stdout, "Actual Interval (uSec) = %ld\n",time_interval_ns);
#endif
/* set counter/timer 2 */
outportb( stx104_base_address[board] + STX104_CT_CONFIGURATION, 0xB4 );
octet = ((
unsigned
int
) high_count) & 0x00FF;
outp( stx104_base_address[board] + STX104_CT2_DATA, octet );
#ifdef
STX104_DEBUG_MODE
fprintf( stdout, "CT2 LB=%u\n",octet );
#endif
octet = ((
unsigned
int
) high_count) >> 8;
outp( stx104_base_address[board] + STX104_CT2_DATA, octet );
#ifdef
STX104_DEBUG_MODE
fprintf( stdout, "CT2 HB=%u\n",octet );
#endif
/* set counter/timer 1 */
outportb( stx104_base_address[board] + STX104_CT_CONFIGURATION, 0x74 );
octet = ((
unsigned
int
) low_count) & 0x00FF;
outp( stx104_base_address[board] + STX104_CT1_DATA, octet );
#ifdef
STX104_DEBUG_MODE
fprintf( stdout, "CT1 LB=%u\n",octet );
#endif
octet = ((
unsigned
int
) low_count) >> 8;
outp( stx104_base_address[board] + STX104_CT1_DATA, octet );
#ifdef
STX104_DEBUG_MODE
fprintf( stdout, "CT1 HB=%u\n",octet );
#endif
}
11.25
FIFO Status LSB (Offset=15)
FIFO Status LSB Register. Please refer to FIFO Status MSB ( see page 65) Register for details.
See Also
Register Summary ( see page 41)
11.26
Index Data LSB (Offset=12, RB='1')
Indexed Data I/O least significant byte (or lower 8-bits). Please refer to Index Data ( see page 75) Register for further details.
STX104 Reference Manual
11.26 Index Data LSB (Offset=12, RB='1')
Copyright © 2009 by
Apex Embedded Systems
. All rights reserved.
74
Thursday, October 08, 2009
11