Fixing the DAC on a Wemos S2 Mini
A post where Steve uses 500 words more than necessary to describe how to improve the DAC on an S2 Mini board.
A delightfully specific post title, and we'll get to it in a moment after some preamblic verbiage.
Preamble
I've decided that 8-bit microcontrollers need to be dead to me. What's the point of persevering with, say, an Arduino Pro Mini, with its lack of power and useful peripherals (not to mention no USB port) when, for the same price, I could be using a more efficient 32-bit offering with both bells and whistles?
For reasons I started going into, then got bored writing (and figured out any potential reader would get more bored than me), my development boards of choice are now the Raspberry Pi Pico and the S2 Mini (ostensibly by Wemos, but it looks like there's many more clones about than originals). Both are crazy cheap - the Pi Pico is £4.30 locally, and I got five S2 Minis delivered from China for just under £12 - super capable and CircuitPython compatible.
Post-preamble
The S2 Mini has two built-in 8-bit DACs in its arsenal, and it was that fact that made me turn my back on the Arduino Pro Mini I'd started a project with. However, Wemos followed the chip manufacturer's designs and a questionable choice made one of the DACs more or less useless. An external pull-up resistor to Vcc on the pin the DAC is tied to means that, instead of a range of (roughly) 0-3.3V, you get a range of 1.65-3.3V on this one. This annoyed me enough to not only try and do something about it, but also document what I did. (Yes, this page is that document.)
Researching a little further, I found that Sparkfun's board with this chipset on has a solder jumper/bridge on the back which allows you to disconnect the resistor on this pin, which allows you to get proper DAC capabilities.
So, with that in mind, it looks as if you can safely remove that resistor and the chip will keep working. Given they were around £2.40 each, I figured it was worth tracking down the resistor and disabling it in some way, and writing off the cost if it went wrong.
How to fix it
Using a multimeter in conjunction with the schematic and the nice hi-res photos of both sides of the board on the Wemos site, I tracked down R4.
And so I removed it with my Micro Nippers, as carefully as possible so as to not hit the capacitor just beside, or leave any debris behind. (There was no way I was going to do that with a soldering iron.)
And now...? Now I have two 8-bit DACs that work identically, and everything else is just as it was. Great success!
TL;DR
To get DAC2 to function normally on a Wemos S2 Mini (and its clones), very carefully use a pair of decent quality side cutters to remove/destroy the resistor circled in the image above, between the USB-C port and the ESP32-S2 chip. I'm not responsible if you break your board, because you're using counterfeit Plato side cutters or something like that. (And sorry for waffling on and on.)