Post Go back to editing

AD777x data read causing adc channel 0 to switch to gain = 1

Category: Hardware
Product Number: AD7770

Hi, 

I had a problem with register 0 getting reset to value = 0 expectantly by my read_sweep function. I found a fix, but would like to understand better why the problem was occurring and if my fix is valid...

Issue:

I'm using the AD7770 with an STM32H7 processor and controlling the adc though SPI. I configure all channels to gain = 8, set up data rates and such and then set and then read back all the registers to make sure they're correct.  I then set the adc to start sampling (SPI_SLAVE_MODE_EN set to true). The drdy line starts toggling as expected and all channels report what I would expect except for channel 0. Channel 0 would give me the correct response for the first sweep, but then would switch to gain = 1 after the first read and all the following sweeps would show a channel 0 result using gain = 1.  Somehow my data read_sweep function was causing register 0 to get overwritten with a 0.

The read_sweep function included writing 0x80 for the first Byte and then all zero's after that while data was read out.  The CS is held low for the whole operation.  The solution to the problem was to instead write out the sequence 0x800080008000 ... (etc.) while data is being read out.  This appears to fix the problem and register 0 is no longer being overwritten.

Questions:

I don't see any indication in the datasheet that what I'm doing is necessary. I assumed that once SPI_SLAVE_MODE_EN  was set to true that writing registers was not possible, and also not sure why the read_sweep function would cause the write to register 0 regardless. Is there any explanation for this behavior?  And does my fix raise any other concerns that I might not be aware?

Thanks for your help