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

" too many nested #include " help

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



Joined: 07 Oct 2010
Posts: 1

View user's profile Send private message

" too many nested #include " help
PostPosted: Thu Oct 07, 2010 4:55 am     Reply with quote

I using ccs with pic16f688

with this code
Code:

"#include <16F688.h>
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)

void main()
{
set_tris_c(0x00);

while(true)
   {
   output_c(0x3F);
   delay_ms(1000);
   output_c(0x00);
   delay_ms(1000);
   }

}

but when click compile it has error occur

***Error 17 "C:\pic\16F688.h Line (9,10); Too many nested #INCLUDEs

then it show .h file
Code:

#include <16F688.h>
#device adc=8

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES HS                       //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOBROWNOUT               //No brownout reset
#FUSES MCLR                     //Master Clear pin enabled
#FUSES NOCPD                    //No EE protection
#FUSES NOPUT                    //No Power Up Timer
#FUSES IESO                     //Internal External Switch Over mode enabled
#FUSES FCMEN                    //Fail-safe clock monitor enabled

#use delay(clock=20000000)

help please
Crying or Very sad
dyeatman



Joined: 06 Sep 2003
Posts: 1923
Location: Norman, OK

View user's profile Send private message

PostPosted: Thu Oct 07, 2010 6:49 am     Reply with quote

Your first line <includes> the file 16F688.h then the 16F688.h file you
created <includes> the same name again. In addition the included file
repeats the fuses and #use delay lines.

Your fuses and #use delay are already in the main program so the best
course is to simply rename the file you created called 16F688.h and let the
program use the CCS provided 16F688.h device header file that should be in
your PICC/devices directory.

Add the #device adc=8 line just after the FUSES line in your main program.

Finally, delete the set_tris_c(0x00) line and let the compiler handle it. Since
you are not using fast_io (and you don't need it) the line has no real effect.
_________________
Google and Forum Search are some of your best tools!!!!
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