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

Too many nested #INCLUDEs error

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



Joined: 12 Jan 2013
Posts: 12

View user's profile Send private message

Too many nested #INCLUDEs error
PostPosted: Sun Jan 13, 2013 10:46 am     Reply with quote

Hello all,

Please I need to know where the error is in this code:
Code:

#include<16F877.h>
#fuses HS,NOWDT
#use delay(clock = 10000000)
#use rs232(baud=9600,parity=N,xmit=pin_C6,rcv=PIN_C7,stream=RS232,bits=8)

void main(void)
{
   unsigned int z;
   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   port_b_pullups(TRUE);//sets the port B input pullups
 
   // set_tris_d( 0x00);//all bits of port d is set for output
   // set_tris_b( 0xFF);//all bits of port b is set for input
 
   while(true) // since 1 is always TRUE this loop will go on forever
   {
      z=input_b(); // take the input from portB
 
      output_d(z); //output the same number to portD
      printf("\n\r %c",z); // prints the xter to the RS-232 hyperterminal screen
                     // assign this line as a comment for now since the RS-232
                     // communications isn't covered
       
   } // end of while loop
} // end of main loop

After compiling I get this error:
Too many nested #INCLUDEs

Thanks
dyeatman



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

View user's profile Send private message

PostPosted: Sun Jan 13, 2013 11:28 am     Reply with quote

What version compiler???
_________________
Google and Forum Search are some of your best tools!!!!
bimba



Joined: 12 Jan 2013
Posts: 12

View user's profile Send private message

PostPosted: Sun Jan 13, 2013 12:35 pm     Reply with quote

dyeatman wrote:
What version compiler???

Its version 4.032
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Sun Jan 13, 2013 1:31 pm     Reply with quote

I'm afraid to say that is probably the fault. V4, is not generally considered to be a working compiler before the late 4.06x versions.
4.032, was a beta at best.

There is one fault in the code:

setup_spi(SPI_SS_DISABLED);

the correct instruction is:

setup_spi(FALSE);

However this just results in the SPI being turned on.

There is probably just something incorrectly typed in the 16F877 include file.

Best Wishes
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Mon Jan 14, 2013 1:47 am     Reply with quote

However, that 'having been said', 4.027, and 4.034, both compile this without complaint. I'd guess somebody has edited your copy of 16F877.h, and there is something typed incorrectly in there. Possibly it includes 16F877.h, which will then lead to a 'recursive' include.....

Best Wishes
bimba



Joined: 12 Jan 2013
Posts: 12

View user's profile Send private message

PostPosted: Mon Jan 14, 2013 1:59 am     Reply with quote

thanks very much. but how do i correct this.
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Mon Jan 14, 2013 6:59 am     Reply with quote

Open the .h file and see if there is anything wrong with it...

you can open it with a text editor or with CCS directly much like opening a .c file ....
_________________
CCS PCM 5.078 & CCS PCH 5.093
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Tue Jan 15, 2013 3:28 am     Reply with quote

or, of course, pay for an update to a 'non beta' compiler.

Best Wishes
bimba



Joined: 12 Jan 2013
Posts: 12

View user's profile Send private message

PostPosted: Tue Jan 15, 2013 4:28 pm     Reply with quote

thanks very much
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