Hello,
I'm tyring to program a STM32F4 (with ARM F4) board to generate a sinusoidal PWM, that is a sequence of pulses with variable width that, once filtered by a LPF, gives a sinusoid.
I was told the best way to get it is by generating a sequence of single pulses synchronized to timer by interrupts.
I've tried several solutions but I'm not good at managing interrupts.
Do you have any idea how to achieve this goal? Can you attach a piece of code where it's explained how to do it?
Thanks in advance! ;)
Mara
It's an Interrupt, it's called by the processor when the TIM2 Update Interrupt asserts. The NVIC/TIM configuration enable this, and the vector table of interrupt handlers are listed in startup_stm32f4xx.s direct execution to the routine.
It will be called outside the flow of regular code, you don't need to explicitly call it. This is how interrupts work. Please refer to Computer Science and Micro-Controller texts if you need foundational understanding.
I'd recommend one of Joseph Yiu's books on the Cortex-Mx series parts, and there are of course ARM's Technical Reference Manuals (TRM) which describe the cores in significant detail.