Henrik, you had right about the DIV32 command. It doesn't disturbs DT Instant Interrupts at all.
Look at this routine :
The result of the division is stored into the "reload" variable.Code:dum=dum1*dum2 reload=DIV32 freq reload=(65535-reload)+8
But if the TMR1 interrupt occurs BEFORE the end of the calculation (before reload=(65535-test)+8)), the timer management routine located in TMR1 interrupt will take the "unfinished" reload variable. So is how the sine "jumps".
But now, with this :
The result of the division is stored into the "store" variable, so when "reload" is calculated, the routine calculation is really finished.Code:dum=dum1*dum2 store=DIV32 freq reload=(65535-store)+8
I've tried this, and now, absolutely no glitch appears on the sine. So this fixed my problem.
3 days for find that.![]()




Bookmarks