SlideShare a Scribd company logo
1 of 15
A.D.Patel institute of technology
 Sub : LCD and Keyboard interfacing with AVR.
prepared by,
chokshi abhi p (130010111001)
Guided by ,
Prof. Asif Thakor .
contents
 Introduction to AVR Board.
 Introduction to LCD .
 Introduction to Keyboard.
 Connection diagram.
 Program.
 Conclusion.
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.
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.
Introduction to Keyboard
 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.
schematic
Inside LCD1.h File
 void lcd_command(unsigned char
z)
{
PORTD=z;
msdelay(1);
PORTB&=~(1<<5);
msdelay(1);
PORTB&=~(1<<6);
msdelay(1);
PORTB|=(1<<7);
msdelay(1);
PORTB&=~(1<<7);
msdelay(1);
}
 void lcd_data(unsigned char m)
{
PORTD=m;
msdelay(1);
PORTB=1;
msdelay(1);
PORTB&=~(1<<6);
msdelay(1);
PORTD|=(1<<7);
msdelay(1);
PORTD&=~(1<<7);
msdelay(1);
}
 void lcd_init(void)
{
DDRD=DDRB=0XFF;
msdelay(1);
lcd_command(0X38);
msdelay(1);
lcd_command(0X0E);
msdelay(1);
lcd_command(0X01);
msdelay(1);
}
 void lcd_string(unsigned char s[])
{
unsigned char i=0,j=0X80,k;
k=strlen(s);
for(i=0;i<k;i++)
{
lcd_command(j);
msdelay(1);
lcd_data(s[i]);
msdelay(1);
j++;
}
return(0);
}
Main Program
 #include<avr/io.h>
#include "lcd1.h"
void check(unsigned char m)
int main()
{
lcd_init();
unsigned char raw;
unsigned char t[2][2]={'0','1',
'2','3'};
while(1)
{
PORTB&=0XFC;
while((PINB&0X0C)==0X0C);
msdelay(20);
while((PINB&0X0C)==0X0C);
raw=0;
PORTB&=~(1<<0);
PORTB|=(1<<1);
check(raw);
raw=1;
PORTB&=~(1<<1);
PORTB|=(1<<0);
check(raw);
}
}
Check function
 void check(unsigned char m)
{
if((PINB&0X0C)==0X08)
{
lcd_command(0X80);
lcd_data(t[m][0]);
}
if((PINB&0X0C)==0X04)
{
lcd_command(0X80);
lcd_data(t[m][1]);
}
}
Conclusion
 From this we have seen that as we press key that corresponding key will
displayed on LCD display as ‘0’ ‘1’ ‘2’ ‘3’ etc.
Thank you

More Related Content

What's hot

Decoders and encoders
Decoders and encodersDecoders and encoders
Decoders and encoderssanket1996
 
Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)Tony Olsson.
 
Key board interfacing with 8051
Key board interfacing with 8051Key board interfacing with 8051
Key board interfacing with 8051DominicHendry
 
Bcd to 7 segment display
Bcd to 7 segment displayBcd to 7 segment display
Bcd to 7 segment displayMaulik Sanchela
 
RF Encoder / Decoder Chipset
RF Encoder / Decoder ChipsetRF Encoder / Decoder Chipset
RF Encoder / Decoder ChipsetPremier Farnell
 
Robotics Session day 1
Robotics Session day 1Robotics Session day 1
Robotics Session day 1Afzal Ahmad
 
Lcd interfacing with microprocessor 8051
Lcd interfacing with microprocessor 8051Lcd interfacing with microprocessor 8051
Lcd interfacing with microprocessor 8051Hasnain Yaseen
 
22 microcontroller programs
22 microcontroller programs22 microcontroller programs
22 microcontroller programsbabak danyal
 
Report no.3(microprocessor)
Report no.3(microprocessor)Report no.3(microprocessor)
Report no.3(microprocessor)Ronza Sameer
 
decorder and encoder and its applications
decorder and encoder and its applicationsdecorder and encoder and its applications
decorder and encoder and its applicationssafia safreen
 
Physical prototyping lab3-serious_serial
Physical prototyping lab3-serious_serialPhysical prototyping lab3-serious_serial
Physical prototyping lab3-serious_serialTony Olsson.
 
Types of encoders and decoders with truth tables
Types of encoders and decoders with truth tablesTypes of encoders and decoders with truth tables
Types of encoders and decoders with truth tablesAbdullah khawar
 

What's hot (20)

Lcd & keypad
Lcd & keypadLcd & keypad
Lcd & keypad
 
11111111111
1111111111111111111111
11111111111
 
Decoders and encoders
Decoders and encodersDecoders and encoders
Decoders and encoders
 
Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
 
Arduino Modules
Arduino ModulesArduino Modules
Arduino Modules
 
Smart home arduino
Smart home   arduinoSmart home   arduino
Smart home arduino
 
Key board interfacing with 8051
Key board interfacing with 8051Key board interfacing with 8051
Key board interfacing with 8051
 
Bcd to 7 segment display
Bcd to 7 segment displayBcd to 7 segment display
Bcd to 7 segment display
 
Seven Segment Decoders
Seven Segment DecodersSeven Segment Decoders
Seven Segment Decoders
 
RF Encoder / Decoder Chipset
RF Encoder / Decoder ChipsetRF Encoder / Decoder Chipset
RF Encoder / Decoder Chipset
 
LCD interfacing
LCD interfacingLCD interfacing
LCD interfacing
 
Robotics Session day 1
Robotics Session day 1Robotics Session day 1
Robotics Session day 1
 
Lcd interfacing with microprocessor 8051
Lcd interfacing with microprocessor 8051Lcd interfacing with microprocessor 8051
Lcd interfacing with microprocessor 8051
 
22 microcontroller programs
22 microcontroller programs22 microcontroller programs
22 microcontroller programs
 
Report no.3(microprocessor)
Report no.3(microprocessor)Report no.3(microprocessor)
Report no.3(microprocessor)
 
decorder and encoder and its applications
decorder and encoder and its applicationsdecorder and encoder and its applications
decorder and encoder and its applications
 
Basic standard calculator
Basic standard calculatorBasic standard calculator
Basic standard calculator
 
Physical prototyping lab3-serious_serial
Physical prototyping lab3-serious_serialPhysical prototyping lab3-serious_serial
Physical prototyping lab3-serious_serial
 
Types of encoders and decoders with truth tables
Types of encoders and decoders with truth tablesTypes of encoders and decoders with truth tables
Types of encoders and decoders with truth tables
 

Viewers also liked

Capitulo 8 control interno
Capitulo 8 control internoCapitulo 8 control interno
Capitulo 8 control internoDianna10
 
Procedimientos y técnicas de auditoria, control interno de examenes a las exi...
Procedimientos y técnicas de auditoria, control interno de examenes a las exi...Procedimientos y técnicas de auditoria, control interno de examenes a las exi...
Procedimientos y técnicas de auditoria, control interno de examenes a las exi...Solo Yo Willians Quispe Q
 
Sistema de control interno
Sistema de control internoSistema de control interno
Sistema de control internodrosca
 
Presentación control interno
Presentación control internoPresentación control interno
Presentación control internoAbrahamfelipe1
 
Control interno
Control internoControl interno
Control internojennika58
 
Sistemas de control interno
Sistemas de control internoSistemas de control interno
Sistemas de control internoAAX 21
 

Viewers also liked (10)

Capitulo 8 control interno
Capitulo 8 control internoCapitulo 8 control interno
Capitulo 8 control interno
 
Control interno
Control internoControl interno
Control interno
 
Mci updated ppt
Mci updated pptMci updated ppt
Mci updated ppt
 
Procedimientos y técnicas de auditoria, control interno de examenes a las exi...
Procedimientos y técnicas de auditoria, control interno de examenes a las exi...Procedimientos y técnicas de auditoria, control interno de examenes a las exi...
Procedimientos y técnicas de auditoria, control interno de examenes a las exi...
 
Control interno
Control internoControl interno
Control interno
 
Sistema de control interno
Sistema de control internoSistema de control interno
Sistema de control interno
 
Presentación control interno
Presentación control internoPresentación control interno
Presentación control interno
 
Control interno
Control internoControl interno
Control interno
 
Control interno power point
Control interno power pointControl interno power point
Control interno power point
 
Sistemas de control interno
Sistemas de control internoSistemas de control interno
Sistemas de control interno
 

Similar to Mci ppt

Micro c lab6(lcd)
Micro c lab6(lcd)Micro c lab6(lcd)
Micro c lab6(lcd)Mashood
 
Ps2 keyboard read display system
Ps2 keyboard read display systemPs2 keyboard read display system
Ps2 keyboard read display systemWanita Long
 
Arduino frequency counter
Arduino frequency counterArduino frequency counter
Arduino frequency counternasyith_hananur
 
Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2SANTIAGO PABLO ALBERTO
 
ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)Brian Huang
 
Display Characters of a String one by One on a 7 Segment Display
Display Characters of a String one by One on a 7 Segment DisplayDisplay Characters of a String one by One on a 7 Segment Display
Display Characters of a String one by One on a 7 Segment DisplayRihab Rahman
 
Customizable Microprocessor design on Nexys 3 Spartan FPGA Board
Customizable Microprocessor design on Nexys 3 Spartan FPGA BoardCustomizable Microprocessor design on Nexys 3 Spartan FPGA Board
Customizable Microprocessor design on Nexys 3 Spartan FPGA BoardBharat Biyani
 
Project_report_on_Attendance_system
 Project_report_on_Attendance_system Project_report_on_Attendance_system
Project_report_on_Attendance_systemAmi Goswami
 
Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACnanocdac
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseElaf A.Saeed
 
Display a Character on a 7 Segment Display
Display a Character on a 7 Segment DisplayDisplay a Character on a 7 Segment Display
Display a Character on a 7 Segment DisplayRihab Rahman
 
AVR_Course_Day5 avr interfaces
AVR_Course_Day5 avr interfacesAVR_Course_Day5 avr interfaces
AVR_Course_Day5 avr interfacesMohamed Ali
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptxHebaEng
 
Lcd interface with atmega32 avr best.ppt
Lcd interface with atmega32 avr best.pptLcd interface with atmega32 avr best.ppt
Lcd interface with atmega32 avr best.pptSoumyaGupta836456
 

Similar to Mci ppt (20)

Micro c lab6(lcd)
Micro c lab6(lcd)Micro c lab6(lcd)
Micro c lab6(lcd)
 
Ps2 keyboard read display system
Ps2 keyboard read display systemPs2 keyboard read display system
Ps2 keyboard read display system
 
Arduino based applications part 2
Arduino based applications part 2Arduino based applications part 2
Arduino based applications part 2
 
Arduino frequency counter
Arduino frequency counterArduino frequency counter
Arduino frequency counter
 
Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2Microcontroladores: El microcontrolador 8051 con LCD 16x2
Microcontroladores: El microcontrolador 8051 con LCD 16x2
 
ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)ATTiny Light Sculpture Project - Part I (Setup)
ATTiny Light Sculpture Project - Part I (Setup)
 
Display Characters of a String one by One on a 7 Segment Display
Display Characters of a String one by One on a 7 Segment DisplayDisplay Characters of a String one by One on a 7 Segment Display
Display Characters of a String one by One on a 7 Segment Display
 
Customizable Microprocessor design on Nexys 3 Spartan FPGA Board
Customizable Microprocessor design on Nexys 3 Spartan FPGA BoardCustomizable Microprocessor design on Nexys 3 Spartan FPGA Board
Customizable Microprocessor design on Nexys 3 Spartan FPGA Board
 
Project_report_on_Attendance_system
 Project_report_on_Attendance_system Project_report_on_Attendance_system
Project_report_on_Attendance_system
 
Hd44780a00 dtasheet
Hd44780a00 dtasheetHd44780a00 dtasheet
Hd44780a00 dtasheet
 
Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDAC
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
 
LCD (2).pptx
LCD (2).pptxLCD (2).pptx
LCD (2).pptx
 
Display a Character on a 7 Segment Display
Display a Character on a 7 Segment DisplayDisplay a Character on a 7 Segment Display
Display a Character on a 7 Segment Display
 
Lcd interfacing1
Lcd interfacing1Lcd interfacing1
Lcd interfacing1
 
AVR_Course_Day5 avr interfaces
AVR_Course_Day5 avr interfacesAVR_Course_Day5 avr interfaces
AVR_Course_Day5 avr interfaces
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
Switch Control and Time Delay - Keypad
Switch Control and Time Delay - KeypadSwitch Control and Time Delay - Keypad
Switch Control and Time Delay - Keypad
 
Interfacing with LCD
Interfacing with LCDInterfacing with LCD
Interfacing with LCD
 
Lcd interface with atmega32 avr best.ppt
Lcd interface with atmega32 avr best.pptLcd interface with atmega32 avr best.ppt
Lcd interface with atmega32 avr best.ppt
 

More from Kushagra Ganeriwal (12)

Fm generation
Fm generationFm generation
Fm generation
 
7 segment interface with avr microcontroller
7 segment interface with avr microcontroller7 segment interface with avr microcontroller
7 segment interface with avr microcontroller
 
History of computer crime
History of computer crimeHistory of computer crime
History of computer crime
 
Conductors
ConductorsConductors
Conductors
 
Curl
CurlCurl
Curl
 
Coulomb's law and its applications
Coulomb's law and its applicationsCoulomb's law and its applications
Coulomb's law and its applications
 
Wireshark
WiresharkWireshark
Wireshark
 
Noise
NoiseNoise
Noise
 
Interfacing ultrasonic rangefinder with avr mc us
Interfacing ultrasonic rangefinder with avr mc usInterfacing ultrasonic rangefinder with avr mc us
Interfacing ultrasonic rangefinder with avr mc us
 
electronic mixer
electronic mixerelectronic mixer
electronic mixer
 
auditorium
auditoriumauditorium
auditorium
 
Prac3 LOUDSPEAKER
Prac3 LOUDSPEAKERPrac3 LOUDSPEAKER
Prac3 LOUDSPEAKER
 

Recently uploaded

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 

Recently uploaded (20)

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 

Mci ppt

  • 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.
  • 6.
  • 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.
  • 10. Inside LCD1.h File  void lcd_command(unsigned char z) { PORTD=z; msdelay(1); PORTB&=~(1<<5); msdelay(1); PORTB&=~(1<<6); msdelay(1); PORTB|=(1<<7); msdelay(1); PORTB&=~(1<<7); msdelay(1); }  void lcd_data(unsigned char m) { PORTD=m; msdelay(1); PORTB=1; msdelay(1); PORTB&=~(1<<6); msdelay(1); PORTD|=(1<<7); msdelay(1); PORTD&=~(1<<7); msdelay(1); }
  • 11.  void lcd_init(void) { DDRD=DDRB=0XFF; msdelay(1); lcd_command(0X38); msdelay(1); lcd_command(0X0E); msdelay(1); lcd_command(0X01); msdelay(1); }  void lcd_string(unsigned char s[]) { unsigned char i=0,j=0X80,k; k=strlen(s); for(i=0;i<k;i++) { lcd_command(j); msdelay(1); lcd_data(s[i]); msdelay(1); j++; } return(0); }
  • 12. Main Program  #include<avr/io.h> #include "lcd1.h" void check(unsigned char m) int main() { lcd_init(); unsigned char raw; unsigned char t[2][2]={'0','1', '2','3'}; while(1) { PORTB&=0XFC; while((PINB&0X0C)==0X0C); msdelay(20); while((PINB&0X0C)==0X0C); raw=0; PORTB&=~(1<<0); PORTB|=(1<<1); check(raw); raw=1; PORTB&=~(1<<1); PORTB|=(1<<0); check(raw); } }
  • 13. Check function  void check(unsigned char m) { if((PINB&0X0C)==0X08) { lcd_command(0X80); lcd_data(t[m][0]); } if((PINB&0X0C)==0X04) { lcd_command(0X80); lcd_data(t[m][1]); } }
  • 14. Conclusion  From this we have seen that as we press key that corresponding key will displayed on LCD display as ‘0’ ‘1’ ‘2’ ‘3’ etc.