symbol "u687" defined more than once

Thread Starter

steveonline

Joined Feb 8, 2009
11
So using the Hi-Tech ANSI C Compiler with MPLab.

Im getting this error message while compiling my code

symbol "u687" defined more than once

I've searched all around, and cannot find any useful information as to what is the cause of this.

If anyone has any knowledge of what this means, I would be very appreciative.

Thanks,
S
 

Thread Starter

steveonline

Joined Feb 8, 2009
11
So it appears its something to do with my interrupts

When i comment out my interrupt routine it compiles, however when i have my interrupt defined it doesnt work.
Rich (BB code):
static void interrupt isr(void)
{
 disable_interrupts(); //Stop interrupts from interrupting the interrupt
 count = 25;
  while(count>0)   
  {
      PORTB = (PORTB | 0x90);    //Rotate stepper y direction 25 times
      delay(1000);
      PORTB = (PORTB | 0xC0);
      delay(1000);
      PORTB = (PORTB | 0x60);
      delay(1000);
      PORTB = (PORTB | 0x30);
      delay(1000);
      count--;
  }
 
 enable_interrupts();
}
This is with a PIC16F88..

Im guessing I am defining the interrupt routine wrongly ...
Does anyone know the correct method to define an interrupt in this situation?
 

Thread Starter

steveonline

Joined Feb 8, 2009
11
So after a few long days of random testing, I finally found out that the error was because I can't call the delay function while in the interrupt.

Im not sure if this is normal or not, but its the only way it works.
 

n9352527

Joined Oct 14, 2005
1,198
It is a good practice not to call delay in ISR. ISR has to finish as soon as possible for many reasons. Another method to achieve what you are trying to do is to set a flag in ISR and have a loop outside the ISR checks that flag and do the required processing if set then clear the flag again when finished.
 
Top