Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
How to Control a HD44780-Based Character-LCD

How to Control a HD44780-Based Character-LCD

Ratings: (0)|Views: 13 |Likes:

More info:

Published by: Isaiah James Vacalares on Jun 26, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

10/18/2013

pdf

text

original

 
How to control a HD44780-based Character-LCD
The Industry Standard Character LCD
Visitor #
© 1995-2006 Peter Ouwehand.Last updated on 2005-09-20
TOC|General info|8051 example|PIC example|Misc. examples|Manuf./Distrib.|Home|View Guestbook
General info and code-examples
TOC
1. General1.1. Disclaimer 1.2. Usage1.3. Purpose2. HD44780-based LCD modules2.1. Pin assignment2.2. Instruction set2.3. Visible DDRAM addresses2.3.1. 1-line displays2.3.2. 2-line displays2.3.3. 4-line displays2.4. Interfacing2.4.1. 8-bit interface2.4.2. 4-bit interface2.5. Character set2.6. Related pages
1. General
TOC
1.1. Disclaimer 
THIS DOCUMENT IS PROVIDED TO THE USER ''AS IS''. Etc.etc. All information in this document is to the best of my knowledge.The 8051 PL/M51 software is used in applications using 2*16, 2*20, 4*20 and 2*40 LC-Displays.The PIC ASM software is used in applications using 2*20, 4*20 and 2*40 LC-Displays.So there should be no risk, but there's still Murphy.
TOC
1.2. Usage
Tell me about your applications.Send a postcard
TOC
1.3. Purpose
Uuuhm..
TOC
2. HD44780-based LCD modules
Data from
HITACHI LIQUID CRYSTAL CHARACTER DISPLAY MODULE 
and
OPTREX DOT MATRIX LCD MODULE 
databooks.
TOC
2.1. Pin assignment
The pin assignment shown in
Table 2.1.
is the industry standard for character LCD-modules with a
maximum of 
80 characters.The pin assignment shown in
Table 2.2.
is the industry standard for character LCD-modules with
morethan
80 characters.
11/17/2008How to control a HD44780-based Chahttp://home.iae.nl/users/pouweha/lcd1/6
 
To be sure
always
check the manufacturers datasheet!To locate pin 1 on a module check the manufacturers datasheet!
Table 2.1., Pin assignment for <= 80 character displays
Pin numberSymbol Level I/OFunction
1Vss--Power supply (GND)2Vcc--Power supply (+5V)3Vee--Contrast adjust4RS0/1I0 = Instruction input1 = Data input5R/W0/1I0 = Write to LCD module1 = Read from LCD module6E1, 1->0IEnable signal7DB00/1I/OData bus line 0 (LSB)8DB10/1I/OData bus line 19DB20/1I/OData bus line 210DB30/1I/OData bus line 311DB40/1I/OData bus line 412DB50/1I/OData bus line 513DB60/1I/OData bus line 614DB70/1I/OData bus line 7 (MSB)
Table 2.2., Pin assignment for > 80 character displays
Pin numberSymbol Level I/OFunction
1DB70/1I/OData bus line 7 (MSB)2DB60/1I/OData bus line 63DB50/1I/OData bus line 54DB40/1I/OData bus line 45DB30/1I/OData bus line 36DB20/1I/OData bus line 27DB10/1I/OData bus line 18DB00/1I/OData bus line 0 (LSB)9E11, 1->0IEnable signal for row 0 and 1 (1
st
controller)10R/W0/1I0 = Write to LCD module1 = Read from LCD module11RS0/1I0 = Instruction input1 = Data input12Vee--Contrast adjust13Vss--Power supply (GND)14Vcc--Power supply (+5V)15E21, 1->0IEnable signal for row 2 and 3 (2
nd
controller)16n.c.
TOC
2.2. Instruction set
Table 2.3. HD44780 instruction set 
InstructionCodeDescriptionExecutiontime**RSR/WDB7DB6DB5DB4DB3DB2DB1DB0
Clear display0000000001Clears display and returnscursor to the home position(address 0).1.64mSCursor home000000001*Returns cursor to homeposition (address 0). Alsoreturns display being shiftedto the original position.DDRAM contents remainsunchanged.1.64mSEntry modeset00000001I/DSSets cursor move direction(I/D), specifies to shift thedisplay (S). Theseoperations are performedduring data read/write.40uSDisplayOn/Off control0000001DCBSets On/Off of all display (D),cursor On/Off (C) and blinkof cursor position character (B).40uSCursor/display000001S/CR/L**Sets cursor-move or display-40uS
11/17/2008How to control a HD44780-based Chahttp://home.iae.nl/users/pouweha/lcd2/6
 
shiftshift (S/C), shift direction(R/L). DDRAM contentsremains unchanged.Function set00001DLNF**Sets interface data length(DL), number of display line(N) and character font(F).40uSSet CGRAMaddress0001CGRAM addressSets the CGRAM address.CGRAM data is sent andreceived after this setting.40uSSet DDRAMaddress001DDRAM addressSets the DDRAM address.DDRAM data is sent andreceived after this setting.40uSRead busy-flag andaddresscounter 01BFCGRAM / DDRAM addressReads Busy-flag (BF)indicating internal operationis being performed andreads CGRAM or DDRAMaddress counter contents(depending on previousinstruction).0uSWrite toCGRAM or DDRAM10write dataWrites data to CGRAM oDDRAM.40uSRead fromCGRAM or DDRAM11read dataReads data from CGRAM oDDRAM.40uS
Remarks:
- DDRAM = Display Data RAM.- CGRAM = Character Generator RAM.- DDRAM address corresponds to cursor position.- * = Don't care.- ** = Based on F
osc
= 250kHz.
Table 2.4. Bit names
Bit nameSetting / Status
I/D0 = Decrement cursor position1 = Increment cursor positionS0 = No display shift1 = Display shiftD0 = Display off1 = Display onC0 = Cursor off1 = Cursor onB0 = Cursor blink off1 = Cursor blink onS/C0 = Move cursor1 = Shift displayR/L0 = Shift left1 = Shift rightDL0 = 4-bit interface1 = 8-bit interfaceN0 = 1/8 or 1/11 Duty (1 line)1 = 1/16 Duty (2 lines)F0 = 5x7 dots1 = 5x10 dotsBF0 = Can accept instruction1 = Internal operation in progress
TOC
2.3. Visible DDRAM addresses
TOC
2.3.1. 1-line displays
Shown after reset (with N=0).
Table 2.5. DDRAM address usage for a 1-line LCD
Display sizeVisibleCharacter positionsDDRAM addresses
1*800..070x00..0x071*1600..150x00..0x0F
[1] [2] [3] [4]
1*2000..190x00..0x131*2400..230x00..0x171*3200..310x00..0x1F1*4000..390x00..0x27
[1] Peter Bozzay:Found DDRAM addresses 0x00..0x07 + 0x40..0x47 to be functional for a 1*16 display size.Make/model: not mentioned / SC1601AS*B.[2] Hendrik Abma:Found DDRAM addresses 0x00..0x07 + 0x40..0x47 to be functional for a 1*16 display size.Make/model: Samtron / KP-03.[3] Luigi Candurro:
11/17/2008How to control a HD44780-based Chahttp://home.iae.nl/users/pouweha/lcd3/6

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->