symbol "u687" defined more than once

Discussion in 'Embedded Systems and Microcontrollers' started by steveonline, Feb 13, 2009.

  1. steveonline

    Thread Starter Member

    Feb 8, 2009
    11
    0
    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
     
  2. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    And where's the code? Does it contain u687 text or not?
     
  3. steveonline

    Thread Starter Member

    Feb 8, 2009
    11
    0
    My code has no reference to anything to do with "u687"...

    This is why im so confused, I have no idea what it is..
     
  4. steveonline

    Thread Starter Member

    Feb 8, 2009
    11
    0
    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.
    Code ( (Unknown Language)):
    1.  
    2. static void interrupt isr(void)
    3. {
    4.  disable_interrupts(); //Stop interrupts from interrupting the interrupt
    5.  count = 25;
    6.   while(count>0)  
    7.   {
    8.       PORTB = (PORTB | 0x90);    //Rotate stepper y direction 25 times
    9.       delay(1000);
    10.       PORTB = (PORTB | 0xC0);
    11.       delay(1000);
    12.       PORTB = (PORTB | 0x60);
    13.       delay(1000);
    14.       PORTB = (PORTB | 0x30);
    15.       delay(1000);
    16.       count--;
    17.   }
    18.  
    19.  enable_interrupts();
    20. }
    21.  
    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?
     
  5. steveonline

    Thread Starter Member

    Feb 8, 2009
    11
    0
    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.
     
  6. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    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.
     
Loading...