Page 1 of 1

Help on LCD 16x2 display link to PIC16F877A

PostPosted: Tue Sep 06, 2011 12:47 am
by altron11
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.

Re: Help on LCD 16x2 display link to PIC16F877A

PostPosted: Tue Sep 06, 2011 9:25 am
by ober
What is the function send_config do, the detail might be helpful.

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

Re: Help on LCD 16x2 display link to PIC16F877A

PostPosted: Sun Sep 18, 2011 4:21 pm
by altron11
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('=');

Re: Help on LCD 16x2 display link to PIC16F877A

PostPosted: Sun Sep 18, 2011 10:51 pm
by yonghui
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

Re: Help on LCD 16x2 display link to PIC16F877A

PostPosted: Mon Sep 19, 2011 8:44 pm
by ober
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 :)

Re: Help on LCD 16x2 display link to PIC16F877A

PostPosted: Fri Oct 21, 2011 11:56 pm
by ahmad faiz
hello...
can u show me programme for lcd 16*2 with PIC16F876A

Re: Help on LCD 16x2 display link to PIC16F877A

PostPosted: Sat Oct 22, 2011 11:09 am
by hyng
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.

Re: Help on LCD 16x2 display link to PIC16F877A

PostPosted: Sat Oct 22, 2011 1:56 pm
by ahmad faiz
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

Re: Help on LCD 16x2 display link to PIC16F877A

PostPosted: Sat Oct 22, 2011 6:57 pm
by shahrul
ahmad faiz WROTE:i know..but i want that programme for LCD only

See this Character LCD Lesson