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 CCS Technical Support

16F877A LCD at 20 MHz

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



Joined: 01 May 2010
Posts: 5

View user's profile Send private message

16F877A LCD at 20 MHz
PostPosted: Sat May 01, 2010 6:09 pm     Reply with quote

Hello.

I have been working very hard trying to make a 16x2 LCD work. But I just couldn't make it...

I hope somebody can help me with this. The code I'm using is:
Code:

#include <16F877A.h>
#use delay(clock=20000000)
#FUSES NOWDT                    //No Watch Dog Timer
#FUSES RC                       //Resistor/Capacitor Osc with CLKOUT
#FUSES NOPUT                    //No Power Up Timer
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOBROWNOUT               //No brownout reset
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD                    //No EE protection
#FUSES NOWRT                    //Program memory not write protected
#FUSES HS

#include <lcd.c>

void main()
{
lcd_init();
printf(lcd_putc,"/fhello world");//lcd_putc("hello");

while(TRUE)
 {

  }

}

Thanks a lot!!
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat May 01, 2010 6:55 pm     Reply with quote

Quote:

#FUSES RC //Resistor/Capacitor Osc with CLKOUT
#FUSES HS

You have a redundant pre-processor directive, the compiler always validate the last option:
HS in this case, wich assume that you have a crystal in the oscillator module.

Regards,

Humberto
falonsos



Joined: 01 May 2010
Posts: 5

View user's profile Send private message

PostPosted: Sat May 01, 2010 7:03 pm     Reply with quote

Thanks! I will delete that line right away!

But, I'm using a crystal in the oscillator module of 20 MHz. So I don't think that's the problem.
bkamen



Joined: 07 Jan 2004
Posts: 1614
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sat May 01, 2010 8:55 pm     Reply with quote

Did you write the driver for the LCD yourself or are you using something included with CCS PIC-C?


Most of the time, the common mistakes are:


PIN Assignments
Timing Issues
PORT settings (TRIS)


I see you're include LCD.C, but no where have you defined where the LCD is hooked up (what port, pins, etc)

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
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