This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280049: HRPWM TBPHS and TBPHSHR move waveform in opposite directions

Part Number: TMS320F280049

Hello,

This is related to my previous question on HRPWM TBPHSHR. I am in updown count mode, HR autoconvert is on, HRPE is off, and switching at 200 khz. I am now able to get symmetric waveforms and the edges shift correctly. The problem I am seeing now is the tbphs and tbphshr shift the waveforms in opposite directions. That is, a tbphs to tbphs+1 will move the slave in one direction and a tbphshr =256 (minimum) to tbphshr = 64000 will move it in the opposite direction. This is shown in the figure below and I am setting/verifying the register values in the expression windows. 

If all the HRPWM registers do is shift the waveform to the right (both edges for tbphshr) then I can see this behavior being correct and the math needing to be different depending on if you are leading or lagging. However, I didn't see this in the datasheet or online. This question (https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/858613/tms320f28379d-usage-information-on-trrem-register-for-periodic-hr-phase-update) says you need to subtract the HR phase for a negative phase shift, but that still wouldn't give the right value as you have to add +1 to tbphs first. 

For example, if my understanding is correct and I wanted a leading phase shift of 5.75 I would need tbphs = 6 (not 5) and then set tbphshr = 64000-48000 (roughly) so the correct phase comes out to be 6-0.25 = 5.75. Is this the proper way to do a leading tbphshr phase shift? 

Meanwhile a lagging phase shift of 5.75 would be tbphs =5 tbphshr = 0.75*(64000)? 

Thanks



Old question 
https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1067453/tms320f280049-adding-hwpwm-tbphshr-to-dab-converter-causes-loss-of-waveform-symmetry