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

interrupts

hi everyone
i am new to 8051 and and have some problem with interrupts while working with kiel software.

i am unable to pass arguments to following function

void serial_isr(char code *ptr) interrupt 4

please do reply

good day....

Parents
  • i am new to 8051 and and have some problem with interrupts while working with kiel software.<p>

    Your problem has nothing to do with Keil software, but with the 8051 architecture. Or, in a more general sense, with the concept of interrupt functions.

    i am unable to pass arguments to following function

    You cannot pass an argument to an interrupt function.

    It is that simple. An interrupt function does not have a "caller" that could pass arguments to the function, since it is called by hard-wired logic inside the processor. (Note that if you perform an explicit call of an interrupt function anywhere in your program, you have introduced a quite nasty bug).

    Any data your interrupt function required must be delivered in some other way (i.e. kept in global variables and similar).

Reply
  • i am new to 8051 and and have some problem with interrupts while working with kiel software.<p>

    Your problem has nothing to do with Keil software, but with the 8051 architecture. Or, in a more general sense, with the concept of interrupt functions.

    i am unable to pass arguments to following function

    You cannot pass an argument to an interrupt function.

    It is that simple. An interrupt function does not have a "caller" that could pass arguments to the function, since it is called by hard-wired logic inside the processor. (Note that if you perform an explicit call of an interrupt function anywhere in your program, you have introduced a quite nasty bug).

    Any data your interrupt function required must be delivered in some other way (i.e. kept in global variables and similar).

Children