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
Tue Jul 19 2016, 05:59 PM
@mhammad 64 bits is 8 bytes.
Tue Jul 19 2016, 07:56 AM
mhammad kassem
hello! i want to know how to use UART in mikroc , I want to receive 64 bits from another microcontroller and i dont know how to start my code to receive the 64 bits...any help?
ExperimenterUK
Mon Jul 18 2016, 08:32 PM
@meena.. are you still having trouble ?
Sat Jul 16 2016, 10:19 AM
Meena
problem in loading email address while registering.Please help
Sun Jul 10 2016, 02:50 PM
shockwave
could you please provide a sample code that controling LED using bluetooth HC-05 interfacing pic16f877a thank you!
Sun Jul 10 2016, 02:49 PM
shockwave
Help!
ExperimenterUK
Sat Jul 09 2016, 05:25 PM
@Santhana krishnan post in forum to discuss your problem
Thu Jul 07 2016, 09:26 AM
Santhana krishnan
Hi i program atmega 32 it was functiining corectly but now aref pins voltage 2.56 is droped to .85 volts also a ports input viltage also dropped so anologe inpit not funcitonig please help me to find out the problem
Thu Jul 07 2016, 09:24 AM
Santhana krishnan
Hi i program the atmega 32
Thu Jul 07 2016, 09:24 AM
Santhana krishnan
Hi

Downloads

Comments

adithyapaip
Thu Jul 21 2016, 05:45 PM
celu
Thu Jul 21 2016, 05:27 PM
Aiko
Wed Jul 20 2016, 01:51 PM
JorgeG
Sat Jul 16 2016, 07:19 PM
Piotrekk
Wed Jul 06 2016, 09:35 AM
dyoussef
Wed Jun 29 2016, 07:29 PM
sung7333
Tue Jun 28 2016, 06:23 AM
Bonolai
Fri Jun 24 2016, 06:02 AM

Online

Guests: 47, Members: 0 ...

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

Members: 37775
Newest member: adithyapaip
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Jul 23 2016, 07:14 PM
I found this datasheet, it is a type of driver.It ...
Piotrekk Avatar
Posted By Piotrekk
Fri Jul 22 2016, 10:12 AM
I found an old box of electronic components in the...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Jul 21 2016, 07:37 PM
That is curious, but very likely a co-incidence.Th...
adithyapaip Avatar
Posted By adithyapaip
Thu Jul 21 2016, 07:18 PM
I am using keil to do everthing in 8051,when I was...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Jul 21 2016, 07:14 PM
By far the easiest and cheapest way to talk to the...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Jul 21 2016, 07:04 PM
The crystal on the programmer does not affect the ...
adithyapaip Avatar
Posted By adithyapaip
Thu Jul 21 2016, 06:06 PM
Hi Guys..i have a 8051 programmer which has 4mhz c...
Aiko Avatar
Posted By Aiko
Wed Jul 20 2016, 01:56 PM
ankitbajaj01 Avatar
Posted By ankitbajaj01
Wed Jul 20 2016, 04:49 AM
Dear All,Greetings!!!I want to develop Online moni...
sairfan1 Avatar
Posted By sairfan1
Tue Jul 19 2016, 09:56 PM
Now a days there are many smart locks available li...