Serial LCD Controller
10 October 2009
I discovered a flaw in the current design that will only allow the controller to work with a connection to the computer and not to a microcontroller. I've updated the schematic below and will fix the controller design. I've added a project file below that also includes the fixed schematic.
If you look at the schematic you will notice that when you set the jumper to non-inverted so you can connect to a microcontroller for serial control it will not work. The reason is in the way I designed the circuit for both inverted/non-inverted RS232 control. Looking at the transistor in the circuit, the collector is held high through a 10K resistor. The collector feeds to the Rx pin on the PIC. When you set the jumper to non-inverted and attempt to send data to the PIC it won't work because the line is always tied high through R8 to 5V.
There is a fix and I have included it in the archive file below. There are two ways to do this:
1. If your board is already built and your intentions are to only use this LCD in a finished design and not attached to the computer then, snip the connection from R8 to 5V and the controller will only work in the non-inverted configuration.
2. Look at the included schematic in the archive and add the shown J2 jumper to your design which will allow you to select between the two types of communication.
04 October 2009
I have redesigned the LCD Controller and updated the code. The new schematics and code can be found below. I ported the code from MBasic to PicBasic Pro. I'll leave the old code up for those who still want it.
The files below are from a project that I have been working on for a serial LCD controller for a 4x20 line parallel display with the Hitachi chipset. I am also working on a USB design. In the picture of the demo board there is a wire jumper installed. This is because I screwed the pooch and somehow missed a crossed trace. I had to repair the board. In the download files the PCB files have been fixed. I'll upload some video of functionality when I get a chance.
The code and project files have been posted in the download links.
Project file downloads
Old code:
Power regulation board schematic
Demo application with sourcecode
05 October 2009 Project Files
PicBasic Pro PIC16F628A code for 16x2 character LCD
PicBasic Pro PIC16F628 code for 16x2 character LCD
PicBasic Pro PIC16F628A code for 20x4 character LCD
Archive containing test application, schematic, and PCB (ExpressPCB)
PicBasic Pro LCD Controller interface to Parallax GPS receiver
Ensure all the files are unzipped to the same folder. The include file that is referenced contains the fuse settings for the selected PIC chip.
I will be uploading a version soon that allows the type of LCD to be set. This will allow the same controller to be used for a variety of LCDs. I can't squeeze that functionality into a PIC16F628 chip without removing some of the current functionality. So, I am porting that over to a PIC16F88.
More to come...
Breadboard testing of the LCD controller
Software application for testing functionality

LCD controller schematic

A better view of the controller schematic can be downloaded from the link below:
http://picasaweb.google.com/lh/photo/LZac_OpDpd0lbB8jCWJL0Q
USB version of the LCD controller
A better view of the controller schematic can be downloaded from the link below:
http://picasaweb.google.com/lh/photo/_XtaXjprlNdzRaFHGrha_Q
Optional power supply schematic
A better view of the controller schematic can be downloaded from the link below:
http://picasaweb.google.com/lh/photo/Hp0EJqKk4PNbVm69Vd1p8g
Component layout
PCB with two controllers and the optional power supply

PCB bottom side
PCB top side
LCD prototype board component view
Prototype board attached to the back of a LCD
Netlist
Serial LCD Controller v1.4
----------------------------
C1 0.1uf
D1 1N4148
J1 16-pin Header
J2 4-pin Header, Right Angle
J3 3-pin Header
J4 6-pin Header. Right Angle
JP1 Shorting Jumper
Q1 2N2222
Q2 2N2222
R1 1M
R2 10k
R3 1k
R4 22k
R5 15
R6 10k Potentiometer
R7 1k
R8 10k
U1 PIC16F628
X1 20Mhz
HD44780 20x4 LCD Module Display
Netlist
USB BUS Powered LCD Controller
-------------------------------
C1 0.1uF
C2 10nF
C3 10uF
C4 0.1uF
C5 0.1uf
D1 1N4148
F1 500mA, Ferrite Bead
J1 USB Type B, Digikey 787780-1-ND
J2 ICSP, 6-Pin, Right Angle Header
J3 LCD Connector, 16-Pin Header
J5 2-Pin Header
J6 2-Pin Header
JP2 Shorting Jumper
JP3 Shorting Jumper
LED1 RED
LED2 GREEN
Q1 2N2222
R1 330
R2 330
R3 1M
R4 10k
R5 15
R6 1k
R7 10k
SW1 Power, SPDT
U1 FT232RL
U2 PIC16F628
X1 20Mhz
*NOTE* All resistors on the controller board are 1/8 watt
Netlist
5V Power Regulation v1.0
-------------------------
C1 10uf
C2 0.1uf
C3 10uf
D1 1N4004
D3 1N4004
J1 Power Jack
J2 3-pin header
LED1 Light Emitting Diode
R1 220
SW1 SPDT Slide Switch
VR1 LM7805
*NOTE* All resistors on the power board are 1/4 watt
You can do a search on eBay for the LCDs and you will find them listed for as cheap as $5.00 minus shipping.
04 October 2009 - Redesigned Controller
I have redesigned the controller to use some surface mount components. This is still a prototype and the final version will have all surface mount components and be a bit smaller. I also ported the code from MBasic to PicBasic Pro. MBasic is a great program but the makers have not updated it to include newer PICs. As such, I've been using PicBasic Pro which is a really nice basic compiler. The code size and speed rivals that of some PIC-C compilers.
Schematic
Newest Schematic with fix for connection to PC or microcontroller

Better view of the schematic can be downloaded at the following link: http://picasaweb.google.com/lh/photo/0gbrdTCrjH6KJyib-i33EQ?feat=directlink
Old schematic with flaw. Recommend not to build from this schematic
![]()
![]()
![]()

Better view of the schematic can be downloaded at the following link: http://picasaweb.google.com/lh/photo/Yi30Oi9tf_1AIOc2Z4cDGw?feat=directlink
![]()

Better view of the schematic can be downloaded at the following link: http://picasaweb.google.com/lh/photo/ySbtGz3Fb4xDZ26780GD8w?feat=directlink![]()

![]()

![]()

![]()


![]()




Netlist:
| Hobbybotics LCD Controller V2.3 | ||||
| Component | Description | Part Number | Vendor | Cost |
| C1 | 0.1uf, SMT 0805 | 80-C0805C104M5R | Mouser | $0.05 |
| D1 | 1N4148, D0-35 | 512-1N4148T26A | Mouser | $0.03 |
| J1 | 8-Pin Straight Header, Male | 855-M20-9730846 | Mouser | $0.20 |
| J2 | 6-Pin Receptacle, Female | 649-68685-306LF | Mouser | $1.75 |
| J3 | 6-Pin Receptacle, Female | 649-68685-306LF | Mouser | $1.75 |
| J4 | 6-Pin Polarized Header | 571-6404546 | Mouser | $0.27 |
| JP1 | 2-Pin Jumper | 855-M22-1920005 | Mouser | $0.25 |
| Q1 | 2N2222, SOT-23 | 512-MMBT2222AD87Z | Mouser | $0.06 |
| Q2 | 2N2222, SOT-23 | 512-MMBT2222AD87Z | Mouser | $0.06 |
| R1 | 1M, 0805, 1/8W | 71-CRCW0805J-1M-E3 | Mouser | $0.07 |
| R2 | 10k, 0805, 1/8W | 71-CRCW0805-10K-E3 | Mouser | $0.05 |
| R3 | 1k, 0805, 1/8W | 660-RK73B2ATTDD102J | Mouser | $0.06 |
| R4 | 22k, 0805, 1/8W | 71-CRCW0805-22K-E3 | Mouser | $0.05 |
| R5 | 15, 0805, 1/8W | 71-CRCW0805-15-E3 | Mouser | $0.05 |
| R6 | 10k, Potentiometer | 72-T70YE-10K | Mouser | $0.74 |
| R7 | 1k, 0805, 1/8W | 660-RK73B2ATTDD102J | Mouser | $0.06 |
| R8 | 10k, 0805, 1/8W | 71-CRCW0805-10K-E3 | Mouser | $0.05 |
| SW1 | DIP-2 Switch | 611-SDA02H1BD | Mouser | $0.56 |
| U1 | PIC16F628A, SOIC-18 | 579-PIC16F628A-I/SO | Mouser | $2.14 |
| X1 | 20Mhz Resonator | 815-AWCR-20.00MD | Mouser | $0.32 |
| HD44780 20X4 LCD | RT204-1 | Ebay | $10.80 | |
| PCB | Printed Circuit Board | HBLCD-V2.2 | ExpressPCB | $14.14 |
| Total | ||||
| $33.51 | ||||



@ Wed, 2009-01-14 18:45
wow....very impressive work
wow....very impressive work and those pcbs look clean. Did you get those professionally done or are you making them yourself?
Did the cost to build include the pcb work?
@ Wed, 2009-01-14 21:14
These boards were
@ Fri, 2009-01-16 04:15
Do you happen to have info
Do you happen to have info on the mfgr of the boards that you could share? The most promising one I've found was the one that sparkfun uses, by the the turnaround time is lengly.. :/
I sure am a Pastafarian, I pay homage to his noodlyness weekly with random pasta dinner sacrifices. :)
@ Fri, 2009-01-16 06:32
The boards are done by
The boards are done by ExpressPCB. I design the board and purchase through their board service. Once I am satisfied with the design i purchase my board files from them for $60.00 so that I can send to a board house for mass production. I am really satisfied with their service as it takes about 3 days to get very high quality boards. The software is very simple but excellent. The website is www.expresspcb.com. I have a link to the board house that SparkFun uses for their board service and it is a great deal. You can bypass the middleman and save some money. I'll have to post the link in the morning when I get to work as I don't have it handy.
On a side note, don't allow yourself to be tempted by the anti-pasta
@ Wed, 2009-01-14 19:13
Simulator
I downloaded the software in hopes that it would let me simulate the new eyes for Walter. Or actually the WAL9000. But it does not simulate. You really need the hardware.
So Curtis, what is the prominent large display area in the user interface for then? Does it show an "programme" of sorts. Could you share a screenshot of the app at work?
Rik
@ Wed, 2009-01-14 21:23
The large display area is so
The large display area is so that you can position the cursor to any cell on the LCD. That portion of the application was written to test that functionality. The area at the bottom right of the software is where you can define and create custom characters to send to the display or store in the LCD CGRAM. I am going to edit the post today after work with the easy to implement command set and an explanation of the software. In fact, I will rewrite the software so that you guys can create the simulations for the eyes. This is very easy to do and it will not take much for me to do. I was already pondering doing software for LCD graphics. I will post a screen of the software working. Maybe I can use that as an opportunity to do some video.
This project is designed so that others can take the PIC source and roll their own displays.
More to come when I get off work...
@ Sun, 2009-10-04 13:58
Not able to compile the .BAS source!!
Hi Curtis Brooks!!
First of all!! This is a brilliant design!!
I've made the hardware for this!! But!! I've got problems compiling the "SerialLCD_REV21.bas" source for the PIC16F628!!
I'm using the Micro Code Studio!! Compiler Version - "PICBASIC PRO2.47"!! When I compile the source!! I get the following errors!!
FATAL ERROR: Too many errors. (21)
ERROR Line 141: Redefiniton of LABEL LCDWRITE. (SerialLCD_REV21.bas)
ERROR Line 176: Bad expression. (SerialLCD_REV21.bas)
ERROR Line 193: Bad expression. (SerialLCD_REV21.bas)
ERROR Line 260: Bad expression. (SerialLCD_REV21.bas)
ERROR Line 282: Bad expression. (SerialLCD_REV21.bas)
ERROR Line 323: Bad expression. (SerialLCD_REV21.bas)
ERROR Line 332: Bad expression. (SerialLCD_REV21.bas)
ERROR Line 356: Redefiniton of LABEL ElseIf. (SerialLCD_REV21.bas)
ERROR Line 384: Bad expression. (SerialLCD_REV21.bas)
ERROR Line 387: Redefiniton of LABEL ElseIf. (SerialLCD_REV21.bas)
ERROR Line 388: Bad expression. (SerialLCD_REV21.bas)
ERROR Line 391: Redefiniton of LABEL ElseIf. (SerialLCD_REV21.bas)
ERROR Line 392: Bad expression. (SerialLCD_REV21.bas)
ERROR Line 395: Redefiniton of LABEL ElseIf. (SerialLCD_REV21.bas)
ERROR Line 396: Bad expression. (SerialLCD_REV21.bas)
ERROR Line 399: Redefiniton of LABEL ElseIf. (SerialLCD_REV21.bas)
ERROR Line 400: Bad expression. (SerialLCD_REV21.bas)
ERROR Line 404: Bad expression. (SerialLCD_REV21.bas)
ERROR Line 427: Redefiniton of LABEL LCDWRITE. (SerialLCD_REV21.bas)
ERROR Line 441: Redefiniton of LABEL LCDWRITE. (SerialLCD_REV21.bas)
ERROR Line 479: Redefiniton of LABEL LCDWRITE. (SerialLCD_REV21.bas)
I'm not sure!! why these errors occur!! Am I using the right compiler? (I guess it must be MBasic?? Is it free? there is no link to download!!) Please advice!!
Can you please provide a download link for the MBasic Compiler!! Or Can you please send me the .hex!! so that I can program the microcontroller directly!!
Thanks and Regards,
elektor_1234
@ Sun, 2009-10-04 16:20
Well, the posted basic code
@ Mon, 2009-10-05 07:59
Not able to compile the .BAS source!!
Hi Curtis Brooks!!
Thanks!! I don't see any document!! Is it a .doc??!! Can you please let me know the link!!
Thanks and Regards,
elektor_1234
@ Mon, 2009-10-05 13:27
I haven't uploaded it yet.
@ Mon, 2009-10-05 15:49
I'll check it later the day!!
Hi Curtis Brooks!!
Thanks!! I'll check for it sometime later today!! and Will let you know!!
Thanks and Regards,
elektor_1234
@ Sun, 2009-10-04 18:36
Here is the download link to
@ Mon, 2009-10-05 08:03
Not able to compile the .BAS source!!
Hi Curtis Brooks!!
Thanks for the .HEX file!! I'll program my PIC with this!!
It's great to know that you'll be updating it for the PicBasic Pro too!!
Looking forward to the PicBasic Pro code!!
Great work!!
Thanks and Regards,
elektor_1234
@ Mon, 2009-10-05 13:29
Thankyou for the interest in
@ Mon, 2009-10-05 15:50
Will definitely let you know!!
Hi Curtis Brooks!!
Thanks!! You're doing a great job over there!!
I'll definitely test this and let you know my results!!
Thanks and Regards,
elektor_1234
@ Sun, 2009-10-04 14:16
I just wanted to say,
I just wanted to say, daaaaaamn!
Those are some sexy looking PCB's! I'm just curious, has anyone done this with Atmega chips? I've got like, 3 extra 168's laying around.. would be awesome to make a serial backpack for it myself!
You've got some damn good walkthroughs, hopefully you'll post more in the near future! :)
@ Sun, 2009-10-04 16:23
Thanks for the kind words.
Thanks for the kind words. I've never worked with any of the newer Atmega chips although I have been getting the itch lately as I really like the free C compiler options. I'll have to look into that.
@ Mon, 2009-10-05 08:07
Support for a 2 X 16 LCD!! Help needed!!
Hi Curtis Brooks!!
Can you please let me know if you can modify the code for me to support a 2X16 LCD!! Please advice!!
I'm using a 2X16 in one of my current home projects!!
Thanks and Regards,
elektor_1234
@ Mon, 2009-10-05 13:26
Rev21 will support a 2x20
Rev21 will support a 2x20 LCD. I'll add the ability to select what type of LCD you are using so it can be used with 2x16, 4x20, 2x20 and 4x40 LCDs. This way you'll be able to select the type you are using without compiling code for different backpacks.
@ Mon, 2009-10-05 15:56
LCD Types support!!
Hi Curtis Brooks!!
I guess that the current code revision is Rev21 (SerialLCD_REV21.bas)!! Isn't it for the 4X20 LCD!! I see the description in the code saying "4X20"!! Please advice!!
Thanks for helping me!! Will there be any change in hardware (like power-on straps)!! to select the LCD type!! Please advice!!
Can you please let me know when I can have the code!!
Thanks and Regards,
elektor_1234
@ Tue, 2009-10-06 05:57
I've uploaded the project
@ Tue, 2009-10-06 06:24
LCD Types support!!
Hi Curtis Brooks!!
Thank you very much for this!!
I'll test them out with my hardware and let you know the results shortly!!
Certainly!! I'll post if I've done any changes!!
Thanks and Regards,
elektor_1234
@ Wed, 2009-10-07 20:47
Great project!Very
Great project!
Very professional and useful!
@ Sat, 2009-10-10 09:02
Wired the circuit!!
Hi Curtis Brooks!!
You're project is amazing!! It works great!! :-)
As promised!! I've wired your circuit and it works fine for the 16X2 LCD!! But!! there is one thing that I do not understand!!
The reason I built this is to integrate the Serial LCD with another project which is a GPS Module and a microcontroller!! This is as in the link below!!
http://www.highonsolder.com/blog/category/gps
Please see the topic "GPS Receiver"!! I'm using the same GPS module as in the link above!! The code is written in BASIC only!! It can be compiled with PIC Basic PRO 2.47!!
Please see the code in the above link "http://www.highonsolder.com/storage/code/GPS3.BAS" (Final GPS PicBasic Code)
I'm getting the data past the 16F84A microcontroller!! I'm able to see that in my PC's hyperterminal!! But!! the same is not printed in the Serial LCD properly!! The term "Searching for Satellites..." is no getting printed once!! It keeps overwriting on both the lines!! The above link uses a different LCD from Parallax which uses a Basic Stamp as a piggy back board!!
I'm not really sure as to why this is happening!! Is something in an endless for loop!! Please advice!!
Can you please help me out on this!! If there is anything to be done on the BASIC code in the above link!! Please advice!!
I can post a Video if you want !! Let me know!!
Thanks and Regards,
elektor_1234
@ Sat, 2009-10-10 15:36
Also, if you are attempting
Also, if you are attempting to use that GPS code to output to the LCD controller as written, it will not work as the commands in the PicBasic code are different from what out controller is expecting. In the zip file above I included a document that explained how to use the commands the controller expects. I wrote it for a 4-line LCD but, the concept is the same.
Let me knock around with the GPS code you posted and see what I can do to help. I'll post when working.
@ Sat, 2009-10-10 17:15
There is a PIC16F84A microcontroller inbetween!!
Hi Curtis Brooks!!
Thanks!!
There is a PIC16F84A microcontroller inbetween the Parallax GPS Module and the Serial LCD (your design)!!
The I/O data from the GPS Module is sent to the microcontroller which requests the required data from the module and it receives the data parses and displays it onto the Serial LCD!! This is as in the link "http://www.highonsolder.com/blog/category/gps"
Please see the schematics in the link http://filer.case.edu/jec24/uploaded_images/GPS-Schematic-759995.jpeg
You can also get the BASIC code from the link in my previous post!! Please advice!!
Thanks and Regards,
elektor_1234
@ Sat, 2009-10-10 15:29
A couple questions:1. How
A couple questions:
1. How are you connecting the GPS device to the LCD controller?
2. Is the GPS device connected to its own PIC and you are sending serial strings from that to the LCD controller?
3. If you are connecting as described in step 2, did you set the LCD controller jumper to "/I"? That means you will send data to the LCD controller non-inverted. When the controller is connected to the PC data gets sent to it inverted so, the jumper has to be set to "I".
Answer those questions for me and I believe I can help you out. Posting a link to a video of what you described above would help a bit also. Your controller layout looks great also.
@ Sat, 2009-10-10 18:23
Answers!!
Hi Curtis Brooks!!
Please see my answers below!! Please advice!!
1.) The GPS Module has a Serial IO pin!! through which we can send commands to the Module requesting for the required data!! which we can be received in the same IO pin!! The datasheet for the module : http://www.parallax.com/Portals/0/Downloads/docs/prod/acc/GPSManualV1.1.pdf
The data from the microcontroller is parsed and sent to the Serial LCD at a Baud Rate of 9600 as per the below link
http://www.highonsolder.com/blog/category/gps
I've mentioned the link of the schematics diagram in my earlier post which I had posted some minutes back!!
2.) The GPS Module as such has an on-board microcontroller Basic Stamp!! Apart from that!! there is another external PIC16F84A to parse the data and send it to a Serial LCD!! The External Microcontroller is programmed with http://www.highonsolder.com/storage/code/GPS3.BAS
3.) Yes!! I've bypassed the transistor inverter!! and connected the output of the PIC16F84A to the input of the Serial LCD!! such that the Serial LCD receives only non-inverted data!!
Please do let me know if there is any shortcoming or deficit in my answers!!
I'm attaching a video of the LCD text scrolling "Searching for Satellites..."!! The video is only a 3GP!! from a mobile phone!! I've changed the extension of the file to .avi (LCD_GPS.avi) as it would'nt allow me to upload a 3GP format!! The quality is not that good!! I've not connected the GPS Module as it captured the video inside my home!! Please let me know if it is OK!! or else I'll shoot it with a digital Camera!!
Once all the hardware gets fixed!! I'll make a PCB and post it as a complete GPS Module!!
Can you please help me to modify the codes!! Please advice!!
You're help is very much appreciated :-)
Thanks and Regards,
elektor_1234
@ Sat, 2009-10-10 18:45
I believe I see where the
@ Sun, 2009-10-11 03:36
Believe I got it working
I believe I have it all worked out. The fix was two fold with the first being a lot of changes to the original GPS code you posted to align with the LCD controller command set. The second I have to thank you for as it helped to expose a small flaw in the controller schematic. If you look at the schematic closer than I apparently did, you would notice that when you set the jumper to non-inverted so you can connect to a microcontroller for serial control it will not work. The reason is in the way I designed the circuit for both inverted/non-inverted RS232 control. Looking at the transistor in the circuit, the collector is held high through a 10K resistor. The collector feeds to the Rx pin on the PIC. When you set the jumper to non-inverted and attempt to send data to the PIC it won't work because the line is always tied high through R8 to 5V.
There is a fix and I have included it in the archive file below. There are two ways to do this:
1. If your board is already built and your intentions are to only use this LCD in a finished design and not attached to the computer then, snip the connection from R8 to 5V and the controller will only work in the non-inverted configuration.
2. Look at the included schematic in the archive and add the shown J2 jumper to your design which will allow you to select between the two types of communication.
GPS PicBasic Pro code and schematic
My intentions are to redesign the controller a bit and this is a good catch before I made the mistake again.
I believe the mistake went unnoticed because I original wrote the code with MBasic from Basic Micro and the controller worked as expected.
Test the code out and let me know if it works for you. Be sure to make the changes I suggested above. Once I know it works as expected I'll clean the code up a bit more and add some more goodies to the GPS routines. Again, I don't have a Parallax GPS so, I can't test with that. I sent some dummy strings to it and it worked for me.