SlideShare a Scribd company logo
1 of 15
Interface LCD with PIC
EMBEDDED SYSTEM DESIGN & IoT-Master Class
DAY 24
What You will learn Today?
ļƒ¼Overview of LCD
ļƒ¼Interface LCD with PIC
Mindset Lesson for the Day
Words has power to Create
And Power to destroy.
Embedded System Design using PIC
ā€¢40pin-SIF Socket
ā€¢8 Nos. Point LEDs (Logic Output)
ā€¢8 Nos. Digital Input (DIP Switch)
ā€¢4x4 Matrix Keypad
ā€¢2X16 Character LCD (Background Light)
ā€¢4 Nos. 7-Segment Display
ā€¢2 Nos. Analog Input (Potentiometer)
ā€¢Temperature Sensor (LM35)
ā€¢Stepper Motor Interface
ā€¢2 Nos. of SPST Relay
ā€¢DS1307 RTC with Batter-Backup
ā€¢USART(RS232)
ā€¢USB 2.0 Enabled Programmer
ā€¢Interrupts Study, Reset Button
ā€¢SPI ā€“ EEPROM.25C040
ā€¢I2C EEPROM 24C04
ā€¢Digital Temperature Sensor(DS18S20)
ā€¢4x10-Pin Expansion Connector
ā€¢Piezo Electric Buzzer
PIC PIN Diagram
PIN Details of LCD
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
Character Display LCD
0011 0001 -Xā€31ā€
0011 0010 -Xā€32ā€
COMMAND CODES
Schematic Diagram of LCD
Header File and Declarations
#include<pic.h> //Define PIC Registers
#include<stdio.h> //Define I/O Functions
__CONFIG(0x3f72);
#define RS RE0 //LCD Register Select
#define RW RE1 //LCD Read/Write Pin
#define EN RE2 //LCD Enable Pin
#define DATA PORTD //LCD Data Port
#define DATADIR TRISD //LCD Data Port Direction Register
#define CNTRLDIR TRISE //RS,RW,EN Direction Register
void lcdinit(void); //LCD initialization Function
void lcdclr(void); //LCD Clear Function
void lcdcomd(unsigned char); //LCD Command Declaring Fucntion
void lcddata(unsigned char); //LCD Data Display Fucntion
void DelayMs(unsigned int);
Main
void main()
{
int i;
unsigned char First[]={" PIC DEV. BOARD "};
unsigned char Secnd[]={"LCD DEMO PROGRAM"};
DelayMs(500);
lcdinit();
DelayMs(500);
while(1)
{
lcdclr();
lcdcomd(0x80);
for(i=0;i<16;i++) //Display the Message
{
lcddata(First[i]);
DelayMs(50);
}
lcdcomd(0xc0);
for(i=0;i<16;i++) //Display the Message
{
lcddata(Secnd[i]);
DelayMs(50);
}
DelayMs(500);
}
}
LCD Initialization
void lcdinit(void)
{
int i;
unsigned char command[]={0x38,0x0c,0x06,0x01};
//LCD Command set for 8 bit Interface, 2 Lines, 5x7 Dots
ADCON1 = 0x07;
//Make PORTE Pin as Digital
CNTRLDIR = 0x00;
//Make LCD control port (PORTE) as output Port
DATADIR = 0x00;
DelayMs(50);
//Make LCD Data Port (PORTD) as output port
for(i=0;i<4;i++)
{
lcdcomd(command[i]);
//Send the Initialisation Commands
DelayMs(5);
}
DelayMs(500);
}
LCD COMMAND
void lcdclr(void)
//Send LCD clear command
{
lcdcomd(0x01);
DelayMs(2);
}
void lcdcomd(unsigned char cmd)
{
RS=0; RW=0;
//Select Command Register, R/W--write enabled
EN=1;
//Enable LCD to accept
commands
DATA=cmd;
EN=0;
DelayMs(5);
//Give a Pulse via Enable pin
}
LCD Data
void lcddata(unsigned char byte)
{
RS=1; RW=0;
//Select Data register, R/W--write
enabled
EN=1;
DATA=byte;
//Give a Pulse via Enable pin
EN=0;
DelayMs(5);
}
void DelayMs(unsigned int Ms)
{
int delay_cnst;
while(Ms>0)
{
Ms--;
for(delay_cnst = 0;delay_cnst <220;delay_cnst++);
}
}
www.pantechsolutions.net
For learning hub visit learn.pantechsolutions.net
Thank You

More Related Content

Similar to ESD -DAY 24.pptx

Embedded Systems using Microwave oven
Embedded Systems using  Microwave ovenEmbedded Systems using  Microwave oven
Embedded Systems using Microwave ovenBOOMIKAD
Ā 
student_pres120202final
student_pres120202finalstudent_pres120202final
student_pres120202finalJohn Marquis
Ā 
m.tech esd lab manual for record
m.tech esd lab manual for recordm.tech esd lab manual for record
m.tech esd lab manual for recordG Lemuel George
Ā 
2022-BEKM 3453 - LCD and keypad.pdf
2022-BEKM 3453 - LCD and keypad.pdf2022-BEKM 3453 - LCD and keypad.pdf
2022-BEKM 3453 - LCD and keypad.pdfVNEX
Ā 
Lcd tutorial for interfacing with microcontrollers basics of alphanumeric lc...
Lcd tutorial for interfacing with microcontrollers  basics of alphanumeric lc...Lcd tutorial for interfacing with microcontrollers  basics of alphanumeric lc...
Lcd tutorial for interfacing with microcontrollers basics of alphanumeric lc...mdkousik
Ā 
Pythonć«ć‚ˆć‚‹ć‚«ć‚¹ć‚æ惠åÆčƒ½ćŖ高位čØ­čØˆęŠ€č”“ (Design Solution Forum 2016@ꖰęØŖęµœ)
Pythonć«ć‚ˆć‚‹ć‚«ć‚¹ć‚æ惠åÆčƒ½ćŖ高位čØ­čØˆęŠ€č”“ (Design Solution Forum 2016@ꖰęØŖęµœ)Pythonć«ć‚ˆć‚‹ć‚«ć‚¹ć‚æ惠åÆčƒ½ćŖ高位čØ­čØˆęŠ€č”“ (Design Solution Forum 2016@ꖰęØŖęµœ)
Pythonć«ć‚ˆć‚‹ć‚«ć‚¹ć‚æ惠åÆčƒ½ćŖ高位čØ­čØˆęŠ€č”“ (Design Solution Forum 2016@ꖰęØŖęµœ)Shinya Takamaeda-Y
Ā 
Lcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogLcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogsumedh23
Ā 
Using ARM Dev.Board in physical experimental instruments
Using ARM Dev.Board in physical experimental instrumentsUsing ARM Dev.Board in physical experimental instruments
Using ARM Dev.Board in physical experimental instrumentsa_n0v
Ā 
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, NepalArduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepalbishal bhattarai
Ā 
ARM LCD Interfacing
ARM LCD Interfacing ARM LCD Interfacing
ARM LCD Interfacing Veera Kumar
Ā 
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
Ā 
microcontroller board ppt
microcontroller board pptmicrocontroller board ppt
microcontroller board pptshashank tiwari
Ā 
Rdl esp32 development board trainer kit
Rdl esp32 development board trainer kitRdl esp32 development board trainer kit
Rdl esp32 development board trainer kitResearch Design Lab
Ā 
Tft touch screen manufacturers
Tft touch screen manufacturersTft touch screen manufacturers
Tft touch screen manufacturersKeatonParker2
Ā 

Similar to ESD -DAY 24.pptx (20)

Embedded Systems using Microwave oven
Embedded Systems using  Microwave ovenEmbedded Systems using  Microwave oven
Embedded Systems using Microwave oven
Ā 
student_pres120202final
student_pres120202finalstudent_pres120202final
student_pres120202final
Ā 
m.tech esd lab manual for record
m.tech esd lab manual for recordm.tech esd lab manual for record
m.tech esd lab manual for record
Ā 
2022-BEKM 3453 - LCD and keypad.pdf
2022-BEKM 3453 - LCD and keypad.pdf2022-BEKM 3453 - LCD and keypad.pdf
2022-BEKM 3453 - LCD and keypad.pdf
Ā 
Basic standard calculator
Basic standard calculatorBasic standard calculator
Basic standard calculator
Ā 
Lcd tutorial for interfacing with microcontrollers basics of alphanumeric lc...
Lcd tutorial for interfacing with microcontrollers  basics of alphanumeric lc...Lcd tutorial for interfacing with microcontrollers  basics of alphanumeric lc...
Lcd tutorial for interfacing with microcontrollers basics of alphanumeric lc...
Ā 
Pythonć«ć‚ˆć‚‹ć‚«ć‚¹ć‚æ惠åÆčƒ½ćŖ高位čØ­čØˆęŠ€č”“ (Design Solution Forum 2016@ꖰęØŖęµœ)
Pythonć«ć‚ˆć‚‹ć‚«ć‚¹ć‚æ惠åÆčƒ½ćŖ高位čØ­čØˆęŠ€č”“ (Design Solution Forum 2016@ꖰęØŖęµœ)Pythonć«ć‚ˆć‚‹ć‚«ć‚¹ć‚æ惠åÆčƒ½ćŖ高位čØ­čØˆęŠ€č”“ (Design Solution Forum 2016@ꖰęØŖęµœ)
Pythonć«ć‚ˆć‚‹ć‚«ć‚¹ć‚æ惠åÆčƒ½ćŖ高位čØ­čØˆęŠ€č”“ (Design Solution Forum 2016@ꖰęØŖęµœ)
Ā 
Lcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilogLcd module interface with xilinx software using verilog
Lcd module interface with xilinx software using verilog
Ā 
Using ARM Dev.Board in physical experimental instruments
Using ARM Dev.Board in physical experimental instrumentsUsing ARM Dev.Board in physical experimental instruments
Using ARM Dev.Board in physical experimental instruments
Ā 
arduinoedit.pptx
arduinoedit.pptxarduinoedit.pptx
arduinoedit.pptx
Ā 
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, NepalArduino by bishal bhattarai  IOE, Pashchimanchal Campus Pokhara, Nepal
Arduino by bishal bhattarai IOE, Pashchimanchal Campus Pokhara, Nepal
Ā 
ARM LCD Interfacing
ARM LCD Interfacing ARM LCD Interfacing
ARM LCD Interfacing
Ā 
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
Ā 
Pic16 c7x
Pic16 c7xPic16 c7x
Pic16 c7x
Ā 
LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
Ā 
Lcd & keypad
Lcd & keypadLcd & keypad
Lcd & keypad
Ā 
microcontroller board ppt
microcontroller board pptmicrocontroller board ppt
microcontroller board ppt
Ā 
Microcontroller part 4
Microcontroller part 4Microcontroller part 4
Microcontroller part 4
Ā 
Rdl esp32 development board trainer kit
Rdl esp32 development board trainer kitRdl esp32 development board trainer kit
Rdl esp32 development board trainer kit
Ā 
Tft touch screen manufacturers
Tft touch screen manufacturersTft touch screen manufacturers
Tft touch screen manufacturers
Ā 

Recently uploaded

VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130Suhani Kapoor
Ā 
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...Suhani Kapoor
Ā 
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai DouxDubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Douxkojalkojal131
Ā 
WAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsWAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsCharles Obaleagbon
Ā 
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service AmravatiVIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
Ā 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxmirandajeremy200221
Ā 
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...Amil baba
Ā 
VIP Kolkata Call Girl Gariahat šŸ‘‰ 8250192130 Available With Room
VIP Kolkata Call Girl Gariahat šŸ‘‰ 8250192130  Available With RoomVIP Kolkata Call Girl Gariahat šŸ‘‰ 8250192130  Available With Room
VIP Kolkata Call Girl Gariahat šŸ‘‰ 8250192130 Available With Roomdivyansh0kumar0
Ā 
3D Printing And Designing Final Report.pdf
3D Printing And Designing Final Report.pdf3D Printing And Designing Final Report.pdf
3D Printing And Designing Final Report.pdfSwaraliBorhade
Ā 
How to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our SiteHow to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our Sitegalleryaagency
Ā 
Call Girls In Safdarjung Enclave 24/7āœ”ļø9711147426āœ”ļø Escorts Service
Call Girls In Safdarjung Enclave 24/7āœ”ļø9711147426āœ”ļø Escorts ServiceCall Girls In Safdarjung Enclave 24/7āœ”ļø9711147426āœ”ļø Escorts Service
Call Girls In Safdarjung Enclave 24/7āœ”ļø9711147426āœ”ļø Escorts Servicejennyeacort
Ā 
Kindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUpKindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUpmainac1
Ā 
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 night
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 nightCheap Rate Call girls Kalkaji 9205541914 shot 1500 night
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 nightDelhi Call girls
Ā 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptxVanshNarang19
Ā 
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`dajasot375
Ā 
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...Suhani Kapoor
Ā 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxjanettecruzeiro1
Ā 
call girls in Harsh Vihar (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Harsh Vihar (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøcall girls in Harsh Vihar (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Harsh Vihar (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø9953056974 Low Rate Call Girls In Saket, Delhi NCR
Ā 
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Yantram Animation Studio Corporation
Ā 

Recently uploaded (20)

VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
Ā 
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
Ā 
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai DouxDubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Ā 
WAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsWAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past Questions
Ā 
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service AmravatiVIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
VIP Call Girl Amravati Aashi 8250192130 Independent Escort Service Amravati
Ā 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptx
Ā 
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
Ā 
VIP Kolkata Call Girl Gariahat šŸ‘‰ 8250192130 Available With Room
VIP Kolkata Call Girl Gariahat šŸ‘‰ 8250192130  Available With RoomVIP Kolkata Call Girl Gariahat šŸ‘‰ 8250192130  Available With Room
VIP Kolkata Call Girl Gariahat šŸ‘‰ 8250192130 Available With Room
Ā 
escort service sasti (*~Call Girls in Prasad Nagar Metroā¤ļø9953056974
escort service sasti (*~Call Girls in Prasad Nagar Metroā¤ļø9953056974escort service sasti (*~Call Girls in Prasad Nagar Metroā¤ļø9953056974
escort service sasti (*~Call Girls in Prasad Nagar Metroā¤ļø9953056974
Ā 
3D Printing And Designing Final Report.pdf
3D Printing And Designing Final Report.pdf3D Printing And Designing Final Report.pdf
3D Printing And Designing Final Report.pdf
Ā 
How to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our SiteHow to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our Site
Ā 
Call Girls In Safdarjung Enclave 24/7āœ”ļø9711147426āœ”ļø Escorts Service
Call Girls In Safdarjung Enclave 24/7āœ”ļø9711147426āœ”ļø Escorts ServiceCall Girls In Safdarjung Enclave 24/7āœ”ļø9711147426āœ”ļø Escorts Service
Call Girls In Safdarjung Enclave 24/7āœ”ļø9711147426āœ”ļø Escorts Service
Ā 
Kindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUpKindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUp
Ā 
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 night
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 nightCheap Rate Call girls Kalkaji 9205541914 shot 1500 night
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 night
Ā 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptx
Ā 
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
Ā 
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
Ā 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptx
Ā 
call girls in Harsh Vihar (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Harsh Vihar (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøcall girls in Harsh Vihar (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Harsh Vihar (DELHI) šŸ” >ą¼’9953330565šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
Ā 
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Ā 

ESD -DAY 24.pptx

  • 1. Interface LCD with PIC EMBEDDED SYSTEM DESIGN & IoT-Master Class DAY 24
  • 2. What You will learn Today? ļƒ¼Overview of LCD ļƒ¼Interface LCD with PIC
  • 3. Mindset Lesson for the Day Words has power to Create And Power to destroy.
  • 4. Embedded System Design using PIC ā€¢40pin-SIF Socket ā€¢8 Nos. Point LEDs (Logic Output) ā€¢8 Nos. Digital Input (DIP Switch) ā€¢4x4 Matrix Keypad ā€¢2X16 Character LCD (Background Light) ā€¢4 Nos. 7-Segment Display ā€¢2 Nos. Analog Input (Potentiometer) ā€¢Temperature Sensor (LM35) ā€¢Stepper Motor Interface ā€¢2 Nos. of SPST Relay ā€¢DS1307 RTC with Batter-Backup ā€¢USART(RS232) ā€¢USB 2.0 Enabled Programmer ā€¢Interrupts Study, Reset Button ā€¢SPI ā€“ EEPROM.25C040 ā€¢I2C EEPROM 24C04 ā€¢Digital Temperature Sensor(DS18S20) ā€¢4x10-Pin Expansion Connector ā€¢Piezo Electric Buzzer
  • 6. PIN Details of LCD www.pantechsolutions.net For learning hub visit learn.pantechsolutions.net
  • 7. Character Display LCD 0011 0001 -Xā€31ā€ 0011 0010 -Xā€32ā€
  • 10. Header File and Declarations #include<pic.h> //Define PIC Registers #include<stdio.h> //Define I/O Functions __CONFIG(0x3f72); #define RS RE0 //LCD Register Select #define RW RE1 //LCD Read/Write Pin #define EN RE2 //LCD Enable Pin #define DATA PORTD //LCD Data Port #define DATADIR TRISD //LCD Data Port Direction Register #define CNTRLDIR TRISE //RS,RW,EN Direction Register void lcdinit(void); //LCD initialization Function void lcdclr(void); //LCD Clear Function void lcdcomd(unsigned char); //LCD Command Declaring Fucntion void lcddata(unsigned char); //LCD Data Display Fucntion void DelayMs(unsigned int);
  • 11. Main void main() { int i; unsigned char First[]={" PIC DEV. BOARD "}; unsigned char Secnd[]={"LCD DEMO PROGRAM"}; DelayMs(500); lcdinit(); DelayMs(500); while(1) { lcdclr(); lcdcomd(0x80); for(i=0;i<16;i++) //Display the Message { lcddata(First[i]); DelayMs(50); } lcdcomd(0xc0); for(i=0;i<16;i++) //Display the Message { lcddata(Secnd[i]); DelayMs(50); } DelayMs(500); } }
  • 12. LCD Initialization void lcdinit(void) { int i; unsigned char command[]={0x38,0x0c,0x06,0x01}; //LCD Command set for 8 bit Interface, 2 Lines, 5x7 Dots ADCON1 = 0x07; //Make PORTE Pin as Digital CNTRLDIR = 0x00; //Make LCD control port (PORTE) as output Port DATADIR = 0x00; DelayMs(50); //Make LCD Data Port (PORTD) as output port for(i=0;i<4;i++) { lcdcomd(command[i]); //Send the Initialisation Commands DelayMs(5); } DelayMs(500); }
  • 13. LCD COMMAND void lcdclr(void) //Send LCD clear command { lcdcomd(0x01); DelayMs(2); } void lcdcomd(unsigned char cmd) { RS=0; RW=0; //Select Command Register, R/W--write enabled EN=1; //Enable LCD to accept commands DATA=cmd; EN=0; DelayMs(5); //Give a Pulse via Enable pin }
  • 14. LCD Data void lcddata(unsigned char byte) { RS=1; RW=0; //Select Data register, R/W--write enabled EN=1; DATA=byte; //Give a Pulse via Enable pin EN=0; DelayMs(5); } void DelayMs(unsigned int Ms) { int delay_cnst; while(Ms>0) { Ms--; for(delay_cnst = 0;delay_cnst <220;delay_cnst++); } } www.pantechsolutions.net For learning hub visit learn.pantechsolutions.net