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

Problem with PWM on pic18f1320

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







Problem with PWM on pic18f1320
PostPosted: Mon Jun 19, 2006 6:17 pm     Reply with quote

I want to have pwm on one channel on this device (RB3/CCP1). I got that working but the enhanced CCP seems to be forcing all the other parallel ccp ports (P1B, P1C, P1D) active low and I can't use them. I need these I/O's to do regular I/O while the CCP1 channel is running pwm. It looks like CCP1CON is getting set correctly (to 0x0C), but that doesn't seem to allow me to use the I/O's. What am I doing wrong?

Code snippet:

set_tris_b(0x00); // all output on port b
//.........
setup_timer_2(T2_DIV_BY_4, 255, 1);
CCP1CON = 0x00;
CCP_1_LOW = 0x00;
//.........
// turn on PWM
CCP1CON = 0x0C;
CCP_1_LOW = 0x20;
// continue......

Any help/suggestions?
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