This is about : Displaying a Word or String in an 16x2 LCD with PIC16F877A and MPLAB X
And this article : Displaying a Word or String in an 16x2 LCD with PIC16F877A and MPLAB X
Displaying a Word or String in an 16x2 LCD with PIC16F877A and MPLAB X
We have seen how to interface an LCD with PIC16F877A . In this we are printing only a letter in the LCD , now we are going to Display a string on the LCD for this following steps are followed
First Create a MPLAB X project as in the steps for Blinking a LED using MPLAB X , PIC16F877A
And check the Interfacing LCD with PIC16F877A in MPLAB X to know how to interface a LCD
Components
1.PIC16F877A micro controller
2. 2x16 LCD Display
we are using the following functions
To display the string in LCD , just call the below lines in main function
The functions are defined below
First Create a MPLAB X project as in the steps for Blinking a LED using MPLAB X , PIC16F877A
And check the Interfacing LCD with PIC16F877A in MPLAB X to know how to interface a LCD
Components
1.PIC16F877A micro controller
2. 2x16 LCD Display
we are using the following functions
- void delay(unsigned int msec) // Time delay function
- void lcd_cmd(unsigned char item) // Function to send command to LCD
- void lcd_data(unsigned char item) // Function to send data to LCD
- void lcd_data_string(unsigned char *str) // Function to send data to string
- void lcd(unsigned char str[10])
To display the string in LCD , just call the below lines in main function
lcd_cmd(0x01);
lcd_cmd(0x86);
lcd("STRING TO DISPLAY");
The functions are defined below
void delay(unsigned int msec) // Time delay function
{
int i,j ;
for(i=0;i<msec;i++)
for(j=0;j<1275;j++);
}
void lcd_cmd(unsigned char item) // Function to send command to LCD
{
dataport = item;
rs= 0;
rw=0;
en=1;
delay(1);
en=0;
return;
}
void lcd_data(unsigned char item) // Function to send data to LCD
{
dataport = item;
rs= 1;
rw=0;
en=1;
delay(1);
en=0;
return;
}
void lcd_data_string(unsigned char *str) // Function to send data to string
{
int i=0;
while(str[i]!='\0')
{
lcd_data(str[i]);
i++;
//delay(10);
}
return;
}
void lcd(unsigned char str[10])
{
lcd_cmd(0x38);
lcd_cmd(0x0e);
lcd_data_string(str);
}
Articles Displaying a Word or String in an 16x2 LCD with PIC16F877A and MPLAB X finished we discussed
A few of our information about the Displaying a Word or String in an 16x2 LCD with PIC16F877A and MPLAB X, I hope you can exploit carefully
No've You've finished reading an article on Displaying a Word or String in an 16x2 LCD with PIC16F877A and MPLAB X and many articles about modern home in our blog this, please read it. and url link of this article is http://liveeconcerts.blogspot.com/2012/10/displaying-word-or-string-in-16x2-lcd.html Hopefully discussion articles on provide more knowledge about the world of tech gadgets.
Tag :
Are you looking on how to speed up Asus laptop? Have you experienced one of the following when you use your Asus laptop?
ReplyDeleteYour Asus computer is running slower than usual?
Does it take forever to run or load programs?
Your laptop freezes up or crashes at random?
You are plagued by the Blue Screen of Death/BSOD?
Computer errors frequently pop up and hassle you?
Your system takes forever to boot up or shut down?
Worry no more because a registry cleaner software should be able to diagnose what's the problem and its optimization feature lets you pinpoint exactly how to boost system performance. Don't try to fix it manually as it is only recommended for techs who are computer experts. It's because if you remove or uninstall a wrong registry entry, your laptop may entirely collapse. It's highly recommended to use a registry clean up software at this point. Its Advanced System Repair can automatically scan your computer and repair common laptop problems in minutes!