beautypg.com

Figure 5-1. initializing the am9513a counter/timer, Figure 5-1, Initializing the am9513a counter/timer -4 – National Instruments AT-MIO-16X User Manual

Page 173

background image

Chapter 5

Programming

AT-MIO-16X User Manual

5-4

© National Instruments Corporation

Figure 5-1. Initializing the Am9513A Counter/Timer

Write 0xFFFF to the Am9513A

Command Register

Write 0xFFEF to the Am9513A

Command Register

Write 0xFF17 to the Am9513A

Command Register

Write 0xF000 to the Am9513A

Data Register

Write 0xFF00 + ctr to the

Am9513A Command Register

Write 0x0004 to the Am9513A

Data Register

Write 0xFF08 + ctr to the

Am9513A Command Register

Write 0x0003 to the Am9513A

Data Register

Write 0xFF5F to the Am9513A

Command Register

ctr = 1

? ctr = 6 ?

END

START

No

Yes

Issue a master reset operation

Enable 16-bit access mode

Point to the master mode register

Load the master mode value

Point to the counter mode register

Store the counter mode value

Point to the counter load register

Store an inactive count value

Load all counters

Increment Ctr