Embedded Diploma: Prepared by Sameh Afifi
Embedded Diploma: Prepared by Sameh Afifi
Embedded Diploma: Prepared by Sameh Afifi
LCDs contain characteristics, when electric current is applied to back ground. Liquid crystals do
not emit light by them selves' special crystals, which change their optical them, this makes them
visible, on a contrast like LEDs.
Therefore you need light to see them, usually the surrounding light is enough to read the
display, yet in case of dark environments it is hard to read the display.
Most LCDs therefore contain an optional backlight, to produce sufficient contrast, which makes
reading easy in dark environment
1. Character LCD
2. Graphical LCD
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.
◦ Command mode: to shift data, set a specific location, clear screen …etc
0xc0: to start writing from 2nd line first place so 0xC1 writing on 2nd place until 0xcf
3. set En = 1 then wait 1 mille second, set En = 0, then wait 1 mille second.
5. set En = 1 then wait 1 mille second, set En = 0, then wait 1 mille second.
2. Convert 12 to ascii code “the result is 2 ascii number represent 12 which is 49 and 50”
Note:
You now have 2 number 1 and 2 which are 49 and 50 then send both of them
2. send 1110 to the 4 output pin and start to scan/check the value of the 4 input pin
3. if one of the 4 input pin is zero this mean you pressed on a keypad button, return the value of
this pressed button
4. repeat step 3 and 4 but change the output to be 1101, 1011, 0111 and so on….
2. To display a number on the first seven segment put En1 = 1, En2 = 0 and put the number
on the 4 pins
3. To display a number on the second seven segment put En2 = 1, En1 = 0 and put the
number on the 4 pins
4. To display a two digits number put the first digit on the 4 pin then En1=1, En2=0, wait 1 ms,
then put second digit on the 4 pins and En1=0, En2=1 then wait 1ms and put this steps in a
loop to be repeated.
Facebook: https://www.facebook.com/Same7Afifi
linkedIn: https://www.linkedin.com/in/sameh-afifi-8389173a/
Phone: 01127346781