geekhack

geekhack Projects => Making Stuff Together! => Topic started by: sigi on Sun, 17 March 2019, 12:45:02

Title: DC-AC inverter with STM32
Post by: sigi on Sun, 17 March 2019, 12:45:02
Hi

Can somebody help me with a example code about getting a timer to generate a center aligned signal for a DC-AC inverter using 2 mosfets and a trafo with central tab on STM32?

I was able to make it using and Arduino Nano (328p) with this excellent result:
(if somebody need it I can send code)

...but for STM32 it is completely different and after 2 weeks searching I have not found examples on the web whatsoever...

By far at this moment I know that I need to set it on TIMER_OC_MODE_PWM_2 for the center alignment mode, the HardwareTimer library from maple does not have PWM_2 mode enabled functions, neither dead time or a way to implement a complementary channel.
Title: Re: DC-AC inverter with STM32
Post by: gipetto on Sun, 21 July 2019, 16:24:44
stm32 programming is greek to me but maybe this is of some use

https://github.com/jsphuebner/stm32-sine