Showing posts with label Project work. Show all posts
Showing posts with label Project work. Show all posts

Wednesday, April 16, 2014

INTERFACING OF 4x4 KEYPAD TO MICROCONTROLLER


INTERFACING OF 4x4 KEYPAD TO MICROCONTROLLER
  • Interfacing of microcontroller to 4x4 Keypad is very simple.
  • The Simple logic behind this is just scan all the key in the matrix.
  • Let assume 4 line are output and 4 lines are input.
  • Columns are input.
  • Row are output.





C1
C2
C3
C4
R1
0
1
2
3
R2
4
5
6
7
R3
8
9
A
B
R4
C
D
E
F


          C = Columns
          R = Rows
























Case 0:

C1
C2
C3
C4
R1
0
1
1
1
R2
1
1
1
1
R3
1
1
1
1
R4
1
1
1
1
  •  When Row and Column are shorted then it is accepted as Key Pressed Now C1 & R1 = 0.
  • That means “0”. 







Case 15:

C1
C2
C3
C4
R1
0
1
1
1
R2
1
1
1
1
R3
1
1
1
1
R4
1
1
1
0
  •  When Row and Column are shorted then it is accepted as Key Pressed Now C4 & R4 = 0.
  • That means “F”.








Similarly all other Keys are checked. While pressed we must wait to 20msec i.e. Debounce effect of switch button or key. If Still key is pressed then it’s assumed as key pressed and Equivalent value is displayed.























Thank you and for any queries do comment .....

For Program download it below link:
For LCD : Click for Code
For Keyboard : Click for code
For Videos on Above Program : Click on the Link






Wednesday, April 2, 2014

INTERFACING OF LCD IN 4-BIT MODE USING MICROCONTROLLER


INTERFACING OF LCD IN 4-BIT MODE USING MICRO-CONTROLLER

In this method of Interfacing LCD to Microcontroller using 4-bit mode is to reduce the usage of pin.

Mostly the Circuit having multiple function uses this method.

In this method PORT0 of UC is connected to LCD as Follows:

P0.0 => rs;    Register select Pin
P0.1 => en;  Enable Pin
P0.4 => D4;  data line
P0.5 => D5;         “
P0.6 => D6;         “
P0.7 => D7;         “

In method we use same port for control pin as well as data line. So each data is send by breaking it into two 4bit part.

To initialize LCD in this method a command used is 0x28

Which means 16 x 2 LCD in 4-bit mode.

Before doing that we should send a sequence of 0x30, 0x30, and 0x20.

To send this we use only cmd_hf function which send only 3, 3, and 2 as sequence to LCD to enable in 4-Bit mode.

To send each data we should first clear the higher order bit i.e. from P0.4 – P0.7

And masking the input is properly shown in video.

  • We should mask Higher bit and rest all bit are clear.
  •  We send by latching.
  • We should now mask lower bit and send to UC.




This is how a 4-Bit mode LCD works.
Thank you for reading.
Plz Do share and Subscribe.

Source Code: click for code
For Videos on this Example: Click on the link








Saturday, February 8, 2014

DISPLAYING CUSTOMIZED CHARACTER USING CGROM IN LCD DISPLAY LM016L


DISPLAYING CUSTOMIZED CHARACTER USING CGROM IN LCD DISPLAY LM016L

CGROM – Character Generator ROM
In LCD display we have seen that, when we send ASCII value it directly display.
Actually the CGROM has all ASCII value store in it. So when we send any ASCII value it compare it with CGROM and displays it.
A user defined Character Patterns can also be generated using mask-programmed ROM.
To Generate a Customized Character like Symbol, smiley etc.
We use 5x8 dot matrix to generate a symbol.


Don’t Care
    5 COLUMN
Hex value

R
O
W
0
0
0
0
X
X
X
0
0x0E
0
0
0
X
X
X
X
X
0x1F
0
0
0
X
0
0
0
X
0x11
0
0
0
X
0
0
0
X
0x11
0
0
0
X
0
0
0
X
0x11
0
0
0
X
0
0
0
X
0x11
0
0
0
X
X
X
X
X
0x1F
0
0
0
X
X
X
X
X
0x1F










X= 1;
0 = 0;



Higher 3-bit are don’t care because the data send is 8bit
So we use addition 3-bits a predefined 0 and rest of 5 bit are the 5 columns and 8 row are used to defined each row and column in the display.
X indicates that the bit is 1.
0 indicates the bit as 0.


In 5x8 matrix only the higher 3 bit are don’t care.















The symbol Created is a Battery symbol. We can generator many type of symbol using mask-programmed ROM (CGROM location that are unused)

The Hex value created for symbol must be place in CGROM location 40H.
The 40H memory has 8 addressable location from 00 to 07.





















And while displaying we should mention addressable location of 40H that are storing 8-byte data in each location from 0x00 to 0x07.

Each location i.e. 0x00 hold 8-byte data. 

Any Queries Do Comment...

For videos on the above example: click on the link