Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Yalcin_Haksoz
Level 2
Level 2
First like received 10 replies posted 10 questions asked

I want to run two CCU80 (XMC4200) timer slices in phase for an application. However, I see some considerable phase difference between them.

For experimenting, I used CCU80 pwm Apps and placed all four of them. In "General Settings" of the App, I selected "External Start", "Rising Edge",  "Clear and Start Time" and ticked "Synchronous start". The frequency is set to 100 kHz and all dead times are disabled. The code to start the timers externally is below.

Please see the attached screenshot. It shows  all outputs are delayed ~100ns  from the each other.

Is there a way of bringing all in the same phase? Anything I can use in the code or in the timer initialization?

Thanks in advance for your help.

Yalcin

=================

The code:

int main(void)
{
DAVE_Init();

CCU80_CC80->TCSET |= 1u;        //Sets the CC8n run bits
CCU80_CC81->TCSET |= 1u;
CCU80_CC82->TCSET |= 1u;
CCU80_CC83->TCSET |= 1u;

}

 

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

I think it is not a right way to change the PWM parameter in every main loop. We can operate it in interrupt handler.

I write a project, you can run and check whether the logic can meet your requirement.

View solution in original post

0 Likes
11 Replies
lock attach
Attachments are accessible only for community members.
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

1: The register you use is to start the ccu8x.

2:If you want to sync the output, I think you should use the register CCUCON.

3:    I attached my test project, if necessary, please refer. 

 

0 Likes

Thank you very much. That worked great. However in the application after some loop activity involving frequency and duty cycle changes they went out of phase again.

What I would like to achieve is to run two CCU8 slices in perfect synch all the time with zero phase shift. The other two are used for some other function and not available. I tried using a CCU4 slice for synching reference but could not get connections correctly.

I hope you can help.

Best regards,

Yalcin

0 Likes

I should add, ST outputs from the two slices running in perfect synch are used for something else and not available for this purpose.

0 Likes

You say "What I would like to achieve is to run two CCU8 slices in perfect synch all the time with zero phase shift.", if  you want to get the zero phase shift, you should make sure that they have the same duty cycle. If you have the same duty cycle, please give your test project about this issue.

0 Likes
Yalcin_Haksoz
Level 2
Level 2
First like received 10 replies posted 10 questions asked

Duty cycle is 50% for Ch1 in both slices. Ch2 in both can have varying duty cycle. Frequency is variable.

Project is very simple. Just place two CCU8 slices and run them in perfect synch with no phase shift. They are both loaded with the same PRS values but may vary to change the frequency. CRS values should not matter.  ST outputs from both are used for something else and cannot be used for synching the two. The other CCU8 slices ar also used and not available.

Thanks for your help.

YH

 

0 Likes

1: You can refer to the attached Application Note: https://www.infineon.com/dgdlc/en?dcId=8a8181663431cb50013431cb500b0000&downloadTitle=Infineon-CCU8-...

2: Could you attached your test project here?

 

 

0 Likes
lock attach
Attachments are accessible only for community members.
yalcin-haksoz
Employee
Employee
5 replies posted First like given 25 sign-ins

The project is attached. To see the problem please:

  1. Monitor all six pwm outputs using an oscilloscope. At start you will see all lined up correctly.
  2. Using Micrium, change the frequency and the shifts up and down and then bring back to the original settings. 
  3. Now you will see "Right" outputs are back where they were before but "AC" outputs are no longer at the correct position. This is because "Left" and "LeftD" develop some phase shift after a while although they start in phase.

So, this is the reason I need to run two CCU8 slices "Left" and "LeftD" in perfect synch all the time. Any other solution to achieve the desired performance is also OK.

 Thanks in advance for your help.

Best regards,

Yalcin

0 Likes
yalcin-haksoz
Employee
Employee
5 replies posted First like given 25 sign-ins

I also placed two screen captures to show the issue.

0 Likes

As my understanding, you change the PWM value every loop in the main is not allowed. You can try to set the new value when the compare match interrupt occurs. 

0 Likes
lock attach
Attachments are accessible only for community members.

I think it is not a right way to change the PWM parameter in every main loop. We can operate it in interrupt handler.

I write a project, you can run and check whether the logic can meet your requirement.

0 Likes
yalcin-haksoz
Employee
Employee
5 replies posted First like given 25 sign-ins

Thank you. 

0 Likes