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

undefined indentifier

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



Joined: 26 Apr 2006
Posts: 1

View user's profile Send private message

undefined indentifier
PostPosted: Wed Apr 26, 2006 4:57 am     Reply with quote

hey, can anybody help me here. i'm really annoyed at these kinda petty glitches. when i was trying to compile lcd.c or the flex_lcd.c, it halted with an error, it said, "undefined indentifier -- delay_us"

the problem is that all these are defined in ccs c compiler right? but why do i still encounter this sort of problem?

moreover, when i try to add #device PIC16F877 on top of the code it said "cannot change device type this far into the code".

i mean what's wrong with the compiler? or is it my fault? but the thing is that i did not modify any of the lcd.c nor flex_lcd.c at all. but when i compile, the error bumped up. argh.

please help me as soon as possible. it is very urgent. thank you very much!.
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Wed Apr 26, 2006 8:48 am     Reply with quote

You need to have a statement in your projectname.h file like this:

#use delay(clock=20000000)

Whereas, the 20000000 is the frequency of your oscillator. The compiler won't know how to calculate the code properly without it to obtain the proper delay.

Ronald
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Apr 26, 2006 10:42 am     Reply with quote

Quote:
moreover, when i try to add #device PIC16F877 on top of the code it said "cannot change device type this far into the code".

It's already in the 16F877.H include file. You don't need to add an
additional #device statement. That's why it gives an error.
See this post for an example of how to write a CCS program.
http://www.ccsinfo.com/forum/viewtopic.php?t=18649&start=1

Note that the comment about CCS having no linker will change
when they release vs. 4.0.
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