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.