PDA

View Full Version : pic 18Fxx31 PWM module



dirace
- 15th May 2005, 18:22
Is it possible to use the PWM modules of PIC 18Fxx31 uCs and how?

Thanks in advance

Acetronics2
- 15th May 2005, 18:42
Hi, dirace

Your answer is YES, using the HPWM function ( simpler ) , as they are supported by the 2.45 release , or using assembler ...a bit trickier.

Alain

dirace
- 15th May 2005, 18:53
I use the following code:

Define OSC 4

hpwm 0,127,2000
hpwm 1,127,1500

go:
Pause 50
goto go

This outputs PWM on RC1 and RC2 where CCP1 and CCP2 is and not on RB0 and RB1 where PWM0 and PWM1 is.
And both signal are 1.5KHz!!!

What am i doing wrong?

Acetronics2
- 15th May 2005, 19:51
Just read manual : HPWM1 AND HPWM2 use the same clock ( TIMER 1) ...
so, it's the same PWM frequency .... with PBP or Assembler !!!

Alain