Skip to content

Test: Interfacing to ADCs safely (op-amps, clamps and filters)

ADC front ends

Interfacing to ADCs Safely: Op-Amps, Clamps and Filters

What the ADC sees: full scale, bits and the LSB

An ADC compares its input with a reference and reports a whole number. The BeagleBone Black’s AM335x has a 12-bit ADC whose reference is VADC, 1.8 V: 4096 codes, so one code (the LSB) is 1.8 V / 4096 = 0.44 mV. The input must stay between 0 V and 1.8 V, and on the BBB that limit is an absolute maximum for the pin, not only the top of the range. The Raspberry Pi has no ADC; in step 8 an MCP3208 on SPI gives it 12 bits with a 3.3 V reference. Change the ADC, the bits and the signal, and watch the codes.

Challenge: Fit the signal into the range: use at least 90% of the codes with nothing clipped.

Reference

The voltage that reads as full scale. Code = 4096 × Vin / Vref.

BBB: VADC = 1.803 V

LSB (one code)

The smallest step the ADC can resolve: Vref / 2^bits.

0.440 mV at 12 bits

Absolute maximum

Beyond it the pin is damaged, not only clipped. Keep the signal inside it at all times.

BBB: 0 V to 1.8 V

Signal at the pinWhat the ADC reports (12 bits, as a voltage)
-0.500.511.522.53 V00.511.52time (periods of the signal)1.8 V: full scale and absolute maximum
0codes 227 to 2953 (12 bits)4095
← Start here

Pin voltage

0.10 to 1.30 V

Codes used (12 bits)

2727 (67%)

Reading at the peak

2953

Reading = floor(4096 × 1.300 / 1.803) = 2953 at the peak. Fewer bits in the trace show the staircase; the statistics stay at 12 bits.