Hi,
I tried inserting the suggested 125mS delay for 8-sample sampling and added a very crude RDY pin handler. I'll ask mm-fisher if this is correct or if he suggests something more suitable. Testing on two channels seems to work well.
Attached are two samples: Neither use the component (sorry) - but one shows how to use an interrupt to read the ADC when conversion is complete (and reads channels 1-4) (it uses a pin change interrupt on the rdy pin to signal to the program that the conversion is complete) , and one constantly reads the status register - and reads the value when the flag bit is set. (the handling of the gain is a bit inelegant - and should probably be stored rather than sent to setup reading and conversion to volts)
Your code busy waits on the rdy pin - but it needs to do this before reading the sample - then request a second channel - and wait again.
You can use a delay - depending on the sample rate set - the component used to use a 10ms delay (at 128 samples per second) - hence the code as needed to sample at 860sps...
Data Rate (SPS) Single Conversion Time
8 125 ms
16 62.5 ms
32 31.25 ms
64 15.63 ms
128 (Default) 7.81 ms
250 4.0 ms
475 2.1 ms
860 ~1.16 ms