seemanta
Member level 4
Hi,
In my system, I need to perform a soft reset for a particular condition from within an interrupt handler. I have multiple interrupt handlers so I have no idea up to how many levels all the interrupt handlers have been nested.
However, at all costs, I need to perform the soft reset and restart my system as if it has been just powered up.
My solution is as follows:
I have ensured that here, the RETI instruction goes to the start of the program by loading the PC from the contents of RAM addresses 08 and 09.
I have tested this and it seems to work, but I am not sure if I am missing
something important here.
Would be grateful if someone in this board points out any mistakes if any, in the above code.
regards,
Seemanta
In my system, I need to perform a soft reset for a particular condition from within an interrupt handler. I have multiple interrupt handlers so I have no idea up to how many levels all the interrupt handlers have been nested.
However, at all costs, I need to perform the soft reset and restart my system as if it has been just powered up.
My solution is as follows:
Code:
ORG 0000H
LJMP MAIN ;
ORG 0003H ;/INT0 ISR
LCALL MY_ISR
RETI
MAIN: ...
...
...
MY_ISR: ...
...
...
MOV 08,#00H
MOV 09,#00H
RET
I have ensured that here, the RETI instruction goes to the start of the program by loading the PC from the contents of RAM addresses 08 and 09.
I have tested this and it seems to work, but I am not sure if I am missing
something important here.
Would be grateful if someone in this board points out any mistakes if any, in the above code.
regards,
Seemanta