beautypg.com

Programming the sample-interval counter, Programming the sample-interval counter -16 – National Instruments AT-MIO-16X User Manual

Page 185

background image

Chapter 5

Programming

AT-MIO-16X User Manual

5-16

© National Instruments Corporation

configuration memory, perform the following write operations where
N is the number of entries in the scan sequence:

Strobe the CONFIGMEMCLR Register.

For i = 0 to N-1, use the following steps:

a.

Write the desired analog channel selection and gain setting to
the CONFIGMEM Register (this loads the configuration
memory at location i ).

b.

If i = N-1, also set the LASTONE bit when writing to the
CONFIGMEM Register.

Strobe the CONFIGMEMLD Register.

Programming the Sample-Interval Counter

Counter 3 of the Am9513A Counter/Timer is used as the
sample-interval counter. Counter 3 can be programmed to generate an
active low pulse once every N counts. N is referred to as the sample
interval, that is, the time between successive A/D conversions. N can be
between 2 and 65,536. One count is equal to the period of the timebase
clock used by the counter. The following internal clocks are available
to the Am9513A: 5 MHz, 1 MHz, 100 kHz, 10 kHz, 1 kHz, and 100 Hz.
In addition, the sample-interval timer can use signals connected to any
of the Am9513A SOURCE input pins.

Using the EXTCONV* signal from the I/O connector to control
multiple A/D conversions involves disabling the sample-interval
counter. This counter should be left in the high-impedance state, see the
Resetting a Single Am9513A Counter/Timer section later in this chapter.
Conversions are generated by the falling edge of the EXTCONV*
signal. Although EXTCONV* may be pulsing, conversions do not
begin until after an active low pulse on DAQ Start or the EXTTRIG*
signal. Conversions are automatically halted irrespective of the
EXTCONV* signal when the sample counter reaches zero.

To program the sample-interval counter for internal conversion signals,
use the following programming sequence. All writes are 16-bit
operations. All values given are hexadecimal.

1.

Write FF03 to the Am9513A Command Register to select the
Counter 3 Mode Register.

2.

Write the mode value to the Am9513A Data Register to store the
Counter 3 mode value. Am9513A counter mode information can be