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 channels

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







PWM channels
PostPosted: Thu Aug 21, 2003 5:58 pm     Reply with quote

Colleagues,

PIC18F6720 has five (5) CCP/PWM pins, but CCS compiler has functions only for the two different frequencies and duty cycles. I need to configure all PWM pins for different frequency and duty cycle. Is it possible? How can it be done? Code sample will be appreciated the most.

Thanks!

Nick
___________________________
This message was ported from CCS's old forum
Original Post ID: 144517141
R.J.Hamlett
Guest







Re: PWM channels
PostPosted: Fri Aug 22, 2003 3:25 am     Reply with quote

:=Colleagues,
:=
:=PIC18F6720 has five (5) CCP/PWM pins, but CCS compiler has functions only for the two different frequencies and duty cycles. I need to configure all PWM pins for different frequency and duty cycle. Is it possible? How can it be done? Code sample will be appreciated the most.
:=
:=Thanks!
:=
:=Nick
Have you actually tried it?...
If you look in the 'define' file for the 18F6720, is has define values for CCP channels up to 5, and the 'setup_ccp' function in the manual now shows support for all five channels. The 'set_pwmx_duty' function, though not (yet) documented, also happily works:
.................... setup_CCP5(CCP_PWM);
0038: MOVLW B7
003A: ANDWF FB1,F
003C: BCF F98.4
003E: BCF F8F.4
0040: MOVLW 0C
0042: MOVWF F70
.................... set_pwm5_duty(128);
0044: MOVLW 80
0046: MOVWF F71

Remember the manual often lags the compiler as new features like this are added to chips (they only update the manual every few years).

Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 144517144
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