The Right Tools For The Job

We’re knee-deep in new microcontrollers over here, from the new Raspberry Pi Pico to an engineering sample from Espressif that’s right now on our desk. (Spoiler alert, review coming out Monday.) And microcontroller peripherals are a little bit like Pokemon — you’ve just got to catch them all. If a microcontroller doesn’t have 23 UARTS, WiFi, Bluetooth, IR/DA, and a 16-channel 48 MHz ADC, it’s hardly worth considering. More is always better, right?

No, it’s not. Chip design is always a compromise, and who says you’re limited to one microcontroller per project anyway? [Francesco] built a gas-meter reader that reminded to think outside of the single-microcontroller design paradigm. It uses an ATtiny13 for its low power sleep mode, ease of wakeup, and decent ADCs. Pairing this with an ESP8266 that’s turned off except when the ATtiny wants to send data to the network results in a lower power budget than would be achievable with the ESP alone, but still gets his data up into his home-grown cloud.

Of course, there’s more complexity here than a single-micro solution, but the I2C lines between the two chips actually form a natural division of work — each unit can be tested separately. And it’s using each chip for what it’s best at: simple, low-power tasks for the Tiny and wrangling WiFi on the ESP.

Once you’ve moved past the “more is better” mindset, you’ll start to make a mental map of which chips are best for what. The obvious next step is combination designs like this one.

16 thoughts on “The Right Tools For The Job

  1. “ATtiny13 for its low power sleep mode, ease of wakeup, and decent ADCs…”

    I dunno, a 10b ADC with 8 to 9 ENOB having dubious input Z might be “decent” if you are not doing much with a small-range hi-Z DC input signal.

    And to be the cranky contrarian, multiple processors may just increase complexity, increase costs, and decrease reliability. For low-power designs, I tend to use TI stuff. Where I need ‘complex’ I/O, tend to either go to an M0 or M4, or just use a specialized IC via I2S/I2C/SPI.

    1. You don’t get precise ADC in general-purpose chips because those are still treated as munitions in certain jurisdictions. IMO both AVR, STM and PIC microcontrollers will soon be replaced by RISC-V chips because it’s libre-hardware and can be manufactured by anyone without having to deal with ITAR or other export restrictions.

      1. Oh bull hockey puck. ITAR affects ADCs rated for −54 °C to above +125 °C AND hermetically sealed. There are other general considerations for modules or components. There are hi-performance 24b ADCs not subject to ITAR.

    2. Separation of functionality Decreases complexity. Components can be treated separately. Effects of modifications are limited in scope. Efforts can be more easily divided among workers. All in all it is a big win for the quality of the finished product. Its common practice in every industry.

      1. Telcordia SR322 and Mil Hdbk 217 would would not agree.

        And having done 20 years of designing and conducting HALT, HASS, and ESS test programs, I am inclined to agree with these generic and relativistic predictions of reliability.

      1. Looked good to me. I did the same back in 2015 – the ESP is far too power hungry to be left on, and an attiny can’t do WiFi. In retrospect, I should’ve gone with a MSP430, but the principle still holds. I also had a socket for a NRF24L01 as an alternative to the ESP, but the ESP won out.

        1. The point is, there is probably a chip that does wifi AND proper power saving at the same time, so the ESP was the wrong tool for the job in the first place and the ATTiny was just a hack on top to make it wor.

          1. If so, name it. There certainly wasn’t back then. BLE was the only similar option, but there were no commodity modules at a comparable price to the ESP. While I would agree the ESP was lacking in low power mode (and said it several times on here), this was there only way around the problem at a sensible price point.

Leave a Reply to Dude Cancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.