PWM Generation without using the PWM Mode of timers
Hi everyone. As the title suggests this might come across as an odd request. Basically I have been given a fully completed board with the microcontroller already placed on it.
I was asked to use it to generate PWM's from it and control a full bridge circuit with four MOSFETs. After some research, I figured out that the easiest way is to use the method described in the manual for generating complementary PWM's with dead time.
But then I ran into an issue. To generate the PWM's I use the TIM1 CH1 and CH1N channels. I understand that, I can get the PWM signals generated by this timer from a few output pins on the microcontroller. But unfortunately the board is designed in such a way that the outputs from these complementary channel pins are not connected to corresponding complementary MOSFETs in my circuit. So I cannot simply use the inbuilt PWM generation capabilities. So here are my questions,
- Are there any super obvious workarounds for this problem that are skipping my mind or I just cannot think off?
- How do I go about solving this and what would be the most efficient? Here were some of the ideas I could think off or I got from the internet
- Ignore the PWM capabilities but just read the timer count values to manually generate PWM signals through a GPIO? Even for a beginner like me, this seems not very efficient. And I Ifeel like it might not work for some reason that I dont know yet.
- I read somewhere else that I could fire interrupts at specific instances and kind of redirect the PWM signal to a GPIO pin. (https://electronics.stackexchange.com/questions/115946/how-do-i-redirect-timer-output-for-stm32f10x-to-a-given-gpio-pin) But I also read that using interrupts is also not particularly efficient
- Somehow configure like two timers. One timer measures the dead time and at the end, triggers the other timer that generates the PWM and it triggers the dead time timer again. This would be super convenient but I am yet to look up whether this is even possible to do.
To summarize, this question is light on code because it is only the first solution that I have written the code for and I have not gotten a chance to see if it will work. I was hoping there was some way to fix this that I dont quite know about.
Any help is much appreciated :)
PS - I am still rather new to hardware programming. So please go easy on me if I am misusing some terms or my ideas wont work. xD