2022-10-18 10:05 PM
Hi there,
I am generating 250khz PWM signal using STM32f401ccu6 (Blackpill) to drive high side and low side mosfets. I am using Timer 1 channel 1 along with its complementary PWM feature to utilize dead time feature. Currently I have generated the PWM signals at 250khz, but the CHN PWM is not opposite to the CH PWM. Both are starting from HIGH and transitioning to LOW. That means both are interfering by getting HIGH or LOW at same time. I tried to change the CHN polarity to HIGH to LOW in pinout configuration, but it is only inverting the duty cycle. The CHN PWM transition is not happening from LOW to HIGH. Also I tried by changing both CH and CHN polarity, idle state. Please let me know how to approach this. I have attached the images.
This is the output with CHN polarity as HIGH.
output with CHN polarity as HIGH.
TImer setup
This this the PWM I'm expecting with dead time.Thanks in advance.
2022-10-18 11:12 PM
Switch the scope mode from Alt to Chop while keeping the setting from the first scope image - you will see the real signals with the same time base, not one after another.
2022-10-19 12:38 AM
Thats a weird wave output, ive never had this issue before.
as @gbm said, you oscilloscope might be playing tricks with your time axis. By aligning both signals at the rising flanks thus the time axis having different offsets.
I believe this parameter is telling you how much offset did the oscilloscoe introduced to your signal to align it where it is (units are screen divisions)
so the Real phase beteween them would be 4,2 time divisions , with each division being 500ns---> real phase difference between flanks is 2,1us which is exactly half your period at 237Khz(as we expected).
Your code is fine, your oscilloscope configration isnt.
By the way, once you fix your oscilloscope config ,the Dead time should be higher than 0
2022-10-19 02:54 AM
Thanks. @gbm @Javier Muñoz .
2022-10-19 05:30 AM
@Hari123 ,
what type of oscilloscope is this?
Thanks,
JW