Starting An A/D Conversion; Monitoring Conversion Status @Ma Done Or End-Of-Convert); Reading The Converted Data - Real Time Devices AD1200 User Manual

Table of Contents

Advertisement

Software trigger. In this mode, a single qpecified channel is sampled whenever a value is written to the START
COI.MRT port, BA + 0. The active channel is the one specified in the PPI Port B port.
This is the easiest of all riggering modes. It can be used in a wide variety of applications, such as sample every
time a key is pressed on the keyboard, sample with each iteration of a loop, or watch the system clock and sample
-
every five seconds. See the SOFITRIG sample progam in C and Pascal and the SINGLE sample program in
BASIC.
Pacer Clock. In this mode, conversions are continuously performed at the pacer clock rate. To use this mode,
you must program the pacer.clock-to run at the desired rate (see the pacer clock discussion later in this chapter). The
PCK jumper on P? must be installed to use the pacer clock.
This is the ideal mode for filling an array with data. Triggering is automatic, so your program is spared rhe
chore of monioring the pacer clock to determine when to sample. See the MULTI sample program in C and pascal.
External Trigger.In this mode, a single conversion is initiated by the rising edge of an extemal riggerpulse.
This mode is implemented when an external device is used to detennine when to sample. See the EXTTRIG
sample progam in C and Pascal.
. Starting an A/D Conversion
Software riggered single conversions are start€d by writing ro the START COI\IaERT port ar BA + 0. The
value you write is irrelevanL For single conversions, you must write to ttris port to initiate every conversion.
Externally triggered single conversions and multiple conversions niggered by the pacer clock through the external
rigger are stailed by the lrst pulse present after the extemal trigger has been enabled.
. Monitoring Conversion Status (DMA Done or End-of-Convert)
The A/D conversion slatus can be monitored through the DMA done flag or through the end-of-convert (EOC)
bit in the STATUS port at BA + 0. When doing DMA transfers, you will want to moniror the DMA done flag for a
transition from low to high. This tells you when the DMA transfer is complete and data has been placed in thi F€'s
memory. The EOC line is available for monitoring conversion status when performing single conversions not using
DMA transfer. When ttre EOC goes from low o high, rhe A/D converter has completed its conversion and the data
is ready to read. The EOC line stays high following a convenion until the data has been read. Then the line goes
back to low until the next conversion is complete.
. Reading the Converted Data
Two successive reads of port BA + I provide the LSB and MSB of the 12-bit AID conversion in the format
defined in the VO map section at the beginning of this chapter. The LSB must always be read first, followed by the
MSB.
The output code and the resolution of the conversion vary, depending on the input volbge range selected.
Bipolar conversions are in twos complement form, and unipolar conversions are straight binary. When a bipolar
value is read, you must fhst convert the result to straight binary and then calculate the voltage. The conversion
formula is simple: for values greater than}M7, you must subtract 4096 from the value to get the sign of the voltage.
For example, if your output is 2048, you subtract 4096: 2MB - 4W6 = -2M8. This result corresponds to -5 volts or
-10 volts, depending on your binary range. For values of 2047 or less, you simply convert ttre result.
The key digital
codes and their input voltage values are given for each range in the three tables which follow.
4-13

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ada1200

Table of Contents