|
|
View previous topic :: View next topic |
Author |
Message |
allenhuffman
Joined: 17 Jun 2019 Posts: 554 Location: Des Moines, Iowa, USA
|
5.093: Compiler error with two CCP PWMs |
Posted: Wed Mar 18, 2020 10:52 am |
|
|
Due to the "garbage" in the error output, I suspect this is a bug and have already contacted CCS for advice, but thought I'd ask here...
Has anyone used two of the CCPs to generate PWM on a pin? I have this:
Code: | #PIN_SELECT CCP2OUTA=BEEPER_PIN
#use pwm(CCP2, FREQUENCY=4000, DUTY=50, PWM_OFF, STREAM=BEEPER_PWM) |
...which works. And I have this:
Code: | #PIN_SELECT CCP3OUTA=BACKLIGHT_PIN
#use pwm(CCP3, FREQUENCY=4000, DUTY=100, PWM_OFF, STREAM=BACKLIGHT_PWM) |
...which also works. But, I can't build when both of them enabled. I get this:
Quote: | *** Error 99 Line 152(8,75): Option invalid PWM PIN_‰15 already used
|
I am also unclear on how PIN_SELECT works when both are on the same CCPx. i.e., CCP2OUTA / CCP2OUTB, but there is only CCPx as a parameter for the #use PWM. _________________ Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Wed Mar 18, 2020 11:04 am |
|
|
Someone who knows will chime in soon,here's my wild idea...
Code/compile/print the listing for the 2 versions.
See which registers get setup, look at datasheet to confirm.
You should (may) be able to cut a third program and 'hard code' the registers the way you want IF possible.
Jay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
|
|
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
|