I have been active interrupt of the TCC0 but it does not exit from interrupt loop at all!
It means it does not return to while loop!
can every body help me?
Looks like a missing semicolon on line 47
Seriously, how could anyone help without seeing the code?
What do you mean by that?
Generally, loops in interrupt handlers a A Bad Thing.
As clawson says, it is impossible to debug your code without seeing your code!
For how to post source code, see Tip #1.
In addition to the above:
How do you know it entered into the interrupt routine?
How have you verified your clock speed?
Do you have other interrupts running, and if so are they working?
Read the section carefully for the interrupt you are setting up.
On the E5's, and perhaps some others, YOU have to clear the interrupt bit from your code within the interrupt handler.
On most of the other AVRs the interrupt is automatically cleared for you when the interrupt handler code executes.
Depending upon the interrupt source, if you don't reset the interrupt, it will run the interrupt code, exit back to Main, run one instruction within the Main Loop, and then re-enter the interrupt; and repeat.
That can make it look like it is never exiting the interrupt.
You don't need return, ret, or reti in your IRQ's ...the compiler will properly handle getting into and returning from your IRQ code block
You can certainly have some "looping" IN your IRQ, as long as it is very limited time-wise (such as toggling pins, shifting out a few bits, looping to add up a few values, etc)
When in the dark remember-the future looks brighter than ever. I look forward to being able to predict the future!
© 2019 Microchip Technology Inc.