Introduction to 4-bit Mode

Till now whatever we discussed in the previous part of ths LCD tutorial, we were dealing with 8-bit mode. Now we are going to learn how to use LCD in 4-bit mode. There are many reasons why sometime we prefer to use LCD in 4-bit mode instead of 8-bit. One basic reason is lesser number of pins are needed to interface LCD.

In 4-bit mode the data is sent in nibbles, first we send the higher nibble and then the lower nibble. To enable the 4-bit mode of LCD, we need to follow special sequence of initialization that tells the LCD controller that user has selected 4-bit mode of operation. We call this special sequence as resetting the LCD. Following is the reset sequence of LCD.
  1. Wait for abour 20mS
  2. Send the first init value (0x30)
  3. Wait for about 10mS
  4. Send second init value (0x30)
  5. Wait for about 1mS
  6. Send third init value (0x30)
  7. Wait for 1mS
  8. Select bus width (0x30 - for 8-bit and 0x20 for 4-bit)
  9. Wait for 1mS

The busy flag will only be valid after the above reset sequence. Usually we do not use busy flag in 4-bit mode as we have to write code for reading two nibbles from the LCD. Instead we simply put a certain ammount of delay usually 300 to 600uS. This delay might vary depending on the LCD you are using, as you might have a different crystal frequency on which LCD controller is running. So it actually depends on the LCD module you are using. So if you feel any problem running the LCD, simply try to increase the delay. This usually works. For me about 400uS works perfect.

LCD connections in 4-bit Mode




Above is the connection diagram of LCD in 4-bit mode, where we only need 6 pins to interface an LCD. D4-D7 are the data pins connection and Enable and Register select are for LCD control pins. We are not using Read/Write (RW) Pin of the LCD, as we are only writing on the LCD so we have made it grounded permanently. If you want to use it.. then you may connect it on your controller but that will only increase another pin and does not make any big difference. Potentiometer RV1 is used to control the LCD contrast. The unwanted data pins of LCD i.e. D0-D3 are connected to ground.

LCD connections in 4-bit Mode

We will now look into the common steps to send data/command to LCD when working in 4-bit mode. As i already explained in 4-bit mode data is sent nibble by nibble, first we send higher nibble and then lower nibble. This means in both command and data sending function we need to saperate the higher 4-bits and lower 4-bits.


The common steps are:
  1. Mask lower 4-bits
  2. Send to the LCD port
  3. Send enable signal
  4. Mask higher 4-bits
  5. Send to LCD port
  6. Send enable signal

We are done with the theory part now, In the next section we will take a look at the programming microcontroller to control LCD in 4-bit mode.

Share it! Like it!

Conversation

hareeshchamiyar
Thu Mar 29 2018, 10:47 AM
please help me for the configuration bits for dspic30f2010
hareeshchamiyar
Thu Mar 29 2018, 10:45 AM
can any one using dspic30f2010.
Thu Mar 29 2018, 06:03 AM
Neena
can anybody give solar tracking in 8051 using proteus and keil to mail [email protected]
ExperimenterUK
Mon Mar 19 2018, 07:33 PM
sorry bedo.. maybe next time
Sun Mar 18 2018, 07:48 AM
Mourya Manojkumar
Please send me circuit diagram and PCB diagram
Thu Mar 01 2018, 05:49 AM
Felixc
May you please help me with a code for programmable load shedding controlling 4 loads
Sun Feb 25 2018, 08:29 PM
ezeoke.charles
i need of it
Sat Feb 24 2018, 03:35 AM
Aaquib
I want help for digital ic tester
ExperimenterUK
Tue Feb 20 2018, 04:01 PM
Join up.. and post your problem
Mon Feb 19 2018, 11:17 AM
ashishkumar
i needs help for my project

Downloads

Comments

jamiel
Sat Apr 14 2018, 12:47 AM
akrepkral76
Wed Apr 04 2018, 07:51 PM
samanthaeaves
Mon Apr 02 2018, 06:27 AM
rana2056
Sat Mar 31 2018, 02:11 PM
Darshanparabbnb
Mon Mar 26 2018, 07:17 AM
marttinsmarcio
Sat Mar 24 2018, 12:31 PM
LAMBO
Tue Mar 20 2018, 09:51 AM
bedo123
Mon Mar 19 2018, 07:48 AM

Online

Guests: 47, Members: 0 ...

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

Members: 37993
Newest member: jamiel
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Apr 16 2018, 08:49 PM
On the diagram, a diode feeds a rectified sine wav...
LAMBO Avatar
Posted By LAMBO
Mon Apr 16 2018, 06:39 AM
Hi sir i haven't connected any serial connec...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Apr 13 2018, 02:09 AM
I assume you are doing this project.http://www.805...
LAMBO Avatar
Posted By LAMBO
Thu Apr 12 2018, 06:51 PM
hii sir,I am working on ac motor controller .I hav...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Apr 10 2018, 06:12 PM
The lpc214x has a 32-bit prescaler , so I would ...
Praneeth1299 Avatar
Posted By Praneeth1299
Tue Apr 10 2018, 09:16 AM
Hi,I'm generating constant frequency of 1hz and va...
akrepkral76 Avatar
Posted By akrepkral76
Sat Apr 07 2018, 01:57 PM
I have used diptrace.I think ı have recevied from ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Apr 07 2018, 01:45 AM
You will need to say which software you are using,...
akrepkral76 Avatar
Posted By akrepkral76
Fri Apr 06 2018, 12:22 PM
I have drawed many PCB board. But it is still not ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Apr 04 2018, 10:49 PM
Do you have a working HM2007 board as shown in the...