I have 2 identical ADS131M08 circuits. Individually the circuits works fine, I am able to READ/WRITE registers and able to read the data just fine. When i stack them though i have to synchronize both devices. Here is where the problem is, I am still able to read/write register to either of the devices but im having trouble getting feedback for my software that they are synchronized. From what i know bit14 of the status register is what i have to check if a synchronization occurs. but it seems i could not get it to set
I am running on a 8.192Mhz MCLCK. I have tried several sync pulse length and still i could not get it to set ( even the recommended 1-2047 CLKIN cycles )
Here is the code i am using
void testSYNCH(){ uint16_t content = readSingleRegister(&device1,STATUS_ADDRESS); if((content & 0x4000) == 0x4000){ printf("%s - Synchronization SUCCESSFUL. %04X \n",device1.id,content); } else{ printf("%s - Synchronization FAILED. %04X \n",device1.id,content); } content = readSingleRegister(&device2,STATUS_ADDRESS); if((content & 0x4000) == 0x4000){ printf("%s - Synchronization SUCCESSFUL. %04X \n",device2.id,content); } else{ printf("%s - Synchronization FAILED. %04X \n",device2.id,content); } } int main() { init_adc_device(&device1); init_adc_device(&device2); adcStartup(&device1); adcStartup(&device2); writeSingleRegister(&device1,MODE_ADDRESS,0x0111); writeSingleRegister(&device2,MODE_ADDRESS,0x0111); gpioTrigger(5,1,0); // 1 microsecond testSYNCH(); gpioTrigger(5,5,0); // 5 microsecond testSYNCH(); gpioTrigger(5,10,0); // 10 microsecond testSYNCH(); gpioTrigger(5,20,0); // 20 microsecond testSYNCH(); gpioTrigger(5,50,0); // 50 microsecond testSYNCH(); gpioTrigger(5,100,0); // 100 microsecond testSYNCH(); gpioTrigger(5,250,0); // 250 microsecond testSYNCH(); gpioTrigger(5,500,0); // 500 microsecond testSYNCH(); gpioTrigger(5,1000,0); // 1000 microsecond testSYNCH(); gpioTrigger(5,5000,0); // 5000 microsecond testSYNCH(); }
The code yields me
Device 1 - Synchronization FAILED. 0100 Device 2 - Synchronization FAILED. 0100 Device 1 - Synchronization FAILED. 0100 Device 2 - Synchronization FAILED. 0100 Device 1 - Synchronization FAILED. 0100 Device 2 - Synchronization FAILED. 0100 Device 1 - Synchronization FAILED. 0100 Device 2 - Synchronization FAILED. 0100 Device 1 - Synchronization FAILED. 0100 Device 2 - Synchronization FAILED. 0100 Device 1 - Synchronization FAILED. 0100 Device 2 - Synchronization FAILED. 0100 Device 1 - Synchronization FAILED. 0100 Device 2 - Synchronization FAILED. 0100 Device 1 - Synchronization FAILED. 0100 Device 2 - Synchronization FAILED. 0100 Device 1 - Synchronization FAILED. 0100 Device 2 - Synchronization FAILED. 0100 Device 1 - Synchronization FAILED. 0100 Device 2 - Synchronization FAILED. 0100
I am constantly getting 0x0100 on the status registers (bit14 is 0)
Now it might be important but, I think the signals do look to get synchronized but i could not reliably reproduce this. I was getting 4200 samples for a 1 second run which led me to believe that they are synchronized else i would have gotten more.. I would like for my software to have something of an indicator that both device were truly synchronized
Before Running the program (Power was cut)
After running the program
Ay help on solving this problem would greatly be appreciated. Please let me know if you need more information on a specific portion.