CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

My LCD drives me mad!

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
deniska_gus



Joined: 11 Jul 2006
Posts: 42
Location: Minden, Germany

View user's profile Send private message

My LCD drives me mad!
PostPosted: Thu Oct 05, 2006 2:57 am     Reply with quote

Hi, I'm using PIC16F877A and PCHW3.249

I have tested this small code
Code:

#include <16F877A.h>

#fuses XT,NOWDT,PUT, NOLVP
#use delay(clock=4000000)
#include<lcd.c>

void main()
{
 lcd_init();
 while(1)
 {
 
  lcd_putc("Hallo Welt!\n");
 
 }

}


and it doesn't work. I'm using original lcd.c, Quarz 4Mhz. The pins are connected to Port D.

Please help!


Last edited by deniska_gus on Thu Oct 05, 2006 3:49 am; edited 1 time in total
Ttelmah
Guest







PostPosted: Thu Oct 05, 2006 3:09 am     Reply with quote

A couple of thought/suggestions.
First add a delay. So:
Code:

  while(1)  {
    lcd_putc("Hallo Welt!\n");
    delay_ms(500);
  }

You are continuously writing to the LCD, and some displays won't actually update if they are having to receive data 'flat out'.
Second, double check the connections. Make sure you have connected the 'high' four data pins, not the 'low' four.

Best Wishes
deniska_gus



Joined: 11 Jul 2006
Posts: 42
Location: Minden, Germany

View user's profile Send private message

PostPosted: Thu Oct 05, 2006 3:36 am     Reply with quote

Thank you, Ttelmah, i have change it but it doesn't work. I have to say, i used the search function of this forum and i have added all i need to my plan( 10K trimpot etc.). I use 2X16 LCD Display with HD 44780 Controller. All i can see is just black line.
Ttelmah
Guest







PostPosted: Thu Oct 05, 2006 5:23 am     Reply with quote

A single black line in the top half of the display, means it is not being initialised, which comes back to the connections. Triple check. The pinouts of displays differ, and even sometimes the pin names.

Best Wishes
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Thu Oct 05, 2006 7:54 am     Reply with quote

And even sometimes the timming.
Someone else posted and little test. In the code, if there is a
delay set after reading/writeing pins, try doubling the time.
See if that helps.
deniska_gus



Joined: 11 Jul 2006
Posts: 42
Location: Minden, Germany

View user's profile Send private message

PostPosted: Thu Oct 05, 2006 8:08 am     Reply with quote

I'll try this. Thank you , guys.

Regards. Dennis.
P.S. If someone has any idea, so please write it. I have nobody else, who could help me.
Ttelmah
Guest







PostPosted: Thu Oct 05, 2006 8:15 am     Reply with quote

Also, try inserting a delay _before_ starting lcd_init.
Many of the LCD's, require several mSec after 'power on', before they are ready to accept commands. For example, for Hitach chips, they say 'wait for at least 15mSec after power rises above 4.5v'.

Best Wishes
Markdem



Joined: 24 Jun 2005
Posts: 206

View user's profile Send private message Send e-mail

PostPosted: Thu Oct 05, 2006 4:56 pm     Reply with quote

One more thing you can try is putting a delay_ms(250); after the lcd_init() line. I have seen LCD that need a bit of time to get up and running.

Also, when you say all you can see is black line, is it only the top line, or is it the full screen?? If it is the full screen, just try to adjust the trim pot.

Have fun

Mark
asmallri



Joined: 12 Aug 2004
Posts: 1630
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Oct 05, 2006 6:29 pm     Reply with quote

Where are the pinouts to the LCD interface defined? Such as enable, write..
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
deniska_gus



Joined: 11 Jul 2006
Posts: 42
Location: Minden, Germany

View user's profile Send private message

PostPosted: Thu Oct 05, 2006 11:06 pm     Reply with quote

to Markdem:

It is just the top line. I'll try delay_ms(250). Thank you.

to Asmallri

The Pinouts to the LCD interface are defined:
D0 -> enable (pin 6 LCD)
D1 ->RS (pin 4 LCD)
D2 ->RW (pin 5 LCD)
D4 -> D4 (pin 11 LCD)
D5 -> D5 (pin 12)
D6 -> D6 (pin 13)
D7 -> D7( pin 14)

Thank you
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group