Help on LCD 16x2 display link to PIC16F877A

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Help on LCD 16x2 display link to PIC16F877A

Postby altron11 » Tue Sep 06, 2011 12:47 am

Hi guys,

I am using a 16x2 LCD to display some words from a PIC16F877A. But I am unable to display anything even after many tries.
I connect the LCD to PORT D.
I do not know what went wrong.
The codes to initialise the LCD is as follow.
//LCD Configuration
send_config(0b00111000); //Funtion set
delay(15);
send_config(0b00111000); //Funtion set
delay(5);
send_config(0b00001100); //diplay on, cursor off and cursor blink off
send_config(0b00001100); //entry mode-cursor increase 1
send_config(0b00000001); //Clear display cursor home

please help me.
altron11
Newbie
 
Posts: 14
Joined: Tue Aug 30, 2011 12:20 pm

Re: Help on LCD 16x2 display link to PIC16F877A

Postby ober » Tue Sep 06, 2011 9:25 am

What is the function send_config do, the detail might be helpful.

Also where you connect the RS and E pin of LCD to?
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: Help on LCD 16x2 display link to PIC16F877A

Postby altron11 » Sun Sep 18, 2011 4:21 pm

ober WROTE:What is the function send_config do, the detail might be helpful.

Also where you connect the RS and E pin of LCD to?


Hi Ober,

I have managed to initialize the lcd and itz working.
Now i am trying to insert a string before i start with the test but i am unable to do so.

As follow is the quote for that portion,
CODE: SELECT_ALL_CODE
//LCD Settings
   send_config(0b00000001);      //clear display at lcd
   send_config(0b00000010);      //Lcd Return to home
   send_config(0b00000110);      //entry mode-cursor increase 1
   send_config(0b00001100);      //diplay on, cursor off and cursor blink off
   send_config(0b00111000);      //function set
   
   lcd_clr();            //clear LCD
   delay(1000);         //delay
   lcd_goto(0);         //initial display
   send_string("Welcome to ...");   //Display "Welcome" on lcd
   delay(1000);   
   
   while(1)               
   {
      lcd_clr();      
      lcd_goto(0);            //cursor start from beginning
      
      //display character on LCD
      send_char(' ');
      send_char('S');
      send_char('P');
      send_char('E');
      send_char('C');
      send_char('.');
      send_char('.');
      send_char('=');
altron11
Newbie
 
Posts: 14
Joined: Tue Aug 30, 2011 12:20 pm

Re: Help on LCD 16x2 display link to PIC16F877A

Postby yonghui » Sun Sep 18, 2011 10:51 pm

hi,

can u pls move the lcd_clr() out of the while(1) loop? continuos clearing the lcd after display the character will make the lcd display nothing.




regards,
yh
thanks&regards,
yh
yonghui
Professional
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: Help on LCD 16x2 display link to PIC16F877A

Postby ober » Mon Sep 19, 2011 8:44 pm

yup, as pointed out by yonghui, the lcd_clr() function should be remove. It will always clear the LCD at the beginning of the loop and since we are not sure how long the delay (1000) is, so is difficult to be sure whether you can see the message or not.

lcd_goto(0) can be ignore if use clear, because once LCD cleared, the cursor will return to 0 :)
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: Help on LCD 16x2 display link to PIC16F877A

Postby ahmad faiz » Fri Oct 21, 2011 11:56 pm

hello...
can u show me programme for lcd 16*2 with PIC16F876A
ahmad faiz
Freshie
 
Posts: 4
Joined: Mon Sep 26, 2011 4:28 pm

Re: Help on LCD 16x2 display link to PIC16F877A

Postby hyng » Sat Oct 22, 2011 11:09 am

ahmad faiz WROTE:hello...
can u show me programme for lcd 16*2 with PIC16F876A


It is similar with 16F877A. Anyway, Cytron's DIY project got several project based on 16F876A with LCD. You should refer to them: PR29, PR27, PR25, PR22, PR15, PR12, PR11and PR8-B.
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: Help on LCD 16x2 display link to PIC16F877A

Postby ahmad faiz » Sat Oct 22, 2011 1:56 pm

hyng WROTE:
ahmad faiz WROTE:hello...
can u show me programme for lcd 16*2 with PIC16F876A


It is similar with 16F877A. Anyway, Cytron's DIY project got several project based on 16F876A with LCD. You should refer to them: PR29, PR27, PR25, PR22, PR15, PR12, PR11and PR8-B.


i know..but i want that programme for LCD only
ahmad faiz
Freshie
 
Posts: 4
Joined: Mon Sep 26, 2011 4:28 pm

Re: Help on LCD 16x2 display link to PIC16F877A

Postby shahrul » Sat Oct 22, 2011 6:57 pm

ahmad faiz WROTE:i know..but i want that programme for LCD only

See this Character LCD Lesson
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 0 guests

cron