Electronic – PWM-modules operating simultaneously on different frequencies

microcontrollerpicpic16fpwm

I am using a PIC16F15345 which has 4 10-bit PWM modules.
In order to minimize electromagnetic interference I tried to use the PWM-modules on different frequencies working simultaneously, but it did not work.

According to the data sheet (page 328) "each module has an independent selection of clock source."

However, the Timer2 is shared by all 4 modules and the PWM period value is stored in the T2PR (PR2) register. As the Timer2 require FOSC/4 as the clock source for PWM I don't see how I can vary the PWM period, via T2PR register, individually per PWM module.

In my trials, the PWM period changes for all 4 modules each time T2PR changes.

Any ideas how to do it or is it not possible?

Best Answer

Thanks to glen_geek I have managed to conclude that the PIC16F15345 do not allow for different frequencies on different PWM-modules running in parallel. The PIC16F1574, which glen_geek refers to, can do this by varying phase and offset per PWM-module. Furthermore, the clock source/prescaler can be selected per PWM-module.

Related Topic