Clock Stretch Error
The ADC Differential Pi is an Analogue to Digital converter for the Raspberry Pi
24/07/2018
Posted by:
ssnow
I don't have the best understanding of I2C and how it all works, but after doing some research it seems there is a hardware bug that causes this issue between the Rapsberry Pi and I2C devices that attempt clock stretching... I believe one of the fixes mentioned is to disable clock stretching on the device or increase the timeout? Is there a way to do this on the ADC Differential Pi?
Thanks!
24/07/2018
Posted by:
andrew
Do you have a spare Raspberry Pi you could use to test the ADC Differential Pi to make sure it is not a problem with the I2C bus? It may also be worth making sure that your Window IoT is fully updated as there was a problem with one of the preview releases last year that caused the I2C to fail on the Raspberry Pi.
25/07/2018
Posted by:
ssnow
Thank you for the quick response! I guess we can rule out clock stretching as the cause of the problem. I have multiple RaspberryPis equiped with ADC Differential Pis. Some work continuously but others seem to just stop communicating at random. The Windows IOT Demo Application can't even communicate with the board. So far it's happened on multiple versions of Win IOT Core, even the latest update that was pushed a few days ago. Usually our fix is to just replace it with a new Differential board and everything starts working again so this leads me to believe the Pi and Win IOT are functioning properly.
Could something be getting "stuck" or "frozen" on the Differential board itself that would cause it not to communicate? I've been monitoring the voltage coming off of our sensors and into the Differential board and I haven't seen anything above 60 mV. Any help is appreciated!
Thanks!
25/07/2018
Posted by:
andrew
The ADC Differential Pi class has a timeout variable which keeps checking the ADC to see if a sample is ready and it could be possible that for some reason the ADC is not reading a sample before the timeout occurs which may be causing the program to hang.
In the ABElectronics_Win10IOT_Libraries folder, there is an ADCDifferentialPi.cs file which contains the class and methods for the ADC Differential Pi. On line 252 is the timeout variable.
var timeout = 10000;
You could try increasing the timeout value and recompiling the dll to see if that has any effect on the stability of your program.
One way to work out if it is a software or hardware issue would be to set up a separate SD card with Raspbian Linux and try using one of the readvoltage demo in our Python library to see if that can read from the ADC Differential Pi without failing.
25/07/2018
Posted by:
ssnow
Thanks!
25/07/2018
Posted by:
andrew
27/07/2018
Posted by:
ssnow
Thank you so much for pointing this out. I would guess this is likely the cause of board failures. Currently reconfiguring the project so that sensors can only be powered when the Pi is powered.
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.