Posted: 07:52pm 28 Feb 2014 |
Copy link to clipboard |
 Print this post |
|
For those who want to play with their LCD displays with respect to scrolling and cursors etc, here are a few codes that might help.
This is for 16x2 LCD only. My 20x4 have not turned up and I haven't looked at the data sheet.
Clear Display
1 Self Expanatory
Cursor Home
2 Sets Cursor to Line 1 left edge
Entry Mode Set
4 Cursor moves left, no shift display
5 Cursor moves left, Shift Display Left
6 Cursor moves right, No shift display
7 Cursor moves right, Shift display left
Display On/Off
8 Display Off, Cursor Off, Blink Off
9 Display Off, Cursor Off, Blink On
10 Display Off, Cursor On, Blink Off
11 Display off, cursor On, Blink On
12 Display On, Cursor Off, Blink Off
13 Display on, Cursor Off, Blink On
14 Display On, Cursor On, Blink Off
15 Display On, Cursor On, Blink On
Cursor Or Display Shift
16 Shift Cursor Left, Dec Address Counter
20 Shift Cursor Right, Inc Address Counter
24 Shift Display Left, Cursor Shift according to display
28 Shift Display Right, Cursor Shift according to display
Function Set
32 4 Bit Mode, 5x8, 1 Line Display
36 4 Bit Mode, 5x11, 1 Line Display
40 4 Bit Mode, 5x8, 2 Line Display
44 4 Bit Mode, 5x11, 2 Line Display
48 8 Bit Mode, 5x8, 1 Line Display
52 8 Bit Mode, 5x11, 1 Line Display
56 8 Bit Mode, 5x8, 2 Line Display
60 8 Bit Mode, 5x11, 2 Line Display
Set CGRAM Address
64 to 127
Set DDRAM Address
128 to 255
(128 is start of line 1 on 16x2 Display)
(192 is start of line 2 on 16x2 Display)
For all of the above, the RS line is low.
Read Busy Flag
and Address bits 0 to 6 (Bit 7 is Busy Flag) Not available as R/W pin is Connected to 0v.
Write Data to CGRAM or DDRAM - may not be available as RS may not be operational. May need uMBASIC commands. Edited by MOBI 2014-03-02 David M.
|