Hello everybody,
to realize a spread spectrum frequency modulation with two pwm signals and nano edge placement I currently vary the periode using VAL1. Frequency varies between 105kHz - 95kHz, nanoedge 2x clock runs at 168MHz.
I realized, that the periode setting with VAL1 seems to be non linear. Also the dutycycle values doesn't seem to vary linear. If I use SDK function PWM_UpdatePwmDutycycle() the dutycycle does not come out exactly.
Could you explain why the values are non linear?
Do you have a better idea how to realize a frequency dithering feature?
Many thanks
Katharina
Solved! Go to Solution.
Hie Diego,
got it working, dithering function does not work for a frequency dithering from 95kHz to 100kHz, just around the nearest whole number.
Non linearity was because of rounding problems.
Regards
Hi @katha
I hope you are doing well!
Could you detail us further the non-linear variations that you are seeing for the duty cycle and PWM period? For example , when you call PWM_UpdatePwmDutycycle() to increment/decrease/set the duty cycle , the error in the duty cycle edges can vary in many different clock cycles?
Our colleague Xiangjun Ron provides a document and demo code introducing the Nano-edge placement. To get fine edge control the period the FRACVAL registers are also used. Nano-edge placement feature for eFlexPWM module based on KV4x
According to the KV44, the fine edge control , can be also simulated with dithering, this applies for those sub-modules that are not supported by the Nano edge placer.
All the best
Diego.
Hie Diego,
got it working, dithering function does not work for a frequency dithering from 95kHz to 100kHz, just around the nearest whole number.
Non linearity was because of rounding problems.
Regards