I have my HPWM CCP code running on a 16F18326 (which has a CCP module) and I should be happy with that, but for some reason I'm trying to get HPWM running on a 12F1501 (no CCP). To simplify things I am now trying the dimmer demo, but I get this error message:
pwm.h (0): Error: Chip cannot support This chip does not support CCP1/PWM - use #DEFINE DISABLECCPFIXEDMODEPWM to disable CCP1/PWM
Reading about "HPWM 10 Bit" in the GCBASIC documentation, I get the impression that since the 12F1501 has a 10bit PWM module and timer2, this should run (not requiring CCP). -But I am very far from sure of, well, anything. Is this about a limitation of the 12F1501?
#chip 12F1501, 16
#option Explicit
DIR PORTA.2 out
#define USE_HPWM1 TRUE 'adding this had no effect
dim Bright as word
do
'Turn up brightness over the range
For Bright = 0 to 1023
HPWM 1, 40, Bright, 2
wait 10 ms
next
'Turn down brightness over the range
For Bright = 1023 to 0 Step -1
HPWM 1, 40, Bright, 2
wait 10 ms
next
loop
Last edit: Roger Jönsson 2025-01-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The HPWM should work but first we have to resolve the error message ( which is not being disabled by the of #DEFINE DISABLECCPFIXEDMODEPWM.
I have looked and I needed to resolve this dependency checking error message that is causing your error message.
I have added a significant enhancement in the compiler's dependency checking system. I have added a new parameter DISABLE to the #option required directive that allows global disabling of dependency checking.
#option required DISABLE
This addition addresses a latent issue that has existed since the initial implementation of #option required. Back in 2020 ... Hugh and I did discuss if #option required would cause issues.. it did many years later! :-)
The original dependency checking system, while valuable for ensuring code reliability, didn't provide a straightforward way to globally disable these checks when needed. This limitation has created an unnecessary constraints for developers who needed more flexibility in their implementation approaches and where the no real method to disable the checks.
The upcoming compiler release will include this new parameter, giving developers more control over dependency validation. You can now choose to:
- Continue using standard dependency checking with #option required
- Globally disable dependency checking using #option required DISABLE
So, for now, you need access to the compiler now. So, download from here These are the 64bit versions. If you need 32bit - please ask.
Test by adding the following. This should resolve for you.
#option required DISABLE
Then, you can see if the HPWM works as expected.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have my HPWM CCP code running on a 16F18326 (which has a CCP module) and I should be happy with that, but for some reason I'm trying to get HPWM running on a 12F1501 (no CCP). To simplify things I am now trying the dimmer demo, but I get this error message:
pwm.h (0): Error: Chip cannot support This chip does not support CCP1/PWM - use
#DEFINE DISABLECCPFIXEDMODEPWM
to disable CCP1/PWMReading about "HPWM 10 Bit" in the GCBASIC documentation, I get the impression that since the 12F1501 has a 10bit PWM module and timer2, this should run (not requiring CCP). -But I am very far from sure of, well, anything. Is this about a limitation of the 12F1501?
Last edit: Roger Jönsson 2025-01-15
Roger,
The HPWM should work but first we have to resolve the error message ( which is not being disabled by the of
#DEFINE DISABLECCPFIXEDMODEPWM
.I have looked and I needed to resolve this dependency checking error message that is causing your error message.
I have added a significant enhancement in the compiler's dependency checking system. I have added a new parameter
DISABLE
to the#option required
directive that allows global disabling of dependency checking.This addition addresses a latent issue that has existed since the initial implementation of
#option required
. Back in 2020 ... Hugh and I did discuss if#option required
would cause issues.. it did many years later! :-)The original dependency checking system, while valuable for ensuring code reliability, didn't provide a straightforward way to globally disable these checks when needed. This limitation has created an unnecessary constraints for developers who needed more flexibility in their implementation approaches and where the no real method to disable the checks.
The upcoming compiler release will include this new parameter, giving developers more control over dependency validation. You can now choose to:
- Continue using standard dependency checking with
#option required
- Globally disable dependency checking using
#option required DISABLE
So, for now, you need access to the compiler now. So, download from here These are the 64bit versions. If you need 32bit - please ask.
Test by adding the following. This should resolve for you.
Then, you can see if the HPWM works as expected.
Updated Help can be found at:
https://github.com/GreatCowBASIC/Help/blob/main/source/optionrequired.adoc
Should I put these files in the gcbasic folder, replacing the old ones?
And then use - #option required DISABLE - in my PIC program in GC Code?
Last edit: Roger Jönsson 2025-01-15
Yes. This is a low risk change.
Yes! It's alive!
Excellent. Great news.