Text LCD -- via PMP Unit

And now we turn out attention to LCD displays. To get started, let's look at the simplest approach: a text oriented display just using the PMP built-in unit.

This unit, provided with PIC Micro Pascal, is actually pretty good. It can handle all of the Pascal data types with the usual Pascal justification parameters, and best of all can be assigned to the standard output procedures so you can use WRITE() and WRITELN() as if you were printing to a screen console.

The project is straightforward and assumes you are using a 2X16 LCD based upon the ubiquitous HD44780 driver chip. I picked a bunch of these up cheap at All Electronics, but they're also readily available on Amazon and eBay. Here's the circuit:

One thing to keep in mind is that the backlight LED amongst these things varies considerably, so you'll want to choose R2 accordingly. The unit I'm using in the photo, above, includes an internal current limiting resistor, but others don't and might need an external one. Sometimes, instead, you'll see a rectifier used as a voltage dropper instead. So, be sure to look over your data sheet.

This demo tries out all of the features provided by the PMP unit. It prints a variety of numbers: bytes, integers, reals and hexadecimal. It also shows off the scrolling-left and -right business, user-defined characters (I made it display a musical quarter note), line cursor, block cursor, and more. Be sure to read over the source code I've written, and don't forget to scan the LCD unit from PIC Micro Pascal that it calls upon. You'll find it in the Common folder. Finally, I really recommend reading all of the pages in the documentation manual on this unit.

Click to get the source code.
Click to get the schematic PDF.

Next Project: Text LCD -- Homebrew Code

No comments:

Post a Comment