2021-06-18 05:39 AM
2021-06-18 06:27 AM
In the older STM32 which have Combined/Asymmetric modes, oc1refc and oc2refc both combine oc1ref and oc2ref, thus are identical. That remark is probably from those models.
In 'G4, as a new feature, you can by setting TIMx_CCR5.GC5Cx combine oc5ref into oc1refc/oc2refc/oc3refc so you can achieve two different waveforms on oc1refc and oc2refc, but they will still share at least one channel's output (as they are ultimately combined out of 3 channels, 1, 2 and 5). This may or may not fulfill your requirements, but still using oc1refc and oc3refc provides two outputs combined out of two pairs of entirely independent channels.
JW
2021-06-18 07:37 AM
Thank you for response, but that doesn't help me...Another idea is to generate a pwm signal in edge aligned mode with the HIGH period set by some CCRx registers and other pwm signal to stay at the same limits. Is it possible?
2021-06-18 08:14 AM
I have no idea what do you want to accomplish. Draw a timing diagram. Why would CH3 not be sufficient?
JW
2021-06-18 08:47 AM
Sorry, that is what I should do:The problem is that the MOSFET gate is connected only at CH1, CH1N, CH2, CH2N. When I projected the system I didn't known that I need soft-start for H bridge.
2021-06-18 08:48 AM
I want to start from 0 phase shift to 180 phase shift.
2021-06-18 12:56 PM
OK so just leave CH1 as a plain PWM, and combine CH2's output out of oc2ref and oc5ref by setting TIMx_CCR5.GC5C2, which will cause those two PWMs to be ANDed into CH2's output. Position of one edge is then given by CCR2 and the other by CCR5, so for a pulse of constant length and changing phase against CH1, you must change both simultaneously.
This is probably better tested/learned on a Nucleo board, outputs observed using oscilloscope or LA, than on your live system. CH5 does not have an output, so to get a feeling of what you do, start with CH1 and CH2 to generate overlapping PWM, then switch one of them to the combined AND mode. After initial setup of the timer, the code can run into an infinite loop, while all the experimentation can be done directly by writing to registers in debugger.
JW