View previous topic :: View next topic |
Author |
Message |
jujoab
Joined: 05 Aug 2017 Posts: 41 Location: brazil
|
pwm compile error |
Posted: Mon Oct 30, 2017 2:02 pm |
|
|
the compiler is reporting an error on the "set_compare_time(2, OCR_2, OCRS_2); " saying:
error 58, expenting a close paren
to make shure, i tried to compile 2 or 3 examples from the PICC library, with same result, always on the set_compare_time, highlighting the last operand;
the example I am testing right now is the C:\Program Files (x86)\PICC\Examples\ex_power_pwm
any hint?
jujoba |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19541
|
|
Posted: Mon Oct 30, 2017 2:14 pm |
|
|
What chip?.
Does your chip have the secondary compare registers?. |
|
|
jujoab
Joined: 05 Aug 2017 Posts: 41 Location: brazil
|
|
Posted: Mon Oct 30, 2017 3:21 pm |
|
|
Ttelmah wrote: | What chip?.
Does your chip have the secondary compare registers?. |
Hi Ttelmah
I am testing with the 18f4420.
I think I have a definition problem, will report when I get a solution.
Thanks
jujoba |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19541
|
|
Posted: Tue Oct 31, 2017 2:26 am |
|
|
Your chip does not have the power PWM module.....
The power_pwm functions only work on chips that have the power PWM module.
Yours has a standard CCP, and an ECCP.
The only PIC18's with this module are the 2431 and 4431 I think. |
|
|
jujoab
Joined: 05 Aug 2017 Posts: 41 Location: brazil
|
|
Posted: Tue Oct 31, 2017 8:38 am |
|
|
Ttelmah wrote: | Your chip does not have the power PWM module.....
The power_pwm functions only work on chips that have the power PWM module.
Yours has a standard CCP, and an ECCP.
The only PIC18's with this module are the 2431 and 4431 I think. |
got it
thanks a lot
Right now experimenting with your superb example on
http://www.ccsinfo.com/forum/viewtopic.php?t=54739&highlight=1msec
thanks again
jujoba |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19541
|
|
Posted: Tue Oct 31, 2017 9:07 am |
|
|
You can also do multiple servos 'sequentially' using this approach.
I did a version using the CCP interrupt here:
<http://www.ccsinfo.com/forum/viewtopic.php?t=50914&highlight=servo> |
|
|
|