2017-09-22 01:50 PM
I have got PWMA0 and PWMA1 working but I am not able to get them synced together. There is a 9.2us difference in switching between A0 and A1.
I tried playing around with the FORCE_EN register and but was unsuccessful. Is there any easy way to get this done?
2017-09-25 02:35 AM
Hello Raghu ,
Could you confirmed the device / microcontrollers used ?
Anyway , i am checking the FORCE_SEL register.
Best regards
Erwan
2017-09-25 10:07 AM
Hi Erwan
Thank you for replying. The micro is SPC560P50L5. Im using the SPC560P-DISP eval board.
I have used the following setting without much success.
For submodule0
INIT_SEL = 0
RELOAD_SEL=0
FORCE_SEL = 0
FRCEN=1U
For submodule1
INIT_SEL = 1U
RELOAD_SEL =1U
FORCE_SEL=1U
FRCEN=1U
And after that in the main.c file, I call
FORCE = 1 for submodule 0. I was hoping that a force on submodule 0 would cause the same in submodule 1 also from the register description in the data sheet.
But I think I'm missing something.
2017-09-25 01:08 PM
Hi Erwan
I was able to get it working partially.
I commented the INIT_SEL and RELOAD_SEL and had just the FORCE_SEL and it worked. The two submodules are now synchronously switching only if their duty cycles are same.
If their duty cycles are different, it does not work. Please see attached pictures. I have one of the submodules polarity inverted for the application.
2017-09-25 05:11 PM
Never mind. I figured this one out too.
The PWM was set to Align_Center and it should have been Align_Edge.
Sorry for the constant bombardment of replies in this thread.
Although Im still not done
I would like to switch a GPIO on and off multiple times from the rising edge of only one of the PWM submodules? What is the easiest way to do this? Timer or CTU or ICU?
-Raghu
2017-09-26 01:31 AM
Hello Raghu ,
you are not far from the solution
There is an example in the reference manual RM022
Coudl you try to update INIT = VAL2 = VAL4 ?
Chapter 26.7.2 Edge-aligned PWMs (INIT = VAL2 = VAL4)
Best Regards
Erwan
2017-10-02 02:23 PM
Hi Erwan
I have this working now .Thanks for your help.