View previous topic :: View next topic |
Author |
Message |
shuperb
Joined: 26 Apr 2006 Posts: 1
|
undefined indentifier |
Posted: Wed Apr 26, 2006 4:57 am |
|
|
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
|
|
Posted: Wed Apr 26, 2006 8:48 am |
|
|
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
|
|
Posted: Wed Apr 26, 2006 10:42 am |
|
|
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. |
|
|
|