0% found this document useful (0 votes)
582 views6 pages

Interfacing 16x2 LCD With PIC16f877a

The document discusses interfacing a 16x2 LCD display with a PIC16f877a microcontroller. It describes the required hardware, including the LCD, microcontroller, oscillator, capacitors, variable resistor, battery, and voltage regulator. The procedure explains how to create a project in MikroC PRO, generate a HEX file, simulate the circuit in Proteus, and implement it on hardware by connecting the components. Issues like improper pin connections or a damaged LCD are also addressed. A video tutorial provides the design, source code, and a demonstration of the working LCD interface.

Uploaded by

Teo Java
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
582 views6 pages

Interfacing 16x2 LCD With PIC16f877a

The document discusses interfacing a 16x2 LCD display with a PIC16f877a microcontroller. It describes the required hardware, including the LCD, microcontroller, oscillator, capacitors, variable resistor, battery, and voltage regulator. The procedure explains how to create a project in MikroC PRO, generate a HEX file, simulate the circuit in Proteus, and implement it on hardware by connecting the components. Issues like improper pin connections or a damaged LCD are also addressed. A video tutorial provides the design, source code, and a demonstration of the working LCD interface.

Uploaded by

Teo Java
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

12/11/2020 Interfacing 16x2 LCD with PIC16f877a

16x2 lcd interfacing with pic16f877a and know about lcd basic problems.

Proteus Circuit Diagram PIC16f877a

Interfacing 16x2 LCD with PIC16f877a


16x2 LCD is basic output module used in microcontroller based projects. It has 16 columns and 2 rows to display characters. It
can be easily interfaced with PIC microcontroller. In this tutorial we will see how to interface 16x2 LCD with PIC 16f877a using
“MikroC PRO for PIC v6.6.1” compiler.

Software Required:
1- MikroC PRO for PIC (version 6.6.1 is good enough for this tutorial, NOTE: latest version will give errors. )
2- Proteus  (v7.8 or 8)

Hardware Required:
1- PIC16f877a
2- 16x2 LCD
3- 20MHz oscillator
POWERED
4- 22pf capacitors (2) BY

https://hassam794.weebly.com/interfacing-16x2-lcd-with-pic16f877a.html 1/6
12/11/2020 Interfacing 16x2 LCD with PIC16f877a

5- 10K variable resistor


6- 9 volts battery
7- 7805 voltage regulator

Procedure:
Now make sure you have all this stuff, rst of all create new project in MikroC, choose your Microcontroller i.e PIC16f877a and
set frequency 20MHz (this is basically the frequency of oscillator, in our case we have used 20MHz). If MikroC asks to import
libraries then click OK to import all libraries. Create a new C le for you project and add the C code (comment your email address
for source code) and save your project. Now it’s time to build .HEX le (we need this le for Simulation and Hardware) you can
nd BUILD on the top layer of MikroC simply click on it or just press Ctrl+F9. .HEX le is now saved in your project folder.

For Proteus simulation open the .DSN simulation le (comment your email address for simulation le). You will see PIC16f877a
in simulation double click on it and add the .HEX le you generated in MikroC. Now run the Simulation and wow LCD is
interfaced with PIC microcontroller. If you have any question leave a comment.

Also want to implement this on hardware?? Yes, so keep reading. It’s not as hard as you are thinking just connect all wires as in
simulation. Make sure your wires are not loose otherwise you will face lot of problems. Connect pin 15 of LCD to +5 Volts and Pin
16 to ground. Now connect PIN 3 of LCD with 10K variable resistor to ground. Again make sure your LCD PIN 3 is properly
connected otherwise even if everything is working properly you can’t see anything on LCD. Now apply 5v to PIC16f877a and
LCD. If u are using 9v battery then use 7805 voltage regulator to regulate voltage to +5v. If u are not sure how to use 7805
regulator see my article “7805 voltage regulator”. Set the contrast of LCD by varying 10k resistor.

If your LCD display is something like this

then your LCD is not damaged and is working perfectly check if your PIN 3 (contrast PIN) is properly connected to 10K variable
resistor. Adjust the contrast by changing variable resistor value. If problem is not solved check microcontroller PIN 1, connect
PIN 1 ofPOWERED BY to +5v, also check oscillator again.
PIC with 1k resistor

https://hassam794.weebly.com/interfacing-16x2-lcd-with-pic16f877a.html 2/6
12/11/2020 Interfacing 16x2 LCD with PIC16f877a

If your LCD display looks like this, as below image then either you forget to connect 10k variable resistor with PIN 3 of LCD or
your LCD is damaged.

Hardware Snapshot:

POWERED BY

https://hassam794.weebly.com/interfacing-16x2-lcd-with-pic16f877a.html 3/6
12/11/2020 Interfacing 16x2 LCD with PIC16f877a

Video Tutorial:
Here is complete video tutorial with design, source code and working of LCD with PIC16f877a, Download link for the simulation
and source code is in the description of video. This is my new youtube channel please smile, subscribe, comment and like
video if it helps you. Thanks

POWERED BY

https://hassam794.weebly.com/interfacing-16x2-lcd-with-pic16f877a.html 4/6
12/11/2020 Interfacing 16x2 LCD with PIC16f877a

10 comments
Leave a message...

Hi,
Please send me code
[email protected]
Dorukhan · a year ago · Reply

send code
[email protected]
sabeer · a year ago · Reply

please send me code of pic [email protected]


kacouani · a year ago · Reply

Can you please send the source code to


[email protected]
samiha ahmed · a year ago · Reply

hello, my problem, as shown in the first figure is not been solved


after all the suggestion. Can anyone help what to do?
mehedi · 2 years ago · Reply

Mr hassam im getting problem interfacing the keypad to the 16x2


lcd. Can you help me
Travis · 2 years ago · Reply

Can u send me code please


[email protected]
Zz · 2 years ago · Reply

can u send me the code plz [email protected]

mohammed · 2 years ago · Reply

HI this really helpful , can u send me the source code


[email protected]

sivadharshan sarawanaguru · 3 years ago · Reply

Can u sent to me a source code [email protected]

Mike_ramos · 3 years ago · Reply

Download link is in the description of video. Watch Like

POWERED BY

https://hassam794.weebly.com/interfacing-16x2-lcd-with-pic16f877a.html 5/6
12/11/2020 Interfacing 16x2 LCD with PIC16f877a

POWERED BY

https://hassam794.weebly.com/interfacing-16x2-lcd-with-pic16f877a.html 6/6

You might also like