Visitor Guest
|
PWM setup |
Posted: Thu Jun 22, 2006 1:44 pm |
|
|
Hi,
I have a simple question to ask.
I'm using one PWM output in my PIC. I have it setup properly...the code works:
setup_ccp1(CCP_PWM);
setup_timer_2(T2_DIV_BY_4, 0xA7, 1);
set_pwm1_duty(duty);
In my program, I sometimes disable this PWM pin, and simply use it as a TTL 5V output. I use the line setup_ccp1(CCP_OFF); to disable the PWM function.
My question is: when I want to renable the PWM function, do I simply do setup_ccp1(CCP_PWM); or do I have to set the values for timer 2 and pwm duty again?
Thanks! |
|