I made simple code for the microcontroller that prints a simple message on the LCD once the microcontroller starts. I arranged my board so that the pull-up resistors and reset resistor (100K) and capacitor (0.1uF) goes inside the DIP socket and I included a 0.1uF decoupling capacitor there as well.
Due to the PCB design, I added jumper wires with ferrite beads on them from regulated +5VDC to the micro's VCC.
I also went crazy with capacitors. I used one 470uF decoupling electrolytic capacitor as the main power reservoir and near that I added a 0.047uF capacitor.
I made the power planes as large as possible and labelled them on the board as + and -.
The crystal is 20Mhz with 33pF pull-down capacitors.
Everytime I attempt to start the microcontroller normally, no code is executed (I get indeterminite output), and the LCD is never initialized.
However, everytime I temporarily add a 22uF capacitor and hold it to the power planes under the microcontroller while powering up the circuit, the code gets executed and the correct message is on the display. So then I soldered the 22uF capacitor in the same spot, tried powering everything normally, and I get nothing.
Is there something my fingers are doing to make the circuit work? (static or something?) This really baffles me.
And would my problem be eliminated if I cut the crystal speed in half?