Dear all,
I'm working on nested interrupt at the moment using MSP430
My code is organized as follows: Basically the ISR of interrupt 1 will go to the ISR of interrupt 2.
main(){
code for initialization
__bis_SR_register(GIE);
do{code for LED }
while(1)}
interrupt 1{
code 1 which will enter the ISR of interrupt 2
code 2 which will enter the ISR of interrupt 2}
interrupt 2{
code}
I have found out that i need to disable the interrupt 1 when inside the ISR of interrupt 1, then enable it at the end of the ISR of interrupt 1, otherwise the controller will only reach code 1 then go back to the beginning of ISR of interrupt 1 and will not go further to code 2.
interrupt 1{
disable interrupt 1
code 1 which will enter the ISR of interrupt 2
code 2 which will enter the ISR of interrupt 2
enable interrupt 1}
Just wondering whether or not my approach is right. Or you have some other way to run the nested interrupt.
Thanks in advance
Rui