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

8051 Interrupt Vector Location

The interrupt vector is always stored in the 0003H code memory. Is it possible to store it in another location ?

Thank You

Parents
  • Assuming you are programming in C, you have to define the interrupt function attributes, e.g. for Philips P89C664:

    void Int_timer_tf2( void ) interrupt 7 using 2
    {
       ... source lines ...
    }
    There are two keywords:
    interrupt x defines the interrupt number. This number tells compiler which vector address you want. See also the manual "Cx51 Compiler User's guide - Chapter 3 Language Extensions - Function Declarations - Interrupt Functions" on p. 125. Look at the table "Interrupt Number" to "Adress"!

    using x defines the desired register bank access for the interrupt function.

    In the example mentioned above, the function Int_timer_tf2() will be called if an TF2 event occurs, because the interrupt vector address is 0x003B. This function use the register bank 2 (Registers in Addr 0x10 to 0x17).

    If you want to get other interrupt vector addresses than the standard one described in the manual you have to define your own interrupt vector addresses with the INTVECTOR and INTERVAL control directives. Please read the manual.

    Martin

Reply
  • Assuming you are programming in C, you have to define the interrupt function attributes, e.g. for Philips P89C664:

    void Int_timer_tf2( void ) interrupt 7 using 2
    {
       ... source lines ...
    }
    There are two keywords:
    interrupt x defines the interrupt number. This number tells compiler which vector address you want. See also the manual "Cx51 Compiler User's guide - Chapter 3 Language Extensions - Function Declarations - Interrupt Functions" on p. 125. Look at the table "Interrupt Number" to "Adress"!

    using x defines the desired register bank access for the interrupt function.

    In the example mentioned above, the function Int_timer_tf2() will be called if an TF2 event occurs, because the interrupt vector address is 0x003B. This function use the register bank 2 (Registers in Addr 0x10 to 0x17).

    If you want to get other interrupt vector addresses than the standard one described in the manual you have to define your own interrupt vector addresses with the INTVECTOR and INTERVAL control directives. Please read the manual.

    Martin

Children