Showing posts with label Character LCD. Show all posts
Showing posts with label Character LCD. Show all posts

Wednesday, April 6, 2011

LCD bug fixed

I have finally fixed the accuracy of my LCD code. Previously, my code contained many bugs, which essentially made the LCD unreliable. In fact, it was reliably dropping characters and ignoring commands. From the beginning, I had made sure that that I obeyed the timing diagram. However, I had completely forgotten to refer to the execution times listed by the instruction summary in the LCD driver datasheet. This means that I was sending instructions before the previous one completed.

I have finally implemented the proper delays allowing the commands to complete. Later, I use the busy flag or interrupt based display queue instead. 

Saturday, May 29, 2010

Making the LCD setup permanent

I soldered everthing from the previous post.
The pickit 2 plugs into the 5 pin header and my UART cable plugs into the 4 pin header. The blue terminal block is for 5V and ground.

Thursday, August 6, 2009

Using a character lcd

With weeks of debugging and help from my friend I finally got my Character LCD to work. Below is a video of a simple counter.



Here is the code in C18 : lcd_counter.c

RA1: Read/Write
RA2: Enable
RA7: Register Select
RB0~7 was hooked up to DB0~7

Looking back at how much work I actually did, making the LCD work wasn't too bad. Most of the bugs that I ran into were really silly (like pins burning out).

I will put up a tutorial on my website on how to set the LCD up. Here is the link: LCD.