|
|
View previous topic :: View next topic |
Author |
Message |
kender_a Guest
|
PWM channels |
Posted: Thu Aug 21, 2003 5:58 pm |
|
|
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 |
Posted: Fri Aug 22, 2003 3:25 am |
|
|
:=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 |
|
|
|
|
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
|