May 15, 2019
02:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 15, 2019
02:51 AM
Greetings all,
I have 3 x PWM APP's all running the same duty and period.
I would like to phase shift them such that the output pulses are spread equally over the period.
Is there a method for doing this ? I'm thinking I should be able to initialise the timer value of each PWM to different values before I start them. Something like PWM_SetTimerValue().
Any suggestions would be greatly appreciated.
PHAB
I have 3 x PWM APP's all running the same duty and period.
I would like to phase shift them such that the output pulses are spread equally over the period.
Is there a method for doing this ? I'm thinking I should be able to initialise the timer value of each PWM to different values before I start them. Something like PWM_SetTimerValue().
Any suggestions would be greatly appreciated.
PHAB
- Tags:
- IFX
1 Reply
May 16, 2019
09:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 16, 2019
09:08 AM
OK, so there is a bug in the XMC PWM hardware or library. You cannot set the CCUy TIMER value once the CCUy module has been initialised by "DAVE_Init()". You can't even manually write to the CCUy TIMER value using the debugger. This could be why the Infineon have not published a "SetTimerValue" method for the PWM App.
I reported this under e-ticket 28586855 some time ago and it has now been closed. I have raised a new e-ticket 303874228.
In the mean time there is a work-around. Before trying to set the CCUy TIMER value, set the CCUy "General Idle Disable" bits(s) then start the CCUy(s)
For example...
I hope this helps someone (took me some time to figure out)
PHAB
I reported this under e-ticket 28586855 some time ago and it has now been closed. I have raised a new e-ticket 303874228.
In the mean time there is a work-around. Before trying to set the CCUy TIMER value, set the CCUy "General Idle Disable" bits(s) then start the CCUy(s)
For example...
int main(void)
{
PWM_t* HandlePtr;
uint32_t TimerValue;
DAVE_STATUS_t status;
status = DAVE_Init(); /* Initialization of DAVE APPs */
HandlePtr = &PWM_DRV2;
// The following line clears the idle states and is a work around for a bug in the PWMSP002 App or hardware
CCU81->GIDLC |= CCU8_GIDLC_CS3I_Msk | CCU8_GIDLC_CS2I_Msk | CCU8_GIDLC_CS1I_Msk | CCU8_GIDLC_CS0I_Msk;
// Offset the PWM_DRV2 timer (phase shift)
XMC_CCU8_SLICE_SetTimerValue(HandlePtr->ccu8_slice_ptr, (uint16_t)10000);
PWM_Start(&PWM_DRV1);
PWM_Start(&PWM_DRV2);
while(1U)
{
}
}
I hope this helps someone (took me some time to figure out)
PHAB