Quote Originally Posted by Acetronics View Post
Hi, Pxidr84

Something caught my attention ... in the reloading, you use DIV32; are you sure there's no possible interrupt while DIV32 works ???

as timer0 is a low priority interrupt ... I'd check that two or three times.

... just an idea after a very quick browse ...

Alain
Hi,

Timer0 interrupt is used for the calculation of the inverter paramaters (like the V/F ratio, the timer reload variable, etc.) It's a low priority interrupt because the Timer1 interrupt (used for the PWM generation) is very critical and must be
executed all of the time.

The DIV32 is used for calculate the timer reload value (the timer routine is from Henrik). However this routine is needed for output the desired sine frequency. This routine directly controls the Timer1 interrupt frequency. It is possible to avoid this DIV32 command (because it seems to take a LOT of ressources)?

Maybe it's better to use Timer0 as a high priority interrupt?

Maybe a PWM register is misconfigured?

I don't know