PDA

View Full Version : Settings for pulse width modulation



Ioannis
- 28th September 2023, 16:22
How can one calculate the values to place in PR2 and select the proper pre and post scale for timer2 when setting for a PWM output?

Seems a bit confusing to me how to set a 12f617 chip to output pwm on GP2 pin.

Thanks

richard
- 28th September 2023, 22:17
does this help see post #2
https://www.picbasic.co.uk/forum/showthread.php/26615-Infrared-HPWM-setup

Ioannis
- 29th September 2023, 15:40
Yes it does. Thanks,

Ioannis

Ioannis
- 30th September 2023, 22:16
Anyone interested here is a tool in Excel to calculate the PR2 register and the CCP register value.

If any of these two values are greater than 255 and 1023, the cell turns yellow with red bold font.

As usual, remove .txt from the file name to make it open with Excel.

Ioannis

9472