1. A.D.Patel institute of technology
Sub : LCD and Keyboard interfacing with AVR.
prepared by,
chokshi abhi p (130010111001)
Guided by ,
Prof. Asif Thakor .
2. contents
Introduction to AVR Board.
Introduction to LCD .
Introduction to Keyboard.
Connection diagram.
Program.
Conclusion.
3. Introduction to AVR Board.
We have AVR general purpose mother board which is shown in fig 1.1
It has Microcontroller AVR ATMEGA32 which is very power full controller
with 4 PORTS on board. We can use female header to connect any device with
Board.
This Board is USBISP compatible that means we can program our IC by using
simple USBASP AVR Programmer, Just Connect ISP pin to the board and
connect to PC with suitable Driver and Program .hex File using any AVR Dude
Gui Programmer.
This Board has dual Power supply 1)By Adapter 2) By Connecting usbasp.
This Board has RS232 Port also that means we can Transfer data in full duplex
mode via PC To uC or uC to PC.
We will connect 2×2 Matrix keyboard to Port B0 1 2 3 and 16×2 LCD to
PORT D.
4.
5. Introduction to LCD.
Here we have 16×2 LCD
It has 2lines and 16charachters per each line
LCD has 16 Pin in that
Pin 1,2,3:It is VSS GND and VCC,Vcc=5V,VSS=GND=0V.
Pin 4,5,6:It is RS ,R/W and EN
Give Rs=0 for command Register.
Rs=1 for Data register.
R/w=0 For writing data into register
En=Falling edge to enable latch.
Pin 7-14:Data Pins.
Pin 15,16:LCD back light.
8. As Shown in fig the it is 4by4 matrix keyboard as shown in fig to scan
which key has been pressed first we have to give a 0000 to all raws and
check any key has been pressed by columns by scanning 1 if condition false
then give 20ms debouncing time period and give again 0000 to all raws and
scan whether any key has been pressed.
To scan all keys follow the below steps
First make B0pin =0 and B1 pin=1 and scan Pin B2 and B3.
If pinb2 =0 and pinb3=1 it will be print ‘0’ on screen of LCD.
If pinb2=1 and pinb3=0 it will be print ‘1’ on screen of LCD.
Second make B0 pin=1and B1 pin=0 and scan Pin B2 and B3.
If pinb2 =0 and pinb3=1 it will be print ‘2’ on screen of LCD.
If pinb2=1 and pinb3=0 it will be print ‘3’ on screen of LCD.