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.

TMS320F28P650DK: Changing periods when using HRPWM in period mode

Part Number: TMS320F28P650DK
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hello,

I'm using the HRPWM peripheral in up-count mode and am attempting to do high resolution period control. I am noticing that when I attempt to implement this, I'm getting a period that is shifting back and forth. So for example, I configure for a period of 686ns, and I will get one cycle that has a 686ns period, but then the following cycle will have a 690ns period. It seems very similar to this issue ( TMS320F28P659DK-Q1: Jitter using HRPWM in period mode ), but using the solution listed does not work for me (using their version of the SFO library). I am using the latest SFO library from C2000Ware v5.5. I have configured EDGMODE for BEP, CTLMODE set to 0 (for non phase control mode), HRLOAD to HR_CTR_ZERO_PRD, AUTOCONV to 1 (SFO confirmed working as expected in duty cycle mode), HRPE to 1. I noticed the issue happening with other chips as well, although at a different frequency. For example, on the 280039 controlCARD, I noticed this happening about every 7 cycles (getting the unexpected 690ns period). Can you think of any likely culprits configuration wise I might be getting wrong here? I did the HRPWM ex3 prd updown example and it seemed on its surface like it was working correctly. I attached images of the two different periods that show up. Let me know if I can provide any other useful information. Thanks!

  • To follow up on this, it seems like I am getting contradictory information on whether or not it is possible to use HRPWM period mode in up-count. When I attempt to configure using syscfg, I see a message stating that "If counter mode is up count mode, edge control of both edges is not supported". However, when I configure the edge mode to be not both edges, I see a message saying "For High Resolution Period: Shadowing loading of CMPAHR should occur when TBCTR=0 or PRD and MEP should control both edges". So this is stating that for HR period, it is necessary to have the MEP control both edges, but for up count mode, edge control of both edges is not supported, which logically seems to indicate that HR period wouldn't be compatible with up-count mode.

  • Hi,

    Can you confirm your configurations with the TBPRDHR C2000Ware example ?

    I will confirm by next week if up count mode supports both edge control

    Thanks

  • Using my configuration with the TBPRDHR example ran into the same issues. However, upon digging through the forums I eventually came across an example ( TMS320F280049C: Implementing HR duty and period control in up-count mode ) that worked for what I was trying to do. It appears that period control with up-count only works properly if the set event is on the PRD event, not the ZRO event. Would be nice to see this noted in the manual.

  • Thanks Sean, we will take a note of this