Hacker News new | ask | show | jobs
by duskwuff 2006 days ago
> You cam probably beat an ATMega with a STM32 of some kind.

You can run Linux directly on some STM32 MCUs. No emulation required!

https://github.com/torvalds/linux/tree/master/arch/arm/mach-...

That being said, static operation is really less of an issue than you're implying. Modern MCUs can idle (not sleep!) at under a milliamp; it's not difficult to get them to draw less average current than the leakage current of their battery. The lack of 5V operation is a little annoying in some scenarios, but is easily worked around with a 3.3V LDO -- which is frequently required anyway for interoperability with other components. (A switching converter is hardly necessary for a USB device drawing a couple milliamps.)

2 comments

> it's not difficult to get them to draw less average current than the leakage current of their battery.

Well... depends on the battery. A bog-standard AA Alkaline battery has 2500 mA-hr (from 1.5V to 1V, @100mA draw: https://data.energizer.com/pdfs/e91.pdf), and have a ~3%/year self discharge rate. That's a leakage current of 75mA-hrs / year, or ~10 uA if I did my math correctly. Lithium, and watch button batteries (Silver) leak even less!

ATTiny 1607 is specified at 6uA at 1.8V @ 32kHz active mode (though 5V barely is any more current). It looks like STM32G031J4 is ~20 uA at "low-power mode" @ 1.8V 32kHz (a special mode below 2MHz). Which is a lot better than I was expecting. (Note to others who may not know this: this is likely a Cortex-M0+ design only. Typical ARMs will not be able to reach this low level of power. Heck, larger STM32 Cortex-M4 processors probably have a much higher minimum clockrate)

Both chips are ~200 uA at 2MHz, Which gets you to ~500 days of continuous operation from 2500 mA-hr AA.

------

Yeah, there's a bunch of batteries that self-discharge in just 3-months. But... alkaline AA exist for a reason! Low-self discharge, and they're actually really good at these milliamp/microamp levels of current. And again, its all about those silver-watch batteries or lithium-watch batteries if you really want the lowest self-discharge in the market. (~5 years per silver-watch battery, but you need to draw stupidly low amounts of current).

It seems like the ATTiny 1607 still has a superior sleep mode compared to STM32G031J4, so if you're sleeping most of the time on a watch battery, maybe ATTiny wins.

I do agree with you though: it does seem like STM32 has really dropped their power down a lot. I don't know if STM32 always supported 32kHz clock rates however, I seem to remember them having a higher minimum clock rate last time I checked this out. Lowering those clock speeds really helps at minimizing power. And I expect AA-batteries to be the typical size of most people's hobby projects.

I dunno if "full static" is really needed, since 32kHz is still really, really low power. It seems nice that ATTiny / ATMegas hve 0Hz as an option (maybe if an external temporary clock turns on only occasionally in a power-constrained environment).

> The lack of 5V operation is a little annoying

It should be noted many STM32's (if not all, huge family) have 5V tolerant I/O pins, so it's not nearly as annoying as it could be.

they can input 5v, sure, but they cannot output 5v, and that is still a pain. pullups and open-drain only get you so far (not very, if you need fast io)
True. I'm just dabbling so I haven't found this particularly annoying, so just curious what fast 5V I/O devices are still interesting? Display drivers?
WS2812B is a common one. It will accept 3.3V input but marginally (V_IH is too close)