TS-8820-ADC

From embeddedTS Manuals
Revision as of 17:14, 1 July 2014 by Mpeters (talk | contribs) (Added a note about using the ADC in direct register mode... because the FIFO is otherwise quite confusing.)

The 16 ADC channels are on P3, P4, P5. Inputs for these channels must be in the -10V to +10V range. It is also possible to select a -5V to +5V range in software by pulling CN2_56 (adc1) and/or CN2_58 (adc2) high. On P3, P4, P5, all even numbered terminals are connected to ground. Odd numbered terminals are used for ADC inputs and DAC outputs.

To sample the ADC channels:

# This will sample the ADC inputs 5 times a second.
ts8820ctl --sample=5

This will sample for 1 second 5 times. For example, this would return:

 Collected 80 samples total.
 
 Ch 1 Ch 2 Ch 3 Ch 4 Ch 5 Ch 6 Ch 7 Ch 8 Ch 9 Ch10 Ch11 Ch12 Ch13 Ch14 Ch15 Ch16 
 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- 
 9999 9999 9999 9999 9999 9999 9999 9999 2143 2136 2141 2144 2148 2143 2142 2143 
 9999 9999 9999 9999 9999 9999 9999 9999 2142 2137 2141 2144 2147 2143 2142 2142 
 9999 9999 9999 9999 9999 9999 9999 9999 2142 2136 2140 2144 2147 2143 2142 2142 
 9999 9999 9999 9999 9999 9999 9999 9999 2142 2136 2141 2144 2147 2142 2142 2142 
 9999 9999 9999 9999 9999 9999 9999 9999 2142 2136 2140 2144 2147 2143 2142 2142

Note for direct register access users: The FIFO is filled in a round-robin manner across the four chips, so given a channel mask of 00101000 with three ADC chips selected, the FIFO would first give chip 0 channel 4, then chip 1 channel 4, chip 2 channel 4, chip 0 channel 6, etc.