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

Jumping back to main program inside ISR

Hi all,

I have a C51 application that requires the following operation which is close to a reset but it is not a reset:

1. when a bit is set in a register, call a function and return
2. when a bit is cleared in a register, exit the ISR and jump back to the main routine (the stack should be reset).

I use Keil C51 and uses the following method trying to achieve the aims but to no avail:

void isr(void) interrupt
{ if (register & bit) function1(); else
#pragma asm ljmp 800H; // 800h=main routine address
#pragma endasm
}

I tried this routine but it seems that the code is stuck. Has anybody tried a similar implementation, or is there anything that I can do to implement such a scheme?

Thanks very much for your response and Best Regards.

William

Parents
  • AT89S52 can be reset with logic high for 2 machine cycles to RESET PIN.
    I used Proteus VSM 7.1 and it shows RESET...
    Reset itself by ISR and Port Pin

    delay();
    RESET_Port_Pin=1;            //Soft Reset to uC by Port Pin
    delay();
    RESET_Port_Pin=0;
    delay();
    

    But in Actual Circuit this Doesn't works.
    Without any chip it could be done or not?
    I think momentry latching of some type will help?

Reply
  • AT89S52 can be reset with logic high for 2 machine cycles to RESET PIN.
    I used Proteus VSM 7.1 and it shows RESET...
    Reset itself by ISR and Port Pin

    delay();
    RESET_Port_Pin=1;            //Soft Reset to uC by Port Pin
    delay();
    RESET_Port_Pin=0;
    delay();
    

    But in Actual Circuit this Doesn't works.
    Without any chip it could be done or not?
    I think momentry latching of some type will help?

Children
No data