PDA

View Full Version : HPWM coding



civictypeR
- 29th January 2008, 14:45
Hey guys , I am curious as I tried this experiment out and I wonder this coding really functions. I am using Melabs to do my programming and PIC16F877A to control my DC motor driver IC modelled L293B . It required PWM to control the voltage output to my DC motor . THe coding is below as shown .
\
DEFINE OSC 20

TRISC = %00000000

HPWM 1, 150, 16000
pause 3000
HPWM 2, 50, 16000
pause 3000

. The means that 1 pin in port C will output a certain PWM and portC.2 will output another output . Is it possible if i use the HPWM command on 1 same pin many times and change the frequency ? Will my output change ? Thanks a lot .

Civic type R

skimask
- 29th January 2008, 14:54
Hey guys , I am curious as I tried this experiment out and I wonder this coding really functions.
If you tried it, then you should know if it functions or not...right?


The means that 1 pin in port C will output a certain PWM and portC.2 will output another output . Is it possible if i use the HPWM command on 1 same pin many times and change the frequency ?
Yes, except for the possible 'glitch' when changing duty cycles, it should work like you think it should work.