Manual 104-AIO16A and 104-AIO16E
15
Chapter 5: Programming
A/D Order of Operations:
Behavior may become unpredictable if these steps are not followed.
This is a guide of steps to take before beginning an A/D conversion.
1) Configure the channel gains (Base A 2-5).
2) Configure the start and end channel (Base A 6).
3) Configure the number of oversamples per channel (Base A 7).
4) Configure Counter/Timer 1&2 if using Timer Start or External Start Trigger (Base A 8- B).
If using External Start Trigger, connect the trigger source to P2 pin 39.
5) Configure the A/D Start Source as Software Start, Timer Start, or External Start Trigger. Configure
A/D Start as rising or falling edge. Configure A/D Start as Single Channel or Scan. (Base A 11).
Once this address is written to, A/D conversions will be enabled if the A/D Start Source is either Timer
Start or External Start Trigger. If the A/D Start Source is Software Start, conversions will begin after a
write to Base A 1.
6) Read A/D data from the A/D Data FIFO with a read from Base A 0-1. It is helpful to use the
flags in Base A 12 and the IRQ flags in Base A 13 when deciding to read A/D data.
Offset
Write Function
Read Function
0
1
A/D Software Start
A/D Data
2
3
4
5
A/D Programmable Gain
Configuration
6
A/D Start/End Ch Configuration
7
A/D Oversample Configuration
8
9
A
B
Counter/Timer Configuration
Counter/Timer Configuration
C
D
DAC 0 Output Data
E
F
DAC 1 Output Data
10 DAC
Configuration
11
A/D Start & Counter/Timer 0
Clock Configuration
12
A/D, DAC, FIFO Status Flags
13
IRQ Configuration
IRQ Status
14
Port A DIO (8255)
Port A DIO (8255)
15
Port B DIO (8255)
Port B DIO (8255)
16
17
DIO Configuration (8255)
18
EEPROM access
EEPROM access
19
Calibration access
1A
1B
Reset Register
1C-1E
1F
Board
Model
Table 5-1:
Register Definitions