32 lines
1.2 KiB
Markdown
32 lines
1.2 KiB
Markdown
# Why are there two microcontrollers?
|
|
|
|
Cost and ease of development.
|
|
|
|
Both ESP8266 and ATTINY(2/4/8)5 modules can be had for around \$1 each, and
|
|
there are retail programming jigs available. I have a kid now and don't want to
|
|
spend my time making a programming board.
|
|
|
|
The ESP8266 alone cannot really wake from multiple sources and know trap the
|
|
source of the interrupt- there is only one pin that can wake up the micro from
|
|
deep sleep, and that same pin needs to be used if you want to use the RTC as a
|
|
wake source. Sure, you could use an OR-gate and also wire each source to a GPIO,
|
|
but you might miss the source by the time the ESP wakes up to check the pins.
|
|
|
|
Hence, the ATTINY is used to capture the wakeup and inform the ESP8266, who does
|
|
the heavy lifting.
|
|
|
|
## What about ESP32?
|
|
|
|
The cheapest modules I can find at the time of writing are around \$3.50 apiece,
|
|
and they can be power hungry (spikes up to 750mA compared to 400mA, from what I
|
|
read).
|
|
|
|
## What about ESP32-S2?
|
|
|
|
They appear promising and are only \$2 per module on Digikey at the time of
|
|
writing, however they are not supported by platformio yet.
|
|
|
|
## What about ...?
|
|
|
|
I probably wasn't aware that it exists.
|