Bus Pirate “Ultra”: using ADS7042 12bit Analog to Digital Converter from the FPGA

Beginning with Bus Pirate “Ultra” prototype v1d, all analog measurements are handled by the FPGA using an external serial Analog to Digital Converter chip. This lets us pipeline ADC measurements into the command queue so that bus interactions can be done with very precise timing.

ADS7042 pins. Source: ADS7042 datasheet page 6.

We’ll be using Texas Instruments’ series of tiny ADCs with a max speed of 1MSPS: the ADS7041 (10bit) and ADS7042 (12bit). For the prototype we went with the 12bit version, but availability and final BOM price will dictate what goes into the final design.

ADS7042 sampling interface timing. Source: ADS7042 datasheet page 10.

The ADC uses a dead simple three wire interface that resembles SPI without a Master Out Slave In connection. CS falls, the first two clock ticks are 0, then the next 12 bits are the analog voltage measurement. We stripped down a copy of our Verilog SPI peripheral to drive the chip, the current source is here.

ADS7042 calibration interface timing. Source: ADS7042 datasheet page 24.

There are two methods of calibrating the ADC. Offset calibration can be done immediately after power up by sending 16 clock ticks, however it’s risky to depend on the ADC being in the reset state. Calibration can also be done at any time by sending 32 clock ticks, which is the method we used.

Bus Pirate “d” command retrieves the ADC value through the FPGA

This is a very basic test that retrieves the raw ADC value from the FPGA while measuring the programmable output power supply voltage.

In the final revision, absolutely every aspect of the Bus Pirate hardware front end will be controlled from the FPGA:

  • IO pins (added in v1a)
  • Logic analyzer and SRAMs (added in v1a)
  • Analog voltage measurement (added in v1d)
  • Pull-up resistors (added in v1d)
  • Programmable output power supply (to be completed in v1e)

It’s possible we might use a 3.0volt reference for the analog section on the next revision. Currently we can measure 0-6.6volts with a divide-by-two resistor divider and a 3.3volt referent. A 3.0volt reference gives a 0-6volt measurement range, which increases the resolution over our target range of 0-5ish volts and might mean we can use a cheaper, lower resolution ADC. The Digital to Analog Converter used in the power supply has almost no noise rejection, so a dedicated reference voltage would help ensure clean DAC output as well.

Leave a comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.