> These are cheap, relatively fast, and not particularly good. While they sport impressive-sounding 12- and 16-bit readouts, the effective number of bits (ENOB) is usually around 8 or 9.
I don't think that's quite accurate for reasonably modern MCUs. You can typically shake 10+ bits out of them, but you need to take a lot of precautions, such as providing very stable external reference voltage and shutting down unneeded subsystems of the chip.
They're still not as good as standalone ADCs, but they're at a point where you can actually use them for 90% of things that require an ADC.
In cases where you need more bits, there's a lot more that must go into the design, which is what gives me a pause about the article. There's nothing about the PSU the author is using or how he managed the MCU noise and RFI. So I don't know if the findings here are that these are knock-off devices with worse specs, or if his overhead LED lamp is causing a lot of interference.
I think you might both be right- the author may be thinking of lower cost MCUs only aiming for tolerable ADC performance, while you might be thinking of all MCUs, even higher cost.
The RP2350 has 9.2 ENOB on a 12 bit ADC. Sure, you might be able to decimate multiple samples to get more bits out of them, but the spec sheet supports the author's claim (https://www.raspberrypi.com/documentation/pico-sdk/hardware....). There are even lower cost MCUs like the CH32V003 that have even worse ADC performance.
On the other hand, some MCUs can definitely do 10+ bits, such as the STM32H7 line which gets 13+ ENOB from a 16 bit ADC. This is impressive, but the H7 MCUs are literally an order of magnitude more expensive than the RP2350, so they might not be something the author tinkers with much.
https://www.st.com/resource/en/application_note/dm00628458-g...
Hey, you can also arrange 2 GPIO pins in 1st order sigma delta topology with two external resistors, a capacitor and disabled hysteresis.
With RP2040 (and an LDO for supply), using two such channels for pseudo differential measurement (the second one just tracks threshold noise) I typically obtain 16 ENOB at 1 kHz, more at DC.
It is critical to avoid any periodic activity on the chip, though. Putting cores to sleep and then waking them up again causes huge spurs. One has to e.g. sleep for random intervals to spread them around. Same with flash. USB can be used, it's noise doesn't normally exceed -100 dB for me.
Fun stuff!
PS: I have not tested DC accuracy. One would likely use a channel with reference and hope that GPIOs are well matched. Could be used to e.g. sense CC lines on USB or analog joysticks and other non-critical, low accuracy stuff.
Can you post any resources for understanding this? I have basic understanding of circuits.
Is this essentially trading time resolution for voltage resolution? Would just doing an exponentially weighted moving average in firmware achieve the same results?
I tested a few STM32F103 dev boards, using a Siglent SDM3055 multimeter and Siglent SPD330X power supply.
The chip has a 12bit SAR ADC. Layout and board design mattered a lot, but even the worst ones had 10 bits worth, and the best one had nearly 12 bits effective.
That was without doing too much on the software side, meaning the other modules weren't running, besides a single serial output. On the bad boards the serial affected it, but on the good board very little.
I was planning on using (genuine) ADS1115s for a project but ended up going with an STM32g071 instead. It was cheaper, easier to source at the time (surprisingly) and much more flexible. The newer STM32g/h series ADCs have fewer hardware/software footguns than the old f103 et al.
The paragraph ending with "Compare that with a microcontroller ADC with a fixed 3.3 V range: 9 ENOB steps are ~6 mV" also seems to insinuate that no MCU has an analog reference that's independent from the supply, which just isn't true at all. Hell, NXP has a few that have a built-in programmable reference.
I don't think that's quite accurate for reasonably modern MCUs. You can typically shake 10+ bits out of them, but you need to take a lot of precautions, such as providing very stable external reference voltage and shutting down unneeded subsystems of the chip.
They're still not as good as standalone ADCs, but they're at a point where you can actually use them for 90% of things that require an ADC.
In cases where you need more bits, there's a lot more that must go into the design, which is what gives me a pause about the article. There's nothing about the PSU the author is using or how he managed the MCU noise and RFI. So I don't know if the findings here are that these are knock-off devices with worse specs, or if his overhead LED lamp is causing a lot of interference.