LCD Display Drivers Lecture

16
Writing to an LCD HD44780 LCD Drivers

Transcript of LCD Display Drivers Lecture

Page 1: LCD Display Drivers Lecture

Writing to an LCD

HD44780 LCD Drivers

Page 2: LCD Display Drivers Lecture

16x1 LCD Module

16 characters, 1 row8-bit or 4-bit parallel interfaceIndustry standard HD44780 controllerVariations: backlight, polarizer, reflective, wide viewing angle.

http://www.crystalfontz.com/products/1601a/index.html#CFAH1601ANYGJP

Page 3: LCD Display Drivers Lecture

HD44780U (LCD-II)

Dot Matrix Liquid Crystal Display Controller/DriverCan be controlled by 4- or 8-bit modeCan control up to one or two 8-character linesLow power supply (2.7V to 5.5V)5x8 and 5x10 dot matrix possible80 x 8-bit Display Data RAM (80 characters max)9,920-bit character generator ROM for 240 fonts

Page 4: LCD Display Drivers Lecture

Interfacing to the LCD

Page 5: LCD Display Drivers Lecture

Mapping Character Codes

to Character Patterns

Page 6: LCD Display Drivers Lecture

Display Data RAM (DDRAM)

To write data to display, store individual characters into DDRAMLCD controller reads DDRAM and displays the data represented in 8-bit character codesCan store up to 80 characters16x1 can be implemented as a 2-line display of 8 characters (8x2) using same controller

Page 7: LCD Display Drivers Lecture

Interfacing to the MCU

Page 8: LCD Display Drivers Lecture

Pin Functions

Page 9: LCD Display Drivers Lecture

Interfacing to the MCU

Page 10: LCD Display Drivers Lecture

Interfacing to the MCU

4-bit mode: only DB4-DB7 used, two nibbles sent successively, high-order nibble first.

Page 11: LCD Display Drivers Lecture

Instruction Descriptions

display clear – 20H to all locationscursor home – sets address counter to DDRAM 0display on/off control

cursor on/offdisplay character blink

cursor or display shiftfunction set

DL: data length interface (4 or 8 bits)N: number display linesF: character font

entry mode – what happens after character writeI/D: DDRAM incremented or decrementedS: shift display left or right

Page 12: LCD Display Drivers Lecture

[1] Hitachi. HD44780U (LCD-II) Dot Matrix Liquid Crystal Display Controller/Driver Datasheet. www.datasheet4u.com/html/H/D/4/HD44780UA00FS_Hitachi.pdf.html

Page 13: LCD Display Drivers Lecture

Set Function: 8 bite mode

Set Function: 4-bit mode

Function Set: #lines and font

Clear display

Set entry mode

Display Off

Page 14: LCD Display Drivers Lecture

Character Generator ROM

Create your own fonts: 5x8 or 5x10 dot patterns

CGRAM can also be used as general purpose RAM

Page 15: LCD Display Drivers Lecture

LCD Segment Displays

Lower tech, earlier design, cheapHere, each segment is made of 7 bars

Page 16: LCD Display Drivers Lecture

Coding Segments

Each bar in a segment is labeled with a letterCreate map of bars to display each letter and number