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

Error 76 Expect ; ......Warning code has no effect (SOLVED)

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



Joined: 08 Feb 2009
Posts: 11

View user's profile Send private message

Error 76 Expect ; ......Warning code has no effect (SOLVED)
PostPosted: Mon Jan 24, 2011 10:45 pm     Reply with quote

I'm using ver 4.106 on a PIC18F2585

The code compiles and runs fine, but when I add a CCS delay

delay_ms(500);

I get the error 76...Expect; along with warning 207 "code has no effect"

I have #use delay (clock=20000000) defined near the top of the code.

I have used the delay_ms(); routine without issue on 16F devices but first time on a 18F device.

Without posting code (because I'm lazy), does this look familar to anyone?


Last edited by 5440 on Tue Jan 25, 2011 10:23 pm; edited 1 time in total
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Mon Jan 24, 2011 11:26 pm     Reply with quote

Not off hand - I'm using the 18F14K22 with no issues like that - my clock is:
#use delay(clock=8000000) // configure for 8mhz clock
and down in the code I have:
delay_ms(3000); // time to read message.
with no issues. Recognize though that C compilers are notorious for letting you know when they realize they are confused - not necessarily where the error really is. I would look at the lines just above to make sure there is nothing there that is tripping it up.

mikey (compiler 4.114)
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
5440



Joined: 08 Feb 2009
Posts: 11

View user's profile Send private message

PostPosted: Mon Jan 24, 2011 11:47 pm     Reply with quote

Still get the error if I move the delay around in main.

Remove it and all is good. I started removing functions and no change, I will start trimming the code to bare bones until I solve it.
Ttelmah



Joined: 11 Mar 2010
Posts: 19333

View user's profile Send private message

PostPosted: Tue Jan 25, 2011 3:34 am     Reply with quote

Normally, if the #use delay definition is wrong. 'delay', will give an 'undefined identifier' error.
The fact that moving the statement, doesn't change things, suggests the fault is not an earlier syntax error.

I'd suggest that possibly you have a #define, that uses the keyword 'delay' somewhere, so that when you type 'delay_ms', you are actually getting something else substituted.

Load something dead basic. A 'ten liner'. Minimum, include file for processor, fuses, delay statement, and a simple set pin, delay, clear pin, while loop.
If this gives the same problem, post it, and if this works for other people, then try reinstalling your compiler. However if it works, then start dismantling the main code to see what is wrong...

Best Wishes
5440



Joined: 08 Feb 2009
Posts: 11

View user's profile Send private message

PostPosted: Tue Jan 25, 2011 10:21 pm     Reply with quote

Ttelmah wrote:
Normally, if the #use delay definition is wrong. 'delay', will give an 'undefined identifier' error.
The fact that moving the statement, doesn't change things, suggests the fault is not an earlier syntax error.

I'd suggest that possibly you have a #define, that uses the keyword 'delay' somewhere, so that when you type 'delay_ms', you are actually getting something else substituted.

Load something dead basic. A 'ten liner'. Minimum, include file for processor, fuses, delay statement, and a simple set pin, delay, clear pin, while loop.
If this gives the same problem, post it, and if this works for other people, then try reinstalling your compiler. However if it works, then start dismantling the main code to see what is wrong...

Best Wishes


Ttelmah you were correct. I had a #Define with delay_ms. Don't know how I missed it, but good job on 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