I don't get why anyone would voluntarily use it when there are both Arm and RISC-V 32 bit chips in the same package for essentially the same price
I can buy
PFS122-S08 for $0.08 per IC in batches of per 5 at LCSC, that's all.
As a voltage supply supervisor as shown in my schematic, running a power on sequence, staying quiet until told to shutdown, then doing the shut down sequence, then staying quiet until told to start up, and repeating this from the beginning ad infinitum, the code is really, really straightforward. I wouldn't mind having to write it in assembler, although C would be nicer. To work for this, the MCU does need ADC and to run from a 4V to 5V supply, and have 6 or 7 I/Os (because it would be nice to have separate inputs for "please be on" and "please be off").
Thinking further, a CH32V003F4U6 (RV32EmC) is just $0.28 apiece at LCSC in batches of 5, and would fit even better (easier control lines, optional outputs for error indicators, maybe some I²C/TWI for temp sensors for shutdown due to overheating, or perhaps some kind of battery control with poweroff notification to the SoC before running out). The package is QFN20 (0.5mm pitch), so would be a pretty good practice for hot plate + hot air soldering practice as well. I do have a cheap hot plate (56mm×56mm, 65W USB PD) and a JCD 8898 hot air gun, and LCSC does sell cheap MCUs in QFN packages with 0.5mm pitch I can find OSHW dev boards for, so this might actually be within my reach. With BGAs like NXP MIMXRT1062 (and the SG2000 chip used in the Duo Module), it's not just the soldering, it's also the 6+ -layer PCB design those need that makes me doubt myself.
For the 4.0V–4.2V LDO (to make the ADC readings "absolute"), something like Toshiba TCR2EF41 4.1V LDO in SOT23-5 only cost 0.11€ in singles at Mouser. TI TPS7A2042PDBVR 4.2V LDO costs about 0.32€ at Mouser and $0.24 at LCSC in singles. Both only need ceramic caps (2×1µF, third one for MCU).
For the P-ch MOSFET, PMV30XPEAR in SOT23 is 0.14€ in singles at Mouser, $0.19 in sets of 5 at LCSC: Rds(on) ≃ 40mΩ at Vgs=-3V, and can handle over 3A of current.
For the N-ch MOSFETs, DMG2302UKQ-7 in SOT23 is 0.14€ in sets of 10 at Mouser, $0.14 in sets of 5 at LCSC: Rds(on) ≲ 70mΩ at Vgs=+2.3V, and can handle over 2A of current.
Samsung CL10B105KB8NQNC = 1µF X7R 50V 0603 are something like 0.03€ – 0.06€ apiece, so throw in something like 0.40€ for the passives needed.
By my count, this amounts to a BOM of around 1€ in batches of five or less. Above, I limited myself to SOT23 MOSFETs, because to find the actual Rds(on) at the Vgs used, one has to check the datasheet. I'm sure there are even better+cheaper MOSFETs in other packages.
Is it utter overkill for power sequencing a 6€ – 10€ SoC? I dunno. I like to overengineer things, and relying on timing only (as in LM3881) "feels" iffy to me. Being just a hobbyist, I don't have the sense of what is appropriate/warranted at all.
At Aliexpress, Chipboard Development Store sells
five CV1800B QFN chips for under 30€ including shipping and VAT, so that'd be 6€ apiece.
you could consider using the Duo stamp-like module which has castellated holes, which should be much, much easier to hand solder. Of course, it's bigger than just the SoCs, but it contains a SG2000 (so with 512 MB of RAM), a WiFi/BT chip, and 8 GB of eMMC. For about $10-$12.
Nice! And there are variants without WiFi/BT or eMMC (which I don't really need). I can find these at AliExpress for 22€ – 24€ including shipping and VAT 25.5%, too.
Unless I'm mistaken, the module only requires 3.3V, and handles all the power sequencing and 0.9V and 1.8V rail voltage generation itself within the can.
(I know Arace is cheaper, and I've bought from them, but for some reason the customs here keeps the packages for weeks without telling anyone, even with prior customs declarations and so on (easy to do online here in Finland with the information Arace provides). I do blame Finnish/EU customs/post policies myself.)
The
Duo module 01 pinout says that
XGPIOC[0..21] are exposed (and the
SG2000 does not expose 22..31), which means the full XGPIOC port is an
eminently DMA'ble GPIO port. Theoretically, even for a 22-channel logic analyzer: let the weaker RISC-V core DMA the GPIO pin states at high frequency to a small ring buffer, copying that data while combining duplicates with a counter in the high 10 bits to another buffer for the faster core to consume. I wonder how fast this could sample the pins? Testing this with some NXU0104 dual-supply voltage translators (fast, 0.9V to 5.5V) could be interesting, if one had such needs.. Thus far, I've managed with my el-cheapo Sigrok Pulseview Ez-USB FX2 (8-ch 20 MHz sampling) doodad.
I need to do a LibreOffice Calc sheet of the pins the module and QFN ICs expose, and their alternate functionalities. For example, I already noticed that pin 29 on the Duo Module, SD_PWR_EN, is actually also XGPIOA[14], even though it is not listed in the Milk-V pinout.