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

General 8051 questions

This is a general question, i'm used to using PIC's, and AVR's and not really 8051's.
Do most people set the interrupts to another bank with 'using' and leave the rest of the code with the default. Just after some experienced users guidelines.

Also we have an 8051 ASIC with 128k code and ram, 2 SPI's etc. I was looking at defining the resources so the compiler knows about this stuff.
I'm a little confused about how the compiler would treat it. ie the 128k data is internal to the ASIC but does the compiler still have to treat it as external?

thanks
David

Parents Reply Children
  • Not quite, once you use a register bank for an ISR at a given priority, use it for all ISR's at that same priority. Unless you manually nest interrupts, interrupts at the same priority are mutually exclusive and can safely share register banks with free abandon.

    The 8051 is stack based, but only for return addresses. Keil C51 is usually used in non-reentrant mode but if you enable reentrancy, you will have a stack based machine again. The reentrant stack can be in XDATA for reasonable stack depths. This type of "stack" is more common to RISC processors which use a compiler convention for the software stack frame.

    - Mark

  • Why does the same level priority interrupt have to be in the same bank. What is different between them that we cannot mix them?

    thanks
    David

  • Mark didn't say that you must use the same bank; he said you can safely use the same bank - so you don't need to "waste" extra banks on same-priority interrupts which can share (with the nesting proviso)