LCD Interfacing with PIC Microcontroller | PIC18F452
- Vinit Patil
- Aug 7, 2017
- 2 min read
Hi..!!!
Welcome to Embedded World. Today we talk about how to interface LCD with micro-controller. LCD stands for Liquid Crystal Display. It's a most commonly used electronic device in various electronics projects. It is a 16 pin device containing 8 data lines (D0-D7), three control lines (RS/RW/E), two pins for lcd back-light (A/K) and last three remaining pins for Supply.

1) Circuit Diagram

Here we interfaced LCD with PORT B of PIC controller. we can use lcd in either 4-bit mode or 8-bit mode. In 8-bit mode we required 8 data lines (D0-D7). But in 4-bit mode we required only 4 data lines (D4-D7), where in this mode 8-bit ASCII charter data and command data divided in two parts then send sequentially through data lines. 4-bit communication is little bit slower than 8-bit but it saves 4 data pins. thus
4-bit data is most commonly used.
so here in 4-bit data mode remaining 4 pins(D0-D3) are connected to ground (logic 0).
RW pins decides the lcd read/write operation, as here we only write data on lcd, not getting back any data so we connect RW pin to ground (logic 0) say write mode.
2) Coding

Algorithm
1] assign and declared lcd pin
2] set PORT B as output port
3] initialise PORT B with zero
4] initialise lcd library function
5] clear lcd
6] off lcd cursor
7] call delay
8] assign data to lcd port pin
9] call delay
10] stop
3) Simulation Result

As MikroC has its inbuilt library function, it is easier to write code in mikroc compiler. just we need to initialise lcd library n write display code.
4) Burn Hex FIle

For loading program on controller I used PICkit3 Programmer. buy it from Amazon at RS.1100.
5) Hardware Output
For hardware implementation I used my PIC Development board. you can also used your board or just making simple connection on breadboard as per circuit diagram. Here we used external power source from 12Vac adapter then further it can be convetred to 5V supply using rectifier and LM7805 and further provided to PIC MCLR pin and LCD supply pins. In lcd connection we connect variable resistor at pin 2 (VDD) of lcd to control the brightness of LCD. Data and control lines connected to PORT B.
Download Here...!!!
You can download project hex file, proteus file, simulation, code, mikroc etc files here....
If you want to design your PIC Development Board, here its all required data, download and make your project..... ALL THE BEST !!!!
If you have any doubts, quires, suggestions for me please comment below or contact me on my number.
...Thanks For Visiting...
Comments