Hi,
It might be the DIV32, we'll have to get Darrel to answer that or have someone dig into the ASM code and figure out if the PBP registers used by DIV32 are being saved by DT-Ints or not (I still think they are).
My guess is that it isn't actually DIV32 that is causing it but something else with the way the frequency is changed. Why not try constantly ramping the frequency up and down in your main loop? Don't use DIV32, just "sweep" the reload value up and down between your MIN and MAX values. Does it still glitch? If so we know that it's not DIV32 that's causing it but something else.
If it turns out that it IS DIV32 then we can look at other solutions. The DIV32 thing was in response to your request of directly calculating the reload value based on the desired output frequency scaled in Hz. Simply rescaling to some arbitrary "unit" might allow the calculations to be done without DIV32 but it comes with a couple of commitments which I won't go into until we know that that DIV32 is the problem.
Can you explain to me where the values 34696 and 32 comes from?
/Henrik.
Bookmarks