16x2 LCD showing 2 rows of blocks

Hi, this is yet another question about LCD displays. I have been searching all over and I do not quite get a problem similar to my problem. I did follow a lot of advice found here and elsewhere, but my problem keeps coming back.

Problem:
When the LCD is turned on and the sketch has to run, the LCD shows 2 full rows of blocks.

Equipment:
LCD - Displaytech 162D http://za.rs-online.com/web/p/products/532-6492/

Approach:
I first started out on a breadboard. And please note, then it did work correctly. I had it displaying “Hello World” and counting the seconds. This proves to me that I have made a mistake and I can not figure out what and where. I soldered a 7x2 header onto the LCD and used jumper Wires to connect to the breadboard and Arduino. Because I am building a replacement timer switch for a dishwasher that got discontinued, I started to build a custom board using vero board and a schematic from an arduino duemilanove where I stripped it down to a bare minimum setup. Basicly only the Atmega, a reset button, the 16K crystal, the caps for the crystal, and the power rails and an LED on pin 13, thats it. Then I connected the Header for the LCD according to the Ladyada tutorial for an LCD of that type with 2 rows of 7 pins. I then popped out the Atmega from the arduino and popped it into my custom board and gave it a kickstart, and no show. I did not even turn the POT when I removed it from the breadboard and soldered it to the vero board.

My Diagnostics:

  • If I remove the Atmega and start the board without the micro-controller, I get the expected single row of blocks, showing that the logic has power and that contrast is set correctly.
  • If I remove the LCD and program the Atmega with the “Blink hello world” the LED on pin 13 starts to blink on my custom board as expected, showing that there is a good chance I have the basics correct to start the Atmega on the custom board.
  • I used another Atmega micro-controller with the same result.
  • I used another LCD with the same result.
  • I saw I was using a 1K pot and not a 10K pot, keep in mind the 1K pot gave perfect results on the breadboard. So I changed to a 10K pot with the same result.
  • One website mentioned a similar result could be due to the micro-controller and the LCD being out of sync, and jamming the reset button a few times will get them back in sync. Tried that for about 5 min and still had the same result.
  • Another website mentioned that some LCD’s may take a few milliseconds too long to power up, and miss the LCD initialization from the micro-controller, adding a delay at the start of the sketch before the initialization will sort you out. Did that, made the LED blink a few times on and off before calling “lcd.begin(16, 2);”. Still same effect.
  • I noticed the L7805CV starts getting really blistering hot when you have the LCD and the Micro-controller plugged in and started. If you run only the LCD or Micro-controller the L7805CV remains very cool to touch. This means to me I have some kind of short circuit, which I don’t see.

Below is a link to my own website, where I have documented my progress with pictures and code. It will be easier to just look there for info instead of reposting everything.
http://www.rjbsoft.co.za/index.php?option=com_content&view=article&id=57:arduino-dishwasher-part-3&catid=38:hardware-projects&Itemid=82

I am sure I made a mistake on the custom board design somewhere. Please take a look and see if you see where I made my mistake. My board is built like the schematic. I tested my cables over and over and there is no short, no bridges where they should not be, and every cable is going exactly as on the schematic.

Thank you

  • I saw I was using a 1K pot and not a 10K pot, keep in mind the 1K pot gave perfect results on the breadboard. So I changed to a 10K pot with the same result.

The 1K potentiometer will draw more current from the supply than a 10K pot (ten times as much) but as far as the LCD is concerned there is no difference.

  • One website mentioned a similar result could be due to the micro-controller and the LCD being out of sync, and jamming the reset button a few times will get them back in sync. Tried that for about 5 min and still had the same result.

You could put your fingers in your ears and twirl around three times and have just as much effect on the LCD.

  • Another website mentioned that some LCD's may take a few milliseconds too long to power up, and miss the LCD initialization from the micro-controller, adding a delay at the start of the sketch before the initialization will sort you out. Did that, made the LED blink a few times on and off before calling "lcd.begin(16, 2);". Still same effect.

The problem with 'slow' LCDs is real but in order to add a delay before the initialization you may have to actually modify the library. This type of problem would result in a single row of blocks.

  • I noticed the L7805CV starts getting really blistering hot when you have the LCD and the Micro-controller plugged in and started. If you run only the LCD or Micro-controller the L7805CV remains very cool to touch. This means to me I have some kind of short circuit, which I don't see.

This is obviously a problem, (but maybe not your only one).

The fact that you are seeing two rows of blocks is also a clue. Typically you will see two rows of blocks on a correctly operating LCD if you turn the contrast potentiometer all the way to one end, the end that puts 0 volts on pin 3. What concerns me is that if there was a short here, one causing enough current for the voltage regulator to get hot, the regulator would shut down and you wouldn't see the blocks any more. Anyway, I would start by investigating the contrast circuit.

My board is built like the schematic.

You need bypass / decoupling capacitors on the power connections to the microprocessor, as close to the chip as possible.

Don