AD7682 SPI Control

I'm designing SPI interfaces to control multiple AD7682 devices on a board, each with different analog input configurations and reference connections.  The intent is to hide the complexity of the SPI interface from software by continuously accessing the A/D and storing the conversion results in RAM for software to access.  I have multiple questions that I can't find an answer to in the datasheet. 

In one case there are multiple analog muxes feeding an AD7682 that select from about 20 different voltages that need to be monitored.  The current circuit works using the sequencer but I want to speed up the sampling process so that only those inputs that are valid are sampled (the mux control is common to all analog muxes, but not all analog mux inputs are being driven).  I'm assuming sampling of inputs in a specific order can be performed using bits 9:7 in the configuration register (and turning off the sequencer in bits 2:1)? 

Other than using the sequencer, how can the temperature sensor data be accessed?  I'm also confused by bits 12:10 in the configuration register table (Table 10) because there is the "Unipolar, INx referenced to GND" that I will need to use for the external inputs, while still wanting to use the Temperature sensor, which appears to have its own "Temperature sensor" setting?

What does the "Update configuration during sequence." entry for bits 2:1 of the configuration register do?  It implies that you first select one of the sequencer settings and then this setting will be retained while changing other configuration register fields (in other words, if using the sequencer the sequence won't be disturbed when this entry is used), but there are no details in the datasheet regarding this. 

Does readback start on the SPI transfer that enables the readback capability, or is there a delay? 

If an AD7682 REF input is being driven externally but REFIN just has external caps connected, can the temperature sensor still be used by setting bits 5:2 of the config register to 0x2 (External reference, temperature enabled)?  Does this turn off the internal buffer?  In this case I'm assuming the AD7682 output would reflect that the temperature sensor voltage is compared to the externally supplied reference? 

Finally, just to make sure I understand the spec correctly, I should expect about a 1 mV change in the temperature sensor per degree C?  So if I'm using a 4V reference I would expect to see the conversion value change about 16 steps per degree C? 

  • 0
    •  Analog Employees 
    on Mar 14, 2013 4:16 PM

    Hi, Glenn.

    You are correct in that CFG[9:7] would select which channel will be converted. The sequencer will be useful for scanning channels in a repeated fashion. If you turn this off, you will be getting conversion results for a single channel that you have set with CFG[9:7]. If you want to scan channels, enable the sequencer using CFG[2:1]. It would start with IN0 and finish with IN[7:0] set in CFG[9:7]. Detailed information on this can be found on the Channel Sequencer section of the AD7682 datasheet.

    As you've noted, to use the sequencer, setting CFG[2:1] to 10 scans the analog inputs  AND the internal temperature sensor as in the examples found in page 28 of the datasheet. Another way for temp sensor to be accessed is to set CFG[12:10] to 011.

    The “update configuration during sequence” part has been discussed in the Channel Sequencer section of the datasheet. 'Note that while operating in a sequence, some bits of the CFG register can be changed. However, if changing CFG[11] (paired or single channel) or CFG[9:7] (last channel in sequence), the sequence reinitializes and converts IN0 (or IN0/IN1 pairs) after the CFG register is updated.’ i.e. any time you write CFG[9:7] = 11 or CFG[9:7] = 10 to the sequencer bits, the sequence will reinitialize back to IN0, even if you had just written it.  In the update configuration during sequence mode, when you write CFG[9:7] = 01, you are allowed to change other settings (except paired or CH#) without reinitializing the sequencer.

    If CFG readback is enabled, the CFG register associated with the conversion result is read back MSB first following the LSB of the conversion result.

    CFG[5:3] setting is on Table 12. If set to 010, the internal buffer is disabled and in this case, no connection is required on the REFIN pin. See figure 33 of the datasheet. The AD7682 output data will be referred to the selected reference on CFG[5:3] = 010 or 011, so the temperature sensor can still be used here.

    The temperature sensitivity of 1mV/deg C (typical) means that the AD7682 temp sensor output responds to an increase (or decrease) of 1 deg C with a corresponding increase (or decrease) of 1 mV. You should note that this is typical and not a guaranteed spec. Please see this thread for more information: http://ez.analog.com/thread/17920.

    Hope this helps.

    Regards,

    Karen

  • Hi Karen,

    Thanks for the response.  I have two follow up questions. 

    So if I want to individually select the conversion source (not use the sequencer) I would write bits [12:10] of the config reg with 111 and bits [9:7] with the appropriate value when selecting a single ended input for conversion, while bits [12:10] would be written with 011 and bits [9:7] are "don't care" when selecting the Temperature sensor for conversion? 

    A more accurate phrasing of the readback question is with what SPI transfer would the readback data be available (after the conversion data is transferred) if the extra 14 clock periods were supplied - the SPI transfer when bit 0 of the config reg is written with 0, or the following SPI transfer?  Another way of asking the question is if I supply the extra 14 clock periods starting with the SPI transfer when bit 0 of the config reg is written with 0 will I see the readback data, or is availability of readback data delayed until the next SPI transfer?

    Thanks,

    Glenn

  • 0
    •  Analog Employees 
    on Mar 16, 2013 6:49 AM

    Hi, Glenn.

    Regarding your first followup question, what you said is correct. To individually select a channel from which to read conversion results without using the sequencer, write bits [12:10] of the config reg with 111, bits [9:7] with the appropriate value when selecting a single ended input for conversion, and bits [2:1] with 00. To select temperature sensor, bits [12:10] would be written with 011 and bits [9:7] are "don't care".

    As for the second one, In order to readback the contents of the CFG register, you have to provide an extra 14 SCK as shown in the figure 37 (RAC mode), so, you will need a total of 30 SCK falling edges to return SDO to high-Z. No additional SOC (CNV rising) is required to readback the current result for DATA (n) after EOC (n). In this case, the MSB of the CFG register associated with the conversion result will directly follow the LSB of this conversion result. You should note though that there is always a one deep delay when writing to the CFG register. This is further clarified in the timing diagram on this thread: http://ez.analog.com/message/71879#71879.

    Regards,

    Karen