Micro-controller Hang

Problem – Code is perfect but still controller hangs

Solution 1- Put 0.1 uF disc capacitor as close as possible to VCC and Ground pin on Micro Controller. If possible solder it directly on to the relative pins.

Solution 2- Avoid use of crystal oscillator and use internal oscillator