THANGADURAI A

How many nested functions can be called from an isr?

Discussion created by THANGADURAI A on Dec 8, 2009
Latest reply on Dec 11, 2009 by THANGADURAI A

I am doing my project on HCS08SG8 controller. I have a infinite loop in a third level nested function called from timer channel capture interrupt service routine. But i could find a output variable which is calculated in the non-isr changing with random values.

 

Actually i was expecting the cpu to be blocked or arrested in the while loop present in the isr. Also i am having any software nested interupt mechanism.

 

As of now, i understood that when my cpu enters any isr, global interrupt will be disabled automatically and will be enabled back when it returns from the isr. If my understandings are correct, then if any of my isr has infinite while loop with out any conditions, then the cpu should be arrested there itself. But contradict to my understandings, when i have infinite while loop inside a second level nested function calling from an isr, the cpu is arrested. But if i moved my infinite while loop to the third level nested function calling from the isr, one of my output variable calculating at the non-isr is assigning some garbage value. Also i could find my initialisation value one among the garbage value.

Aftee this i doubted whether my controller may get reset due to some illegal operand execution or illegal operation etc.But i was surprised in seeing the cpu not halting at the break point set at the first statement of my main function once it gets started.

 

I really fed up with the cpu behaviour of the freescale micro architecture. If any of you encountered the same problem or if you have any suggestion to get out of this mission.

 

The following are my pseudocodes:

 

   /********* Start Of Isr **********/

   tpm1ch1 capture isr()

  {

     function1();

  }

  /********* End of Isr ***********/

 

  /*********Start Of Function1 *****/ 

  function1()

  {

     function2();

  }

 /********* End Of Function1 ******/

 

/*********Start Of Function2 *****/ 

  function2()

  {

     function3();

  }

 /********* End Of Function2 ******/

 

/*********Start Of Function3 *****/ 

  function3()

  {

     while(1);

  }

 /********* End Of Function3 ******/

 

Thanks & Regards....

Message Edited by TDKamalAru on 2009-12-08 10:14 AM

Outcomes