What is the sequence of events when switching between channels for the AD779x ?
Every sequence of events with this converter commences with a write to the communications register to specify the next operation. The sequence of events for a channel switching operation using the AD779x is as follows (channels AIN1(+) – AIN1(–) and AIN2(+) – AIN2(–) being used). The operating conditions for both channels are gain = 1, buffer on, bipolar mode; external reference applied between REFIN1(+) and REFIN1(–) is reference source for the ADC. The AD779x is a 24-bit part. Every sequence of events with this converter commences with a write to the communications register to specify the next operation to be performed. When the specified operation is complete, the interface defaults to waiting for the next instruction.
Write 0x10 to communications register: This specifies that the next operation is a write to the configuration register.
Write 0x0010 to configuration register: This configures the AD779x for the above gain, polarity, and reference source and selects Channels AIN1(+) – AIN1(–).
Write 0x58 to the communications register: This specifies that the next operation is a write of the data register.
Poll DOUT/RDY: Poll the DOUT/RDY pin to determine if valid data is available in the data register. When DOUT/RDY goes low, apply 24 serial clocks to clock the data from the ADC. A read should not be initiated when DOUT/RDY is high.
Write 0x0011 to configuration register: This configures the AD779x for the above gain, polarity, and reference source and selects Channels AIN2(+) – AIN2(–).
Continually running through this loop will allow data to be read from each of the channels continuously.
I'm using your sequence of event to read channels AIN1 and AIN2 each 500ms.
When reading value I have a permutation of channels, AIN1 has the value of AIN2 and AIN2 has the value of AIN1 ?
What could be wrong ? I'm using Continuous Conversion Mode.
Thanks for your help
I apologize for the late response.
First of all, I’d like to do a minor edit on the sequence stated above. In the portion where 0x58 is written to the communications register, It should say “read to the communications register” rather than “write to the communications register”.
About the problem encountered, I suspect that there could be an error to the timing of when the data is being read. It could either be that the read is initiated too early or too late.
Please take note that a valid data on a specific channel is available when the DOUT/RDY pin goes low. After this, a read can be done by clocking in 24 clocks to read the data on the ADC. When the read on the data register is done, the DOUT/RDY pin goes high. The data can still be read several times even when DOUT/RDY pin is high.
With that, when a read is initiated too early(reading the data before the DOUT/RDY pin goes low) It is possible that the data being read is the data from the previous conversion instead of the data from the current conversion. Since we are using two channels, It could mean that instead of reading the data on one channel, we could actually be the reading the data from the previous channel. Thus the permutation.
Hope this helps.
Thanks and Best Regards,
Retrieving data ...