A serial LCD is the most inexpensive and simplest user interface you can provide when interfacing with such processors at the Basic Stamp, PIC, 68HC11, etc, in displaying user prompts, messages and displaying data.
This discussion deals with how a serial LCD is used and describes a low cost alternative developed by my undergraduate electrical engineering students.
Interfacing a serial LCD with a Stamp, PIC or other processors.
The idea is for your Stamp or PIC to send serial data to the serial LCD module. A processor on the LCD, usually a PIC, reads the serial data and controls the LCD unit so as to display a character.
In the case of the Stamp, this is easily implemented using the SEROUT command. It uses only one I/O line.
The use of a serial LCD is critical to PIC developers, particularly if they do not have an emulator. It is really the only meaningful debugging tool you have.
A separate discussion deals with how to interface a PIC you are developing with a serial LCD. The communications code required by the PIC under development requires nominally 100 (decimal) bytes of program memory, uses seven bytes of data and one I/O line to interface with a serial LCD unit.
The serial data sent to the serial LCD may be of two types; instructions to the LCD itself and actual characters to be diplayed on the LCD.
Instructions include intializing the LCD, selecting the cursor type, setting the cursor position, setting the font and scrolling functions. Such instructions consist of first sending the special character FE (H) followed by the instruction.
For example, sending the serial data;
causes the serial LCD to clear the display and locate the cursor to "home".
FE C0causes the cursor to go to the second line of the LCD. Any subsequent characters will be written, beginning at this point.
Note that the serial LCD notes the FE and interpets the next byte as an instruction.
Actual characters to be displayed are sent without the leading FE character. For example;
41 or "A"
displays the character "A".
"New Line" Character
Most serial LCD units do not support "new line" or ASCII 0D Hex. Rather, 0D is simply considered to be a charcter and it is "displayed" on the LCD as some kind of wierd character rather than doing what we think of "new line" doing.
Thus, if you desire text which scrolls up;
Send FE 01 ; clear the LCD Send FE 80 ; locate at line 1 Send "Hello World" Delay Send FE C0 ; locate at line 2 Send "Another Hello" Delay Send FE 01 ; clear the LCD Send FE 80 ; locate at line 1 Send "Another Hello" Send FE C0 ; locate at line 2 Send "And Yet a Third" Delay etc
However, our serial LCD kit supports something like this.
Send FE 01 Send "Hello World" ; first line Delay Send 0D ; goes to second line Send "Another Hello" Delay Send 0D ; "Another Hello" quickly moves to line 1 Send "And Yet a Third" ; this is on line 2
Our $9.95 Serial LCD Kit. (You supply the LCD).
There are a number of serial LCD packages ranging in price from a 16 X 2
completely assembled unit from Parallax for $54.00, to a
Aside from the price difference, our $9.95 kit offers considerable flexability in allowing you to interface with LCDs having pin spacings not compatible with the Scott Edwards Backpack.
There are a lot of inexpensive LCDs out there with an array of 14 X 1 terminals on 2 mm centers and these are not compatible with the Scott Edwards Backpack.
In addition, the Edward's Backpack provides power to the LCD using one of the PIC processor outputs. Unfortunately, this approach does not permit the use of LED Backlit LCDs as the PIC can not source the nominal 80 mA required for LED back lighting.
Many LCDs require a negative bias for the contrast control. This requires cutting paths on the Edward's backpack. Our design permits you to interface with such LCDs if you have a negative bias available anywhere in the range of -3.0 to to -12.0V.
Please don't get the idea that the Edward's Backpack is a shoddy design. Indeed, I have the deepest respect for Mr Edward's and his design is a nice package. However, anytime one commits to a printed board, there are design tradeoffs. His design works well with LCDs having the Hitachi interface, LCDs having either two arrays of 7 pins on 0.1 inch centers or an array of 14 pins on 0.1 centers, LCDs that do not provide LED back lighting and LCDs that do not require a negative bias.
In addition, his design uses a byte transfer to the LCD. Ours uses a two nibble transfer which takes more time. Thus, our design requires a delay between characters. His does not require the delay.
[There are other serial LCD controllers that boast 115K baud serial transfer rates. Consider that an 20 X 4 LCD panel is only 80 characters, about one line on a CRT. I can't read at 110 baud, to say nothing of 1000 times faster].
Our kit offers a "new-line" feature. If your display is on line 1 and the "new line" character is received, the LCD goes to the beginning of line 2. But, if your display is on line 2 and the "new line" character is received, our processor writes what is one line 2 to line 1, clears line 2 and locates the cursor at the beginning of line 2. Thus, you can easily display scrolling text. We accomplish this with a 64 byte buffer in our serial processor.
Note that with our kit, you may use a 16X2, 20X2 or 40X2 character LCD. Note that in implementing a 64 byte buffer, the "new line" feature is operational up to a 64X2 LCD. (I haven't seen such a 64X2 LCD, but we can accommodate it).
In addition, our kit will accommodate 9600 and 2400 baud, either inverted or non-inverted. This is controlled by simply grounding two leads on the processor. The inclusion of non-inverted permits you to add an EIA receiver on the front end and receive data over several hundred feet.
Serial Kit - Details.
The goal is to provide an inexpensive alternative for tinkerers to acquire a serial LCD. The kit is suitable for assembly on a solderless breadboard. It includes all parts, including a supply of wire and documentaion. It does not include an LCD panel.
Detailed assembly instructions are included in the package. However a brief description is offered to illustrate the simplicity.
This Basic Serial LCD Kit contains;
Note that anyone who purchases any kit receives a free logic probe which is used in testing and debugging during assembly. Please note that this is one logic probe per person.
Important Note. Our unit will work with the Basic Stamp 2, PIC processors and other applications where a minimum delay of 3 msecs may be inserted between each character. Unfortunately, the Basic Stamp 1 does not provide the capability for this intercharacter delay, commonly known as "pacing". Thus, our unit will not work with the Basic Stamp 1 or other applications where the 3 msec intercharacter delay cannot be provided.
Sample Basic Stamp 2 Routines.
Please note that this is part of an effort to provide low cost printed materials and kits to encourage tinkering. This is the purpose of the Rochanda Project. Any profits, and they are mighty slim, are used to purchase additional components and tools for my students to use in developing new material related to embedded processor control. Everything they do is put on the WWW for the benefit of everyone.
Our reputation is very important. If you are not satisfied with this kit for any reason, return it for a full refund.
In this design, the lead was taken by Towanda Malone who is a junior. She was assisted by H. Paul Roach who just received his BSEE from Morgan State University. Nicole Ambrose who will be a senior developed many of the user applications. Of course, I had a hand in the development, but the real credit goes to these undergraduate electrical engineering students.