Skip to main content
Associate III
January 29, 2026
Solved

Should I turn off the microcontroller when I write code?

  • January 29, 2026
  • 5 replies
  • 297 views

When I write code, should I keep the microcontroller on, or turn it off and only turn it on when I want to test the code?

Best answer by mfgkw

This will make no big difference.

 

If you run it from battery you can save its capacity (especially if you have a LCD connected).

Besides of that there is a really small impact on your personal CO2 footprint, depending on how long you code.

 

Regarding the MCU's expected life time it will exceed my remaining lifetime by far.

So who cares?

5 replies

mfgkwBest answer
Associate II
January 29, 2026

This will make no big difference.

 

If you run it from battery you can save its capacity (especially if you have a LCD connected).

Besides of that there is a really small impact on your personal CO2 footprint, depending on how long you code.

 

Regarding the MCU's expected life time it will exceed my remaining lifetime by far.

So who cares?

mƎALLEm
Technical Moderator
January 29, 2026

Hello,

Not sure to understand what do you mean by "turning off the microcontroller when I write a code"!

Do you mean powering-off the MCU after flashing the application to your MCU or during the flash operation? "when" is confusing here.. Please provide more details of the application scenario and why.

Please review How to write your question to maximize your chances to find a solution

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question."
Lead II
January 29, 2026

I often make small code changes while debugging. Of course breakpoints etc. won't align if you insert lines, but for small changes that's not a problem. Of course the changes are not applied until you build and flash.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
Andrew Neil
Super User
January 29, 2026

As the others have said, it's not at all clear what you mean here!

By "writing code", do you mean typing stuff into your editor/IDE ?

Typing into the editor and building ("compiling") have no interaction with the target (your microcontroller) at all - so it is entirely immaterial whether the target is on or off.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
mƎALLEm
Technical Moderator
February 4, 2026

@cockatoo 

Could you please state on this thread please?

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question."
Andrew Neil
Super User
February 11, 2026

@cockatoo you never did explain what you actually meant by the question - several contributors pointed out that it is ambiguous, and asked you to clarify this.

The answer would make more sense if we knew for sure what the question really meant!

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.