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

interrupt function (register bank)

I want to create an interrupt function. So I have to know the interrupt number and I have to select the register bank. My question is, which register bank I must select and why???
Where can I get information about this problem?
Thank you for answers.
andy

  • There is a good explanation of register banks
    and when and why to a different bank for interrupts.

    See GS51.PDF chapter 9, page 184 (document version 02.2001)
    Then search for "register bank" in the C51.pdf file.

  • Selection of a register bank for an interrupt function is not a must. If a register bank is assigned to an interrupt function the compiler simply switches the PSW after saving the previous contents on the stack. On exit all that has to be done is to restore the PSW by popping it from the stack. If no bank is assigned, the compiler takes care of the registers of the current (active) bank by pushing them onto the stack. This is normally more time consuming than just saving/restoring the PSW. If you need high speed processing, assign a register bank. If speed is not a requirement for your application, you may assign a specific bank and use the register bank area as additonal 8 bytes of DATA memory.

    HHK

  • Beware: in uVision, the symbols R0, R1, ... R7, and the 'Registers' window only ever show values
    from Bank 0


    If you're debugging & want to see the other Banks, you'll just have to use the absolute addresses :-(