Hello!
As I don't know who exactly designed the C2000 Simulink block set, I'm asking my question here.
I want to use the F2837xD block from said package to create four synchronized 100kHz, 50% duty cycle PWMs, each phased shifted with respect to the others.
The goal is to implement the control for a phase-shifted dual half-bridge DC/DC-converter. Therefore, PWMs 1 and 2 have to be 180° out of phase, as do PMWs 3 and 4. The hard part is finely controlling the phase between PWM1 and PWM3 (which actually controls the converter).
I built an experimental model that runs on the LaunchPad C2000 TMS320F28379D. The ePWM clock rate is set to 100MHz (SYSCLKOUT/2), Time base clock prescaler in each ePWM module is 1.
The scheme I'm using is the following: ePWM12 generates a 100MHz "master clock", that generates a SYNCOUT signal every time the counter reaches zero. I use this SYNCOUT to synchronize all other "slave" PWMs (ePWM1 up to ePWM4). The latter have their Sync. Output set to "Pass through". The slaves use the counter period value of the master (ePWMLink TBPRD set to ePWM12).
Because high resolution is needed, I enabled the option "Enable high resolution PWM (HRPWM)" in the slave ePWM modules (not in the master). I enter the phase shift value as a decimal (in this case, i tried the register value 10.25)
With that, I encountered a bug:
The code generator doesn't generate code for updating the TBPHSHR register with my phase shift value. It only initializes TBPHSHR to zero. Therefore, I don't see the decimal, so to speak the "high resolution" part of the phase shift in my output signal. I measure the signal directly at the pin with a 200MHz oscilloscope and 500MHz probes. I only see a phase shift corresponding to the normal TBPHS register (the integer part of the phase shift).
Is there a workaround or hotfix for this?
Sincerely
Matthias
Student (University of Applied Sciences Ingolstadt)