1 triggering, 2 burst counter, 3 result registers – Sensoray 826 User Manual
Page 19: Triggering, Burst counter, Result registers
ADC conversions are disabled upon board reset. Typically, an application program will configure the ADC system (by
programming slotlist and slot configuration registers) before enabling conversions, though this is not required. The slotlist
and slot configuration registers may be reprogrammed at any time, even when conversions are enabled.
5.1.1 Triggering
The trigger mode register determines which of two triggering modes, triggered or continuous, will be used to initiate
conversion bursts. In triggered mode each burst must be initiated by a trigger signal, whereas in continuous mode the
trigger signal is ignored and conversion bursts will automatically execute one after another with no idle time between
bursts. The trigger mode and trigger signal source are programmed by calling S826_AdcTrigModeWrite.
When operating in triggered mode, S826_AdcTrigModeWrite selects one of the following signals to serve as the trigger:
•
Any of the 48 general purpose digital I/O (DIO) channels. This enables an external digital signal to trigger bursts. When
a DIO channel is used to trigger A/D conversions, the timing of the trigger signal is constrained by the DIO subsystem.
See DIO “Pin Timing” for more information.
•
Any of the six counter ExtOut signals. This enables a counter to periodically trigger ADC bursts. The selected counter
output is internally routed to the ADC trigger input; no external wiring is required.
•
Any of the six virtual digital outputs. This enables software to trigger ADC bursts by writing to a virtual output. See
Virtual Outputs for more information. The selected virtual output is internally routed to the ADC trigger input; no
external wiring is required.
5.1.2 Burst Counter
The controller maintains an 8-bit burst counter that indicates the number of conversion bursts since the ADC was enabled.
The burst counter is zeroed upon board reset and whenever the ADC is disabled. The counter increments at the end of each
burst and overflows to zero when incrementing from 255. The burst count is passed to the host along with every ADC
sample so that the program can determine which burst a sample belongs to.
In triggered mode, the burst count can be used to keep track of the number of received triggers. If a trigger occurs while a
burst is in progress, a MissedTrigger flag is set and the trigger will be ignored. After this happens, the burst count will no
longer accurately indicate the number of received triggers (accuracy can be restored by disabling and then re-enabling ADC
conversions).
5.1.3 Result Registers
Each slot has a result register that stores the slot's most recently acquired result, which is a set of four values: ADC output
data, timestamp (which indicates the time the result was acquired), burst count, and overrun flag. Each slot also has a hold
register that caches a result while it is being read by the host computer. The hold register ensures that the result's four
component values will remain correlated if a new result is captured while the previous result is being read.
During a burst, the controller processes each slot by performing a sequence of operations. First it switches the analog
multiplexer to the desired differential input pair and programs the gain and then, if the slot has a non-zero settling time, it
waits for the settling time to elapse. When the settling time has elapsed, the controller starts an analog-to-digital conversion.
At the moment the conversion completes, the four component values that comprise the result are simultaneously sampled
and copied to the result register.
A new result will always overwrite the previous result, even if the previous result has not been read. If the previous result
has not yet been read when a new result is written, the overrun flag will be set to '1'; otherwise it will be set to '0'.
Sixteen hardware status flags (one per slot) indicate unread results. A status flag is set when the controller writes a new
result to the associated result register, and reset when the program reads the result. Results are read by calling the
S826_AdcRead function. The S826_AdcStatusRead function can be called to check the status flags without returning
results or altering status flags.
826 Instruction Manual
14
Analog Inputs