2021-02-16 01:05 AM
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
2021-02-18 02:46 AM
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.
2021-02-18 03:28 AM
Thank you
2021-02-18 09:56 PM
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