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

Stopping and Starting an Interrupt Routine

I have an application that runs from FLASH and downloads a second application into RAM, and then jumps into the RAM program. The FLASH application has an interrupt function that is defined as:

void Function1(void) interrupt T0INT=32 using rbank2
{
.... code
}

The RAM program has an interrupt function that is defined as:

void Function2(void) interrupt TOINT=32 using rbank2
{
.... code
}

However, when the RAM application starts the FLASH interrupt function remains running. How can I stop the FLASH interrupt function and force the RAM interrupt function to start once the RAM application has been loaded?

  • hi,

    Interrupt routines have fixed entry points called "interrupt vectors".
    You did not explain your hardware enough.
    - is your RAM shadow one (here: after been downloaded it replaces program memory space completely with EA pin)
    - or is it just "additional external program memory" which shares program memory address space?
    In last case you need to do some additional work. For example:
    - define a bit;
    - clear it at power-on;
    - download app to RAM;
    - set the bit.
    Inside ISR do something like:
    void Function1(void) interrupt T0INT=32 using rbank2
    {
    if (download_done == FALSE)
    {
    //.... code
    }
    else
    ram_t0isr();
    }

    Regards,
    Oleg

  • why, oh why?

    The Harvard architecture is specifically made for separate program and data memory. If you need frequent downloads (should only happen during debugging) use an ISP chip instead of that Mickey Mouse approach of RAM program memory.

    The approack had its place in the days when UV erase was the only means of updating code, but today it should be sent to Orlando or Anaheim.

    Erik

  • "today it should be sent to Orlando or Anaheim."

    ???

  • "today it should be sent to Orlando or Anaheim."

    ???


    Orlando and Anaheim are the locations of Disney World and Disneyland.

    Erik

  • I have a 8051 core that happens to be clocked at 62.5 MHz. I can get <64 ns SRAM easily. I cannot get 64 ns flash (and if I could, it would be expensive, no doubt).

    So, I use RAM as program store for the same reason the big boys do: increased speed through avoiding wait states for the program store. Nothing "Mickey Mouse" about it.

    I'm largely indifferent to the number of upgrades, since the flash is rated for 100k or 1M cycles, and there's no realistic chance even in the lab of wearing it out. 100 upgrades every day for 3 years straight? Even the cheap 10k cycle flash integrated with a lot of parts can be used for development.

    According to the documentation, the core is known to work to at least 166 MHz in .18 micron, so somebody out there is flogging it even faster. Good thing fast SRAM is cheap.

    More things... Horatio, than are dreamt of... and all that.