Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
Hello team,
Here i want to add my 2 observations with TBPHSHR register for High-Resolution Phase shift.
Microcontroller i'm using :- TMS320F280039C
My current configurations in sysconfig are as per below
EPWMCLK:- 120MHZ
Time Base Clock Divider: - Divide clock by 1
High Speed Clock Divider:- Divide clock by 1
Time Base Period - 1000
Counter Mode:- Up - count mode
For my EPWM Peripheral:- EPWM3 Sync-in source is EPWM4 sync-out signal.
currently we are having Phase shift resolution of 0.36(360 degree/1000).
when i am using ePWM functionality of phase shift by Enabling Phase Shift Load by giving Phase Shift value, i am achieving required desired phase shift between EPWM3 and EPWM4.
1) now i want to use the HRPWM for achieving High-Resolution Phase shift.
Configurations in sysconfig done as per below
when i build the project, then in generated files -> board.c -> Board_init function is generated in which EPWM_init function is called in which HRPWM_setPhaseShift function is called.
As expected i should get 0x0064 in TBPHS register and 0x2800 in TBPHSHR register.
if we see it in degree then that means 36 degree (0X64 IN TBPHS Register) which should give 833 ns Phase shift between EPWM3 and EPWM4 and from TBPHSHR Register (0x2800) i.e. 40 is number of MEP STEP and 1 MEP STEP is 180 ps that means 7.2ns (0.31 Degree). i am expecting here total 36.31 degree. But my observation is quiet stranger. when i am checking PWM Phase Shift between EPWM3 and EPWM4 there is Zero degree Phase shift.
is there anything i am missing in configuration?
2) As i am not able to get desired phase shift with above configurations, so i am not enabling HRPWM from sysconfig and instead i am using HRPWM_setPhaseShift function in code simply.
for example, if i call HRPWM_setPhaseShift function with (0x6428), that means i am expecting 36.31 degree (Phase shift between EPWM3 and EPWM4 should be of 840.2ns). but only 36 degree phase shift shift we are getting remaining 0.31 degree phase shift still we are not getting despite of using HRPWM for High-Resolution Phase shift. here we are expecting 840.2 ns but we are only achieving 833 ns. the finite resolution for remaining fraction part we are not achieving even though after using HRPWM_setPhaseShift function along withHRPWM_enablePhaseShiftLoad.
also we checked for HRPWM_setHiResPhaseShiftOnly as well, but it didn't worked.
we have taken no. of different tests to verify the same and we found that we are not able to get the finite resolution for remaining fraction part with HRPWM functionality.
Is there any more functions we need to include or anything we are missing let me know.
Thank you.