[Solved] Compilation failed in xc8 for 12f675

lara's picture

Offline

Joined: Oct 05, 2018

Replies: 4
[Solved] Compilation failed in xc8 for 12f675
October 5, 2018 - 8:11pm

hi there,

I am using 12f675/ xc8 compiler. input pin will monitor the count with the code-

"for(Count=0; Count < 10; Count++) 
        {
        while(Input == 1);

         }"

but during compile build fail with warning

" 675 .c:65: error: (195) expression syntax
  675 .c:65: error: (194) ")" expected

"

 

It is observed when Input==1 is closed with double inv. comma like  //while("Input == 1")//  then the code is build .

so what is difference in between both of them with double invited comma and without it??

tnx

Aswinth Raj's picture

Offline

Joined: Aug 16, 2016

Replies: 798
PIC12F675 debugging
October 6, 2018 - 12:11pm

Hi Lara, welcome to circuitdigest Forums.

It is observed when Input==1 is closed with double inv. comma like  //while("Input == 1")//  then the code is build .

so what is difference in between both of them with double invited comma and without it??

When you use something inside two quotes "Input==1" like this, then it is considered as a string. A while loops condition statement should have a condition side it using a string might not give you compile time error, but it has no logic behind it hence cannot be used.

 

"for(Count=0; Count < 10; Count++) 
        {
        while(Input == 1);

         }"

It is difficult to tell you why exactly the error is popping up since you have not given the complete. From the snippet you have given the line while(Input==1); seems odd.

while(Input==1);

will check if the variable Input is high or low, and if high it will get into the while statement and will remain there forever. Because the variable Input will never be updated again unless there is an interrupt function somewhere in the program and the ISR updates the values of Input variable using 

while(Input==1); is equivalent to while(1);

 

lara's picture

Offline

Joined: Oct 05, 2018

Replies: 4
Component decompose in Proteus and reflect on PCB LAYOUT also.
October 12, 2018 - 1:15am

Tnx Raj sir for you reply I got understand the matter..

Now I want to reduce component like resistor length in Schematic Capture and PCB Layout also in Labcentre Proteus 8.6 Application. For that, I have decomposed the resistor(RES40) and after changing its width from 0.3in to 0.2in and its reduced size is shown in Schematis Capture BUT,

When coming to PCB Layout it is shown the width of 0.3in as like RES40.

Please let me know how do i get the reduced size in PCB Layout too.

Is there any library file for various length/width resistor which can be  added to the "Library" folder of Proteusto get less width/length's resistors.

tnx.

Aswinth Raj's picture

Offline

Joined: Aug 16, 2016

Replies: 798
Try EasyEDA
October 12, 2018 - 10:31am

I am not a big fan of Proteus for PCB layouts. I use EasyEDA and has been very user friendly so far.

Also since you previous problem is solved, It is a better practice to start a new thread (new question) for your other doubts.

Thanks

lara's picture

Offline

Joined: Oct 05, 2018

Replies: 4
ok thanks Raj sir
October 12, 2018 - 12:10pm

ok thanks Raj sir

Topic locked