Professional Documents
Culture Documents
Beginning LCDS: Home Sign Up! Explore Community Submit
Beginning LCDS: Home Sign Up! Explore Community Submit
Beginning LCDS: Home Sign Up! Explore Community Submit
Beginning LCDs
by gimmelotsarobots on June 10, 2008
Table of Contents
step 5: Resistors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
step 7: Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
http://www.instructables.com/id/Beginning-LCDs/
intro: Beginning LCDs
NOTE: I finally got my camera figured out so there should only be 1 or 2 blurry images. On with the Instructable!
LCDs are one of the coolest things to add to any project right now. You can use them to display things from the speed of your bike, to the amount of room being used up
on your RAM. This Instructable will give you a general description on how LCDs work, and how to get started using them. The information provided here will give you
enough information to even develop control circuits on any Microcontroller. LCDs are a lot simpler than you think!
Image Notes
1. Use this portion of the schematic to make a PC compatible LCD (covered later)
2. for contrast control
3. If your LCD has a backlight, this is for brightness.
4. LCDs generally have 14 pins
5. LCDs with no backlight don't have these pins.
6. Don't connect R/W to pin 14. Just connect it to ground
http://www.instructables.com/id/Beginning-LCDs/
step 2: Building a Test Rig
Based on the previous information, I will show you how to make a very simple manual LCD test rig that allows you to enter text and symbols which in turn teaches you
exactly how they work. Below is the schematic. The jumpers (switches 1-8) have pull-up resistors so that a missing jumpers gives a logic 1 or high.
Parts:
Tools:
Soldering iron
Solder
Electrical tape
Nippers
Wire strippers
Helping hand (optional but very useful)
Image Notes
1. schematic by Epe
Image Notes
1. Yay I fixed the image quality!
2. 4.7k resistors
3. momentary pushbutton switch
4. 10 k linear potentiometer (you can use any 10k potentiometer)
5. 2x8 jumper assembly and 8 jumpers
6. SPST switch
7. wire
8. ribbon cable
9. PCB with individual connections
http://www.instructables.com/id/Beginning-LCDs/
Image Notes
1. Alligator clips
2. 1 power and 1 ground wire
3. LM7805 5V DC regulator
http://www.instructables.com/id/Beginning-LCDs/
Image Notes Image Notes
1. Enable switch 1. the gap is because my momentary switch has an internal connection.
2. Register Select switch 2. jumpers
3. Jumpers 3. SPST switch
4. ground line 4. ground line
step 5: Resistors
Each jumper and each switch has a 4.7k pull-up resistor. This is so that any closed circuit through a jumper or switch generates a logic 0 (or low). leave a space between
each switch/jumper and its resistor. This space is where you will put your ribbon cable connecting the LCD. One side of the line of resistors should be connected together.
This will be the positive rail.
http://www.instructables.com/id/Beginning-LCDs/
Image Notes Image Notes
1. ground wire 1. ground wire
2. 10k potentiometer 2. this goes to pin 3 of the LCD
3. This should go to 5V+
4. ground rail
5. resistor line
Image Notes
1. ground jumper wire
2. jumper wire to move the pin 3 connection closer to the other wires
3. R/W ground connection
4. pin 5 will connect here
step 7: Power
Now for the power. LCDs of almost every kind run off five volts DC. for convenience, we will use a 9 volt battery. Solder the ground wire of the 9V battery clip to the
ground rail by the jumpers, solder the positive wire a little distance away. Solder the left pin of the 5V regulator (input pin) to the positive wire from the battery clip. This
should be the only connection to the positive battery clip wire. Solder a jumper wire from the middle pin of the regulator (ground) to the ground rail. Next solder a jumper
wire from the right pin of the regulator (output) to the positive rail. Now it is time to build the alligator clips. solder one clip to the wire for positive and the other to the wire
for ground. I mentioned these wires in the parts list. They have nothing to do with the battery clip. solder the positive wire to the positive rail and the ground wire to the
ground rail. You will use these alligator clips to power the LCD screen. If you like you could send the power over the ribbon cable to the LCD. Pin 1 on the LCD is ground
and pin 2 is Positive. Some LCDs have a 2x7 or 2x8 connection (depending on whether you have a 14 or 16 pin model). You can identify pin one simply since it its
ground. It will generally have a thicker PCB trace and connect to the metalwork at some point.
http://www.instructables.com/id/Beginning-LCDs/
Image Notes Image Notes
1. ground clip 1. this is where the positive wire should be
2. 5V+ clip
3. 9V battery clip
4. power wires
5. LM7805 5V regulator
Image Notes
1. ground rail
2. jumpers
3. ribbon cable
4. resistors
5. connect as one
6. power stuff
7. positive rail
8. momentary switch
9. SPST switch
10. contrast potentiometer
http://www.instructables.com/id/Beginning-LCDs/
Image Notes
1. schematic by Epe
Image Notes
1. below is a back-side view of a male parallel port connector
Update 06/13/2008: I added some pictures of a miniature LCD tester that fits in an Altoids tin. This tester has no contrast control. I will simply solder contrast to ground
during tests.
Image Notes
1. There it is after trimming off excess PCB
http://www.instructables.com/id/Beginning-LCDs/
Image Notes Image Notes
1. I found a DIP switch 1. pushing the enable button
2. that potentiometer is for the adjustable voltage regulator.
Image Notes
1. The 8 bit controls
2. The register select switch.
UPDATE 06/15/2008:
You might notice that several characters will pop up instead of one when the switch is pressed, to fix this, you need a Debounce circuit. This prevents this from happening
by use of 2 NAND gates in a 74LS00 quad NAND gate and a SPDT switch. Below is the schematic.
As for the parallel port, try LCD Smartie. It is a great open source program with a lot of support and great forums. There is an attached video of me using it. The video
opens with windows media player.
http://www.instructables.com/id/Beginning-LCDs/
Video
Video
Image Notes
1. by Epe
http://www.instructables.com/id/Beginning-LCDs/
Image Notes
1. by Epe
Image Notes
1. Two NAND gate and a SPDT switch create a debounce circuit.
File Downloads
Related Instructables
LED Polarity
Tester by viacin How to Clean a Simple Polarity Quick-and-Dirty How to use the
FREE 17" LCD ESU Laptop Screen Tester by Conductivity Dragon Rider How
Monitor - How Tester v1.0 by With Household steven123654 Tester by 500 with your to change the
to do it? by EWH Products by Ushanka AVR Dragon by LCD of your
thearchitect laminterious barney_1 Nokia mobile
phone. by knarx
Advertisements
Customized Instructable T-shirts
http://www.instructables.com/id/Beginning-LCDs/
Comments
48 comments Add Comment
http://www.instructables.com/id/Beginning-LCDs/
RetroPlayer says: Jul 8, 2008. 8:36 AM REPLY
Read my comments below, they will answer your question. Get the datasheet for the HD44780. You are really only interested in the commands and
maybe the character table. There is also CGRAM, which lets you create some custom characters (16, I think.)
BTW, if you have something on your screen that is going to be static (like Score:) and something that changes after it, you just have to move your
address to the characters that you will change. This is done by selecting the registers and ANDing $80 to your address. So $80 is actually your top left-
most character. $C0 is the beginning of your second line.
Wear gloves while replacing the screen. You'll kick yourself if you don't.
Did you try setting the function register to 2 line mode? If you do, try setting the position to address 40h for the second set of 8 characters. Most
displays initialize for a single line, but you could try setting it to single line just in case.
I've never run across an LCD that did this, but it could be the way your LCD is wired up.
http://www.instructables.com/id/Beginning-LCDs/
RetroPlayer says: Jun 17, 2008. 11:40 PM REPLY
"Note that the 16 x 1 display is actually an 8 x 2 internally which is re-arranged to give the correct display. After writing the 7th (should say
8th) character, the character address has to be changed to the start of Line 2 to write the 8th (9th)character."
http://www.hippy.freeserve.co.uk/picaxelc.htm#LCD_Initialisation
"A single HD44780U can display up to one 8-character line or two 8-character lines."
"Note that the first line end address and the second line start address are not
consecutive. For example, when just the HD44780 is used, 8 characters x 2 lines are displayed. See Figure 5."
In other words, unless an "extension driver" is present on your LCD controller (which is not present on cheaper LCDs), the 1x16 display you
have is actually arranged as 8 characters by 2 lines with the 'second line' being the last 8 characters. The second set of 8 characters are
addressed as the second line which starts at DDRAM position 40h. Since the second line wouldn't show up until you entered enough
characters to move the address to 40h (64 characters) by normal incrementing, you will see nothing for 56 characters between your 8th
character and your 9th.
That is how the HD44780 is designed. And that is how your LCD is wired up. It's right there in the datasheet.
http://www.sparkfun.com/datasheets/LCD/HD44780.pdf
Put your display in 2 line mode (it will initialize as 1 line unless you change it) and address the second set of 8 characters by changing the
cursor position to the second line at 40h, which is done by pulling R/S low and writing C0h or 11000000b. If you also have 'increment' (05h)
set, you will only need to do this once for the remaining 8 characters. When you need to start over, you can either write 80h or 10000000b to
the register to set the address at zero again or you can just send the CLEAR (01h) and HOME (02h)commands.
Have fun.
http://www.instructables.com/id/Beginning-LCDs/
gimmelotsarobots says: Jun 13, 2008. 5:08 PM REPLY
I found some DIP switches, check out my mini tester on step 9.
You probably should have mentioned that the HD44780 drivers have a 4-bit interface mode, as well as the 8-bit. Most microcontroller projects use the 4-bit
mode to save pins...
5 stars!
http://www.instructables.com/id/Beginning-LCDs/
gimmelotsarobots says: Jun 12, 2008. 5:49 PM REPLY
There are schematics. There's one on page two.
http://www.instructables.com/id/Beginning-LCDs/