I am using the PWM in centered mode and I would like to try using the high resolution fraction bits. I am not sure how to set the fractional bits for VAL2 since VAL2 has a negative number and the counter is counting up from a negative number.
For example,
SM1INIT = -1000;
SM1VAL1 = +1000;
Say I wanted to set the duty cycle to about 50%.
VAL2 = -500;
VAL3 = +500;
Can I use FRACVAL3, and FRACVAL2, to obtain a duty cycle of 1001.5 counts? Does this mean you set the FRACVAL3 to 0.25 and FRACVAL2 to 0.75 and VAL2 to -501?
I am using the MC56F82xxx series but this would apply to other processors as well.
Thanks, any tips are welcome.
-Andrew Meares
The documentation leaves me with many questions since it only covers each feature in isolation. Some questions like this timing issue can be answered by a little experimental code. I suspect now that it will be more efficient to simply apply twice the fractional part to the FRACVAL3 register and deal with rounding up VAL3 rather than figure out how to implement non-causal delays. (little joke)
Hi, Andrew,
Based on your requirement, I write a documentation so that it is helpful to the customers who have the same question.
https://community.nxp.com/docs/DOC-335308
BR
Xiangjun Rong
Hi, Andrew,
Yes, you can set the FRACVAL3, and FRACVAL2 to get fractional duty cycle.
Pls refer to the documentation and the code.
Hope it can help you
BR
Xiangjun rong
The feature Fraction Delay logic with Micro-Edge Placement for eFlexPWM module