Register-Level Programming Appendix E
Lab-PC+ User Manual E-6 © National Instruments Corporation
Alternatively, a programmable timebase for Counter A0 is available through the use of
Counter B0. If the TBSEL bit in Command Register 1 is set, then the timebase for Counter A0 is
Counter B0. Counter B0 has a fixed, unalterable 2 MHz clock as its own timebase, so its period
is the value stored in it multiplied by 500 ns. The minimum period that can be selected for
Counter B0 is 1 µs. The period of Counter A0, or the sample period, is then equal to the period
of Counter B0 multiplied by the value stored in Counter A0. Regardless of the timebase chosen,
the minimum sample period of 16 µs must be observed for data integrity.
Programming in Controlled Acquisition Mode
The following programming steps are required for a data acquisition operation in controlled
acquisition mode:
1. Select analog input channel, gain, and timebase source for Counter A0.
The analog input channel and gain are selected by writing to Command Register 1. The
SCANEN bit must be cleared for data acquisition operations on a single channel. See the
Command Register 1 bit description earlier in this chapter for gain and analog input channel
bit patterns. If Counter B0 is being used as a timebase for Counter A0, then the TBSEL bit in
Command Register 2 should be set at this time.
Command Register 1 needs to be written to only when the analog input channel, gain setting,
or other function needs to be changed.
2. Program Counter B0 (if necessary).
The following sequence should be used to program Counter B0 if it is being used. If
Counter B0 is not being used, skip to step 3. All writes are 8-bit write operations. All values
given are hexadecimal.
a. Write 36 to the Counter B Mode Register (select Mode 3).
b. Write the least significant byte of the timebase count to the Counter B Data Register.
c. Write the most significant byte of the timebase count to the Counter B Data Register. For
example, programming a timebase of 10 µs requires a timebase count of
10 µs
0.5 µs
=20