If the LED is dimmed via PWM it's essentially blinking at a fast rate (faster than the eye can see), so if the CPU were to hang, and software PWM is used, the LED would either get stuck on full brightness or off.
That's not a 100% reliable indication of system stability, however. Depending on the nature of the failure the PWM loop could still be running but other functions stop working, or vice versa. Or PWM may be implemented in hardware or in a CPU peripheral that keeps working even if the main CPU hangs. A good design uses a watchdog timer to reset the CPU if it hangs (another feature built into most microcontrollers).
Pressing a button is a better way to know "for certain" that the system is functioning correctly.






Reply With Quote
Connect With Us