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 support@ccsinfo.com

PWM Help!!!

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



Joined: 21 Dec 2005
Posts: 25

View user's profile Send private message

PWM Help!!!
PostPosted: Wed Jan 10, 2007 10:48 am     Reply with quote

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)
{

}
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jan 10, 2007 12:24 pm     Reply with quote

http://www.ccsinfo.com/forum/viewtopic.php?t=17729&highlight=pwm+middle
ralpok



Joined: 21 Dec 2005
Posts: 25

View user's profile Send private message

Thnx
PostPosted: Wed Jan 10, 2007 2:00 pm     Reply with quote

Thnx!! setting up both the ccp's cleared it up since they were misslabled on the board.
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