Electronic – Is frequent sleep-wakeup harmful to the electronics

microcontrollerpower

I'm programming a large network of tiny microcontrollers (say around 500 of them, but easily more) that communicate with SPI with a hierarchy of masters (say each master controls 32 of them).

Given these numbers, the power consumption of this network can easily get high and I'm trying to keep that under control. It would be ok if there are very short peaks in current consumption, but it shouldn't last long of course.

I have been thinking of frequently switching to a low power mode any chance I get:

  1. Between SPI transactions: this can be powering down, even to halt mode (which turns off all peripherals) and back up as frequent as a couple of times every 40 ms.
  2. During the SPI transactions: this means powering down slightly (only turn off the CPU) and back up with every byte transfer, e.g. every 2 us during the transaction.

Now I'm a software guy, so my knowledge of electronics when it comes to their electrical characteristics is limited.

My question, can this damage the hardware? Is turning the CPU off and on every 2us unhealthy? What about turning everything off a few times every 40ms?

Best Answer

The hardware itself won't care, but if you're using an external crystal then it will take some time before the clock stabilizes, on the order of tens of milliseconds. If you want quick wakeup then you should switch to using an external oscillator (and possibly clock distribution ICs, if you want to share an oscillator between several to several dozen MCUs) and then configure the MCU to skip as much of the clock stabilization delay as possible.