CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PWM setup

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Visitor
Guest







PWM setup
PostPosted: Thu Jun 22, 2006 1:44 pm     Reply with quote

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! Very Happy
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group