View previous topic :: View next topic |
Author |
Message |
bimba
Joined: 12 Jan 2013 Posts: 12
|
Too many nested #INCLUDEs error |
Posted: Sun Jan 13, 2013 10:46 am |
|
|
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
|
|
Posted: Sun Jan 13, 2013 11:28 am |
|
|
What version compiler??? _________________ Google and Forum Search are some of your best tools!!!! |
|
|
bimba
Joined: 12 Jan 2013 Posts: 12
|
|
Posted: Sun Jan 13, 2013 12:35 pm |
|
|
dyeatman wrote: | What version compiler???
|
Its version 4.032 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19546
|
|
Posted: Sun Jan 13, 2013 1:31 pm |
|
|
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: 19546
|
|
Posted: Mon Jan 14, 2013 1:47 am |
|
|
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
|
|
Posted: Mon Jan 14, 2013 1:59 am |
|
|
thanks very much. but how do i correct this. |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Mon Jan 14, 2013 6:59 am |
|
|
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: 19546
|
|
Posted: Tue Jan 15, 2013 3:28 am |
|
|
or, of course, pay for an update to a 'non beta' compiler.
Best Wishes |
|
|
bimba
Joined: 12 Jan 2013 Posts: 12
|
|
Posted: Tue Jan 15, 2013 4:28 pm |
|
|
thanks very much |
|
|
|