This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

improper fixup

sorry for a new thread when there are many threads on this topic but its just that i couldnt find any satisfactory solution :
I am using keil evaluation version (small rom less than 2k) and i am getting the improper fixup error for the interrupts . When i comment those interrupt function , i dont get these error. From other threads , i understand that the code starts from 800h in this version and the interrupt is located in 13h and it is not possible to jump in code size : small .

Is there any solution for this or does it mean interrupts cannot be used in this model ?
Please help me out here.. struck for several days

Thanks !
Ram

Parents
  • #include<REGX52.h>
    void setup_interrupts()
    {

    //enable timer 0 ,counter 1 ,external interrupt 0 & 1
    EA=1;
    ET0=1;
    EX0=1;
    EX1=1;
    //external interrupts in falling edge
    IT0=1;
    IT1=1;
    //enable overflow interrupt
    TF0=1;
    //setting mode
    TMOD=0x1;
    //start timer and counte
    TR0=1;
    }

    int d,mode=0;
    int count=14;

    timer_interrupt() interrupt 1
    { count--;
    if(d!=0 && count==0)
    { count=14;
    d--;
    } }

    void delay(int a)
    { d=a;
    while(d>0)
    { }
    } void main()
    { setup_interrupts();
    delay(10);
    }

    This is just a part of the main program that creates a delay of 10s !When i remove the timer interrupt part the code works fine .
    The error is
    *** ERROR L121: IMPROPER FIXUP
    MODULE: code.obj (CODE)
    SEGMENT: ABSOLUTE
    OFFSET: 000BH

    Thanks
    Ram

Reply
  • #include<REGX52.h>
    void setup_interrupts()
    {

    //enable timer 0 ,counter 1 ,external interrupt 0 & 1
    EA=1;
    ET0=1;
    EX0=1;
    EX1=1;
    //external interrupts in falling edge
    IT0=1;
    IT1=1;
    //enable overflow interrupt
    TF0=1;
    //setting mode
    TMOD=0x1;
    //start timer and counte
    TR0=1;
    }

    int d,mode=0;
    int count=14;

    timer_interrupt() interrupt 1
    { count--;
    if(d!=0 && count==0)
    { count=14;
    d--;
    } }

    void delay(int a)
    { d=a;
    while(d>0)
    { }
    } void main()
    { setup_interrupts();
    delay(10);
    }

    This is just a part of the main program that creates a delay of 10s !When i remove the timer interrupt part the code works fine .
    The error is
    *** ERROR L121: IMPROPER FIXUP
    MODULE: code.obj (CODE)
    SEGMENT: ABSOLUTE
    OFFSET: 000BH

    Thanks
    Ram

Children