Has anyone successfully used an AS1526 ADC with a particle device before.
We are having some trouble getting started with this ADC. We are attempting to use the following library:
Some considerations, our device connects to the ADC (CS pin and DRDY pin) through an I2C so I have updated the ADS library code that toggles the CS select and reads the DRDY pin. The MISO, MOSI and SLK pins connect to D11, D12, and D13 on our BSOM.
We are trying to use the simple_begin_status example from the above repo. We are having trouble getting the ADC status to read 1.
We are using a Vref of 4.5 rather than 2.5 and a crystal of 8MHz.
Can anyone give me some pointers on how to troubleshoot this? Or had anyone successfully used this ADC?
I presume you're using a I2C to GPIO converter like a MCP23008 for the CS line. Assuming it's implemented correctly, that's fine. We do that on the Tracker, though we use an SPI version of the chip. Make sure you clear the CS pin after SPI.beginTransaction() and set it back to 1 before SPI.endTransaction().
Are you able to read any registers? Try reading the MUX register (0x01). If you get back 0xff you're not successfully communicating by SPI so look there first.
Also just to be sure:
DVDD (digital VDD) is 3V3 (3.3V)
VREFP is 4.4V as you said
VREFN is GND, presumably
What's AVDD connected to? That must be in the range of 4.75 to 5.25V. Does your B SoM base board have a 5VDC power supply, or if battery powered, a boost converter?
What are you passing to SPI.begin() since you're not using a hardware GPIO for CS? It must be set to PIN_INVALID in order to function properly.
The best way to troubleshoot this is a logic analyzer that does SPI decoding. I use the Saleae Logic 8 for things like this.
I am attempting to read the MUX register (0x01) with the below code. I don't have serial access to the device until later today. The response from the particle publish below is readRegister: 0x00
EDIT (for the benefit of anyone else that may have trouble with this ADC): So there was a wiring issue regarding the SYNC pin on the ADC. I think this pin could have been held low for too long as a result of the issue, which causes the ADC to power down.
Since fixing we have moved back to the library from my first post and are able to successfully read from the status and MUX registry. Still having some trouble getting readings from the channels, but I believe this may be a timing issue.