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
Mon May 25 2015, 06:21 PM
@Subrat Sahu not a simple answer.Create a thread in "General help Guidance and Discussion" forum
Sun May 24 2015, 06:51 AM
Subrat Sahu
I have a confusion about 10 bit adc formula as describe bellow that resolution = Vref/1023 or Vref / 1024
ExperimenterUK
Sat May 23 2015, 08:54 PM
@utpal.. Create a thread in the Pic forum
Thu May 21 2015, 01:04 AM
utpal
i am a hobbist. i work on 8051. just i have started with pic 16f877. but a bitter experiance is going on. as i am programming any code to my pic877 and putting it in my board and it is working, but the 2nd time it is not taking any program,I have experimented just 7 new one pic mcus. result is the same. please tell me the reason. my programmer is TOP3000(universal programmer).
ajay_bhargav
Wed May 20 2015, 04:48 AM
@lak you can use the same code provided you are not using any s52 specific ports and registers.
Mon May 18 2015, 05:58 AM
lak
i used to develop a code for at89s52 shall i use the same code for at89c4051
Sun May 17 2015, 07:57 AM
Ayoosh
what if i have to rotate motor continuously at a step angle of 1.8 degree
ExperimenterUK
Fri May 15 2015, 06:02 PM
@oracle1946.. Post your question in the PIC forum
Fri May 15 2015, 03:48 AM
nadeem232
if some has solution kindly share solution Principles of Electric Circuits,by Thomas L. Floyd
oracle1946
Thu May 14 2015, 03:39 PM
I want to build a PIC16F684 sun logger using either a solar cell (0.5v solar cell or photoresistor). Any help out there?

Downloads

Comments

vipinpathakg
Wed May 27 2015, 05:57 AM
MuhammadTanvir
Sun May 24 2015, 11:02 AM
as_rog
Sun May 17 2015, 08:00 AM
oracle1946
Thu May 14 2015, 03:34 PM
kakaru32
Tue May 12 2015, 04:29 PM
Yateesh
Sat May 09 2015, 02:46 AM
scmg
Fri May 08 2015, 06:40 PM
OMERO
Fri May 08 2015, 11:53 AM

Online

Guests: 57, Members: 0 ...

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

Members: 37662
Newest member: vipinpathakg
Forum Activity
vipinpathakg Avatar
Posted By vipinpathakg
Wed May 27 2015, 06:28 AM
I have created all the hardware of 5x7 LED Dotmatr...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon May 25 2015, 06:16 PM
We need to do some simple tests.Get the speaker to...
mayank058 Avatar
Posted By mayank058
Mon May 25 2015, 04:57 AM
Dear sir, I am taking output from PI...
MuhammadTanvir Avatar
Posted By MuhammadTanvir
Sun May 24 2015, 11:11 AM
Hey guys !! Can somebody please share the proteus ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat May 23 2015, 09:52 PM
Does the speaker work?.'Exactly' where on the boa...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat May 23 2015, 09:44 PM
For all your questions there is a proper, very tec...
mayank058 Avatar
Posted By mayank058
Thu May 21 2015, 04:46 AM
dear sir there is nothing to zip.I just...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed May 20 2015, 04:57 AM
can you zip your complete project and attach it he...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed May 20 2015, 04:46 AM
If you know how to drive 7-seg using an 8-bit port...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed May 20 2015, 04:42 AM
There was no proteus file included in the package,...