beautypg.com

National Instruments AT-MIO-16X User Manual

Page 202

background image

Chapter 5

Programming

© National Instruments Corporation

5-33

AT-MIO-16X User Manual

sequence. All writes are 16-bit operations. All values given are
hexadecimal.

1.

Write FF00 + n to the Am9513A Command Register to select the
Counter n Mode Register.

2.

Write the mode value to the Am9513A Data Register to store the
Counter n mode value. Am9513A counter mode information can be
found in Appendix C, AMD Am9513A Data Sheet. Use one of the
following mode values:

0225 — Selects 5-MHz clock (from SOURCE2 pin)

0B25 — Selects 1-MHz clock

0C25 — Selects 100-kHz clock

0D25 — Selects 10-kHz clock

0E25 — Selects 1-kHz clock

0F25 — Selects 100-Hz clock

0525 — Selects signal at SOURCE5 input as clock

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

3.

Write (FF08 + n) to the Am9513A Command Register to select the
Counter n Load Register.

4.

Write the desired update interval to the Am9513A Data Register to
store the counter n load value.

5.

Write the following value to the Am9513A Command Register to
load counter n.

FF41 — Load Counter 1

FF42 — Load Counter 2

FF50 — Load Counter 5

6.

Write (FFF0 + n) to the Am9513A Command Register to decrement
Counter n.

7.

Write the following value to the Am9513A Command Register to
arm Counter n.

FF21 — Arm Counter 1

FF22 — Arm Counter 2

FF30 — Arm Counter 5

After you complete this programming sequence, Counter n is
configured to generate active-low pulses as soon as the load/arm
counter command is written.