cancel
Showing results for 
Search instead for 
Did you mean: 

problem at while loop

Lchal.1
Associate II

HI, i am using two timers in interrupt mode by setting 100khz frequency for each . one timer interrupt is for my power factor calculation and other one for current calculation. But the problem is when it comes to while loop. once my code enter into interrrupt functions works fine after coming out of the interrupt it is not entering while loop . and the logic inside the while loop is also not executing. can anyone help me with it please . why i am not able to enter and execute while loop.

Thank you

12 REPLIES 12
Ozone
Lead

I would start with investigating the reason and location for the hardfault.

This paper might help: https://www.keil.com/appnotes/files/apnt209.pdf

Faults after a longer runtime are often stack overflows or race conditions, perhaps interrupt-related.

Or out-of-bound access through overrun counters/indices.

Thank you

when i give DC supply it works fine . But the problem occurs when i give AC supply along with DC supply. using that AC supply value i am calculating rms counts in Tim3 interrupt and Tim2 interrupt i am calculating powerfactor. So what could be the problem can you help me with it please.

Thank you