beautypg.com

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

Page 189

background image

Chapter 5

Programming

AT-MIO-16X User Manual

5-20

© National Instruments Corporation

acquisition operation is terminated when Counter 4 and Counter 5 reach
zero.

Programming the Scan-Interval Counter

Counter 2 of the Am9513A Counter/Timer is used as the scan-interval
counter. Counter 2 can be programmed to generate a pulse once every
N counts. N is referred to as the scan interval, which is the time between
successive scan sequences programmed into the mux-channel gain
memory. 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 clocks
are available internal to the Am9513A: 5 MHz, 1 MHz, 100 kHz,
10 kHz, 1 kHz, and 100 Hz. In addition, the scan-interval timer can use
signals connected to any of the Am9513A SOURCE input pins.

To program the scan-interval counter, use the following programming
sequence. All writes are 16-bit operations. All values given are
hexadecimal.

1.

Write FF02 to the Am9513A Command Register to select the
Counter 2 Mode Register.

2.

Write the mode value to the Am9513A Data Register to store the
Counter 2 mode value. Use one of the following mode values:

8225 — Selects 5-MHz clock (Counter 2 Source signal)

8B25 — Selects 1-MHz clock

8C25 — Selects 100-kHz clock

8D25 — Selects 10-kHz clock

8E25 — Selects 1-kHz clock

8F25 — Selects 100-Hz clock

8525 — Selects signal at SOURCE5 input as clock

(counts the rising edge of the signal, 6 MHz maximum)

3.

Write FF0A to the Am9513A Command Register to select the
Counter 2 Load Register.

4.

Write 2 to the Am9513A Data Register to store the Counter 2 load
value.

5.

Write FF42 to the Am9513A Command Register to load Counter 2.

6.

Write FFF2 to the Am9513A Command Register to step Counter 2
down to 1.