If the microcontroller is having issues, first check the power supply. There may be a problem with the power supply. Use a multimeter to check the power supply voltage of the microcontroller; it is best to use an oscilloscope to capture the voltage waveform because the voltage may be unstable (for example, voltage drops can cause the microcontroller to reset abnormally or communication issues). If the power supply chip outputs abnormally, first check if there is a short circuit between VCC and GND (because if the circuit is shorted, the power supply chip is likely to go into overcurrent protection, resulting in incorrect power supply).

Check if the reset pin is correct. Some chips have high-level reset, while others have low-level reset, which needs to be noted. Check if the reset pin voltage is abnormal. If the chip has a low-level reset, and the reset pin is pulled to ground due to soldering or component issues, then the chip will remain in a reset state and cannot work normally.

When using an external crystal oscillator, if the above checks are correct, then check if the crystal oscillator is oscillating normally. Sometimes the crystal oscillator may not oscillate correctly. If the crystal oscillator is not functioning, the chip will be like a heart that does not beat, and it will not work properly. Generally, there is a main crystal oscillator for the chip’s main peripherals and clock, and another 36.768kHz crystal oscillator used for 15 division (1Hz) to serve as a real-time clock.

Lastly, check the program to see if there is an infinite loop written. This requires connecting a debugger for analysis, and this part requires cooperation with software colleagues to analyze if there is an infinite loop in the program. If the program is stuck in an ignored infinite loop, such as within a while loop, then the program will continue to run inside the while loop and cannot exit, which also manifests as the microcontroller working abnormally.