Re: help about AT89s5x
What is your application? I mean, what does your microcontroller do? Does it drive DC motors? Does your circuit have relays? Does it need high current? Make sure your power supply can deliver enough current.
Noise on Vcc and ground tracks do exist, causing the micro to sometimes get 'hang'. To minimize them, give enough power supply current, make larger track widths, separate high current ground tracks from the ground tracks for digital circuitry part.
Try putting a decoupling capacitor (100nF) near the Vcc pin of every digital IC's, including your microcontroller. Check your PCB for bad soldering. From my experience, when you are very sure that your program is OK, the problem usually comes from hardware.