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
Thu Jul 30 2015, 11:41 PM
@Muhammad Aarshad build what ?
Wed Jul 29 2015, 06:42 PM
Muhammad Aarshad
Hello I want to build it, but I don't know how can I program the micro controller. Can You send me the code of the IC? Thanks in advance My e-mail: [email protected]
Sat Jul 25 2015, 10:37 PM
Arnali
What does the cross means? The ones from pin 7,8,9,10 of the LCD?
Fri Jul 24 2015, 09:53 AM
HARSHAL PATIL
....
shyam
Thu Jul 23 2015, 01:42 PM
hi Ajay
ajay_bhargav
Mon Jul 20 2015, 04:38 AM
@Rohit Biradar, I am glad my tutorial helped
Thu Jul 16 2015, 06:19 PM
Rohit Biradar
Thanks a lot publisher of this tutorial. Everybody tells about the nibble sending methods and the command set for 4-wire lcd interface. You are the first to tell me about the most important part that is resetting the lcd. This thing got me all day. Now I can sleep in peace. Thanks once again. Million thanks.
Thu Jul 16 2015, 12:24 PM
Baby
my project is related to control the door in dam. by keil program how can i control the same.
Thu Jul 16 2015, 09:12 AM
rutuja
plzzz giveme more details about this project.if i want to type any words then how it will be happen bcoz no more letters are on remote.suggest about it
Sat Jul 11 2015, 09:55 AM
Abhijit Deshmukh
ok

Downloads

Comments

albatain
Fri Jul 31 2015, 02:58 AM
KDN
Wed Jul 29 2015, 05:14 AM
Tanvir.
Fri Jul 24 2015, 07:59 AM
erummumtaz
Thu Jul 23 2015, 10:47 PM
balvant
Thu Jul 16 2015, 03:56 PM
seoulmak
Mon Jul 13 2015, 01:21 PM
SHIVKHUMAR
Sat Jul 11 2015, 04:10 AM
Nals99
Fri Jul 03 2015, 08:33 AM

Online

Guests: 37, Members: 0 ...

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

Members: 37679
Newest member: albatain
Forum Activity
Mc_Comet32 Avatar
Posted By Mc_Comet32
Sun Jul 26 2015, 05:49 PM
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Jul 23 2015, 08:14 PM
Try this link.Basically find the tacho output pin...
seoulmak Avatar
Posted By seoulmak
Mon Jul 20 2015, 03:44 PM
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 20 2015, 04:42 AM
Ok then, check if you did not mention "LCD_ClearSc...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 20 2015, 04:41 AM
I am assuming you're talking about the small CPU f...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 20 2015, 04:36 AM
Amit Kumar Das Avatar
Posted By Amit Kumar Das
Sun Jul 19 2015, 04:17 AM
Yes they are fine. I have included everything. Una...
seoulmak Avatar
Posted By seoulmak
Fri Jul 17 2015, 08:41 AM
yes, but i need more information to connect the f...
balvant Avatar
Posted By balvant
Thu Jul 16 2015, 04:07 PM
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jul 15 2015, 05:42 PM
Is this a project listed on this site ?