Lcd display with PIC microcontroller and Mikro C compiler
LM16x2 Lcd Display
LCD means Liquid Crystal Display. In this project I am use LM 16X2 LCD Display. 16X2 means 16 column & 2 row in this display. There are 16*2 = 32 segment in this display. Each segment hold
8x2 dot patterns. There are 16 pin for connections.
![]() |
LM16x2 Lcd display |
![]() |
16 column & 2 row |
![]() |
dot segment |
![]() |
pin configuration |
![]() |
circuit schematic |
Component needed for this project
- PIC16F877A
- 8MHz Crystal
- LM16x2 Lcd display
- 10K POT
- 10K
- Breadboad
- Connection wire
- PICkit 2
- PC
- PIC Universal Programmer Adaptor
In this tutorial I am use Mikro C Pro For PIC compiler for coding. Mikro C Pro For Pic provide a comfortable LCD library for LCD interfacing.
MIKRO C PRO FOR PIC LCD Library
The mikroC PRO for PIC provides a library for communication with Lcds (with HD44780 compliant controllers) through the 4-bit interface.
Lcd Library Routines
- Lcd_Init
- Lcd_Out
- Lcd_Out_Cp
- Lcd_Chr
- Lcd_Chr_Cp
- Lcd_Cmd
Mikro C code :
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lcd module connections | |
sbit LCD_RS at RB0_bit; | |
sbit LCD_EN at RB1_bit; | |
sbit LCD_D4 at RB2_bit; | |
sbit LCD_D5 at RB3_bit; | |
sbit LCD_D6 at RB4_bit; | |
sbit LCD_D7 at RB5_bit; | |
sbit LCD_RS_Direction at TRISB0_bit; | |
sbit LCD_EN_Direction at TRISB1_bit; | |
sbit LCD_D4_Direction at TRISB2_bit; | |
sbit LCD_D5_Direction at TRISB3_bit; | |
sbit LCD_D6_Direction at TRISB4_bit; | |
sbit LCD_D7_Direction at TRISB5_bit; | |
// End Lcd module connections | |
void main() { | |
Lcd_Init(); // Initialize Lcd module | |
Lcd_Cmd(_LCD_CLEAR); // Clear Lcd display | |
Lcd_Cmd(_LCD_CURSOR_OFF); // Lcd cursor off | |
while(1){ // Endless loop | |
Lcd_Out(1,3,"WELCOME TO"); // 1st row,3rd column to start writting | |
delay_ms(1000); // 1second delay | |
Lcd_Out(2,1,"MINA TECHNOLOGY"); // 2nd row, 1st column to start writting | |
delay_ms(1000); // 1second delay | |
Lcd_Cmd(_LCD_CLEAR); // Clear Lcd display | |
Lcd_Out(1,3,"DEVELOPED BY"); // 1st row,1st column to start writting | |
delay_ms(1000); // 1second delay | |
Lcd_Out(2,1,"MINA TECHNOLOGY"); // 2nd row, 1st column to start writting | |
delay_ms(1000); // 1second delay | |
Lcd_Cmd(_LCD_CLEAR); // Clear Lcd display | |
} | |
} |
Code describe:
First time here I write codes for Lcd module connections and intialize Lcd in main funciton. Than I clear the Lcd and off the cursor.
Download here for hex file. Click download button.
![]() |
download |
Sometime few educational blogs become very helpful while getting relevant and new information related to your targeted area. As I found this blog and appreciate the information delivered to my database.
ReplyDelete전자부품판매
I think this is an informative post and it is very useful and knowledgeable. We provide LCD modules/LCD Displays, Graphic LCM, smart Display LCD, TFT LCM, Custom LCD Module Display, and LCD panels. china LCD Manufacturers.
ReplyDeletetft lcd
Thanks for sharing this blog. Very useful Post. Contact STONE Tech for tft module
ReplyDeletetft module
Thanks for sharing this great content. If you want to buy HMI display module(Intelligent TFT LCD). Hire STONE Tech to get the best prices.
ReplyDeletetft lcd module