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

OVERLAY

Hi,

I have two threads interrupt and main thread. currently, i'm using NOOVERLAY.
In order to save space in the RAM, i want to overlay data between functions, BUT I want that the interrupt will not overlay with the main thread.

How can i do it? i'm using a KEIL of 8051 Uvision.

example:
void interrup (void);
.....
void main (void);
.....

Parents
  • Thanks,

    Off course you are right that what I thought, however I tried it and some data was corrupted by the interrupt since it used the same space for different variables.

    In addition I used different register bank for the interrupt and the main thread so this was not the cause

    May be I didn't declare the interrupt appropriately so the linker didn't "treat" as an interrupt

    Below the code for interrupt declaration:

    char xdata *ptr2isr;

    ptr2isr = (char *) isr;

    void isr(void)interrupt 1 using 1
    {

    ……
    }

Reply
  • Thanks,

    Off course you are right that what I thought, however I tried it and some data was corrupted by the interrupt since it used the same space for different variables.

    In addition I used different register bank for the interrupt and the main thread so this was not the cause

    May be I didn't declare the interrupt appropriately so the linker didn't "treat" as an interrupt

    Below the code for interrupt declaration:

    char xdata *ptr2isr;

    ptr2isr = (char *) isr;

    void isr(void)interrupt 1 using 1
    {

    ……
    }

Children