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 (drives crazy) ---> Expecting a close paren

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



Joined: 21 Jan 2006
Posts: 2

View user's profile Send private message

ERROR (drives crazy) ---> Expecting a close paren
PostPosted: Sat Jan 21, 2006 12:37 pm     Reply with quote

Dear Members,
I am using PIC10F200

i have the following definition in my file
#define ENABLE PIN_B0

when i compile the code with
if(input(ENABLE))
{
output_high(ENABLE);
break;
}

i get error message "Expecting a close paren"

Its really driving me crazy because i cannot read my input port pin. I have even tried using if(input(PIN_B0)), but still the same error.

Please share ur views on whats going wrong

Pravin
Guest








PostPosted: Sat Jan 21, 2006 12:56 pm     Reply with quote

Try to use another word in place of ENABLE.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat Jan 21, 2006 6:14 pm     Reply with quote

Do not know what do you try to do with:
Code:

     if(input(ENABLE))
       {
        output_high(ENABLE);
        break;
       }


but anyway, I tested the following code using the reserved(?) word ENABLE
selected as option in the preprocessor directive #use RS232(...) and then as an output
pin name.

Code:
 
#include <10F200.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES MCLR                     //Master Clear pin enabled
#FUSES NOPROTECT                //Code not protected from reading

#use delay(clock=4000000)
#use rs232(baud=9600,xmit=PIN_B1,rcv=PIN_B2,ENABLE=PIN_B3)
#use fast_io(B)

#define ENABLE PIN_B0

void main()
{
  setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
 
  do
    {
     if(input(ENABLE))
       {
        output_high(ENABLE);
        break;
       }
       
     putc('A');
    }while(1);
   
}


Code:

...................      if(input(ENABLE))
003F:  BTFSS  PORTB.0
0040:  GOTO   043
....................        {
....................         output_high(ENABLE);
0041:  BSF    PORTB.0
....................         break;
0042:  GOTO   047
....................        }
....................
....................      putc('A');
0043:  MOVLW  TMR0
0044:  MOVWF  ??65535
0045:  GOTO   @PUTCHAR_1_
....................




It compiled properly, no warning, no error.


Humberto
PravinP



Joined: 21 Jan 2006
Posts: 2

View user's profile Send private message

ERROR (drives crazy) ---> Expecting a close paren
PostPosted: Sun Jan 22, 2006 3:18 am     Reply with quote

Hi,
sorry made some errors while posting the code
The define file is

#define ENB PIN_B0
#define INP PIN_B3

while(1)
{
delay_ms(DELAY);
if(input(INP))
{
output_high(ENB);
break;
}

-----
--
--
}

while(1);

I am scanning the port pin PIN_B3 for high, if i sense a high on the pin, i exit the loop
But i get the same error "Expecting a close paren" after i compile the code.
Is there anyother method by which i can sense the port pin instead of using the build in function.
(eg. in 8051, i can simply write if (INP == 1))

Thanks,
Pravin
Brian S



Joined: 06 Sep 2005
Posts: 13

View user's profile Send private message

PostPosted: Sun Jan 22, 2006 9:01 am     Reply with quote

if ( input(PIN_B4) == 1 ) /*Start Sequencing on B4 hi*/
{
.
.
.
}

Cheers!
Guest








PostPosted: Sun Jan 28, 2007 3:09 pm     Reply with quote

if( input_state(pin_b4)) "== sequence" isnt necessary . its also boolean true
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jan 28, 2007 3:54 pm     Reply with quote

You didn't post a full test program. It's really important to do that
when you're getting compiler errors. I took your code fragments
and made the test program below. It compiles with no errors with
PCB vs. 3.249.
Code:

#include <10F200.h>
#fuses NOWDT, NOMCLR
#use delay(clock=4000000)

#define ENB PIN_B0
#define INP PIN_B3
#define DELAY 1
//==========================
void main()
{

while(1)
  {
   delay_ms(DELAY);

   if(input(INP))
     {
      output_high(ENB);
      break;
     }
  }


}
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