ralpok
Joined: 21 Dec 2005 Posts: 25
|
PWM Help!!! |
Posted: Wed Jan 10, 2007 10:48 am |
|
|
I can't get anything to show up on the CCP1 pin when I configure it as a PWM. Here is the code that I use for a PIC18f4685. Does this code look right?? any suggestions for where problems might be? Thanks in advance!!
#include <18f4685.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
void main()
{
setup_timer_2(T2_DIV_BY_16, 7, 1);
set_pwm1_duty(16);
setup_ccp1(CCP_PWM);
while(1)
{
}
} |
|