- Published: Wednesday, 11 March 2009
- Written by Digital DIY
- Hits: 14313
Basic takes the stress completely out of LCD interfacing, the only concern is that you get the Pin-out right;
This is setting the Pin PORTB.2 to the RS Pin on the LCD and the EN Pin to PORTB.3 etc..
My programs that use LCD's may have a different Pin-outs to what you use/what your default in your .INC file is that you include in your program. I use the above information for Pin-outs, and wiring the LCD is as follows:
To make life even easier, you can solder pins to the LCD so that you can just 'insert' it into your breadboard
The Vo is the contrast setting, if your LCD doesn't appear to be working, chances are that the contrast setting is incorrect, adjust the contrast when you have no data/PIC connected to it, and you should see blocks across the 1st line, don't make it to dark, or you will not see any change from the dark blocks. Alternatively, double check your wiring and then in your program send out some info like Print At 1,1, "Hello World" and adjust the contrast until you can clearly read it.
One thing to remember about LCD's is to give them ~100-200ms to power-up. They run through their own initialization, and if you were to send data to it immediately, nothing would be displayed.
Basic initialization code to include in your program for LCD support would be:
The command CLS takes time to perform on the LCD. Some compilers include a small delay by default as part of the CLS command, read up on it in the help file, if it doesn't, include a small delay ~10ms.
And a basic example of how to display data on the LCD: