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.

TMS320F28379D: HRPWM Implementation Issue

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hi.,

    I am working on TMS320F28379D controller using Code Composer Studio 12.3 IDE. I already worked on a ePWM (Pwm1 A,B  Pwm2 A,B & Pwm3 A,B)for 6 channels and they are working fine. I am using updown counter mode, 100MHZ epwm clock frequency and 200 kHz output pwm frequency. In my code there was mentioned like PWM1 act as master and other 2 are slaves using some sync settings. Now i want to add a HRPWM feature in that 6 channels. using example code, i modified my code and tested but it was not working.  In ePWM generally we put period value in HBPRD register and we can change duty by changing CMPA register value. but slightly i confused with HBPRDHR and CMPAHR register as what value i want to load. Also i dont want to use auto-conversion feature using SFO library. Due to adding HRPWM feature, anything i want to modify in ePWM registers? Is phase need to be enable? what are the configuration must need to do?  kindly suggest.

  • Hello,

    I wanted to first ask if you have already referenced our HRPWM software examples in C2000Ware? ([C2000Ware]\driverlib\f2837xd\examples\cpu1\hrpwm) these would be helpful for you to refer to if you haven't already.

    We have examples that specifically implement high-resolution duty control (CMPAHR/CMPBHR). If you want to change the duty, you can just use CMPAHR/CMPBHR  to control this where CMPAHR applies HR to channel A and CMPBHR applies HR to channel B (this note can be confusing sometimes since CMPA and CMPB are not specific to channel A and B in the same way). If you want to control the frequency, you would use TBPRDHR. Please note that you have to enable HR control by setting the HRPE bit in either of these cases.

    Is there a particular reason you do not want to use SFO library and autoconversion? The SFO library calibrates the HR delay elements based upon ambient conditions and normalizes it to your EPWM clock period (e.g. when the 8-bit CMPAHR is maxed out to equal 255, this is equivalent to 1 EPWM clock cycle). Using autoconversion is recommended and helps by performing background calculations for you - otherwise, you will need to do the calculations yourself in software.

    Best Regards,

    Allison