Does the high resolution PWM delay block feature work with centered PWM generation? How do you set up the fractional bits for this mode?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Does the high resolution PWM delay block feature work with centered PWM generation? How do you set up the fractional bits for this mode?

832 Views
ameares
Contributor I

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

Labels (1)
0 Kudos
3 Replies

489 Views
ameares
Contributor I

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)

0 Kudos

489 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

0 Kudos

489 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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 

0 Kudos