Commands and Instruction set

Only the instruction register (IR) and the data register (DR) of the LCD can be controlled by the MCU. Before starting the internal operation of the LCD, control information is temporarily stored into these registers to allow interfacing with various MCUs, which operate at different speeds, or various peripheral control devices. The internal operation of the LCD is determined by signals sent from the MCU. These signals, which include register selection signal (RS), read/write signal (R/W), and the data bus (DB0 to DB7), make up the LCD instructions (Table 3). There are four categories of instructions that:


  • Designate LCD functions, such as display format, data length, etc.
  • Set internal RAM addresses
  • Perform data transfer with internal RAM
  • Perform miscellaneous functions



Table 3: Command and Instruction set for LCD type HD44780


Although looking at the table you can make your own commands and test them. Below is a breif list of useful commands which are used frequently while working on the LCD.


No. Instruction Hex Decimal
1Function Set: 8-bit, 1 Line, 5x7 Dots0x3048
2Function Set: 8-bit, 2 Line, 5x7 Dots0x3856
3Function Set: 4-bit, 1 Line, 5x7 Dots0x2032
4Function Set: 4-bit, 2 Line, 5x7 Dots0x2840
5Entry Mode0x066
6Display off Cursor off
(clearing display without clearing DDRAM content)
0x088
7Display on Cursor on0x0E14
8Display on Cursor off0x0C12
9Display on Cursor blinking0x0F15
10Shift entire display left0x1824
11Shift entire display right0x1C30
12Move cursor left by one character0x1016
13Move cursor right by one character0x1420
14Clear Display (also clear DDRAM content)0x011
15Set DDRAM address or coursor position on display0x80 + address*128 + address*
16Set CGRAM address or set pointer to CGRAM location0x40 + address**64 + address**
Table 4: Frequently used commands and instructions for LCD
* DDRAM address given in LCD basics section see Figure 2,3,4
** CGRAM address from 0x00 to 0x3F, 0x00 to 0x07 for char1 and so on..

The table above will help you while writing programs for LCD. But after you are done testing with the table 4, i recommend you to use table 3 to get more grip on working with LCD and trying your own commands. In the next section of the tutorial we will see the initialization with some of the coding examples in C as well as assembly.

Share it! Like it!

Conversation

ExperimenterUK
Sat Sep 13 2014, 12:34 PM
jaimin1212,Pimpalkhare Create a thread for your question
jaimin1212
Sat Sep 13 2014, 02:35 AM
i want to make self balancing robot using MPU6050 using atmega8.. please help to get data of gyro and accelerometer from this sensor through atmega8.
Thu Sep 11 2014, 09:00 AM
Sunil Pimpalkhare
Hello sir, I am trying to make Wearfin project https://www.youtube.com/watch?v=iZ6PVBvQf-g so can u help me in teaching how to built the program???
Thu Sep 11 2014, 02:21 AM
hariom panday
plz hlp me in my project
iec.naga
Tue Sep 09 2014, 01:19 AM
spi
Mon Sep 08 2014, 08:14 AM
fameem
water changing in fish tank automatically using microcontoller with timer. send idea to me
dexter_a
Sat Sep 06 2014, 11:09 AM
hello guys
Sat Sep 06 2014, 10:10 AM
munaxa
plx guide me
Sat Sep 06 2014, 10:09 AM
munaxa
hi i want to buy plx guie me
ajay_bhargav
Sat Sep 06 2014, 03:10 AM
@Ben, Its hard to undrstand the context like this. If you can post in forum with some example code we might answer you better.

Downloads

Comments

engwas
Tue Sep 30 2014, 08:42 AM
zsachico
Tue Sep 30 2014, 12:18 AM
evergreencare
Sat Sep 27 2014, 03:39 AM
Agnoor
Thu Sep 25 2014, 02:39 AM
fouadzeyad
Tue Sep 23 2014, 05:04 AM
deepbhadani
Fri Sep 19 2014, 01:08 PM
desaiakshay92
Fri Sep 19 2014, 12:45 AM
Fiddu
Thu Sep 18 2014, 02:28 AM

Online

Guests: 36, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 01:37 AM

Members: 37522
Newest member: engwas
Forum Activity
kirangowle Avatar
Posted By kirangowle
Sat Sep 20 2014, 12:35 AM
Hello All,I want to connect normal speaker (as a s...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Sep 17 2014, 12:59 AM
I think its important to list out the features of ...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Sep 17 2014, 12:45 AM
you need to put a wait condition in ISR till the s...
akshar Avatar
Posted By akshar
Mon Sep 15 2014, 04:41 AM
sir,i used microcontroller 89v51rd2 in circuit. No...
bobparihar Avatar
Posted By bobparihar
Mon Sep 15 2014, 02:24 AM
i am programming interrupt 0 using 8051my task is....
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Sep 13 2014, 12:23 PM
There may not be an exact equivalent .You will hav...
akshar Avatar
Posted By akshar
Sat Sep 13 2014, 03:18 AM
Sir, Good Morning,Thank you for making me a member...
ajay_bhargav Avatar
Posted By ajay_bhargav
Thu Sep 11 2014, 12:52 AM
which compiler are you using? I suggest XC8 with M...
ajay_bhargav Avatar
Posted By ajay_bhargav
Thu Sep 11 2014, 12:49 AM
I always prefer Olimex Dev boards when it comes to...
ajay_bhargav Avatar
Posted By ajay_bhargav
Thu Sep 11 2014, 12:44 AM
master will always lower down the Chip select... s...