The current pwm.h library causing compilation errors on devices like PIC12F683.
To fix this, we updated pwm.h using if condition.
#ifdef(DC1B0)' For devices like PIC12F683 that use DC1B1/DC1B0 definitions DC1B1 = DutyCycleL.7 DC1B0 = DutyCycleL.6 #else def(CCP1X)' For devices like PIC16F877A that use CCP1X/CCP1Y definitions CCP1X = DutyCycleL.7 CCP1Y = DutyCycleL.6 #endif
Unfortunately, I've already edited the original file. I was getting a compilation error around lines 461 and 462 in the pwm.h file. The error was occurring for either the 12F683 or the 16F877A.
Then I edited the pwm.h file to support both microcontrollers properly. You can try generating PWM on the 16F877A and 12F683 with the original library to see the compilation error.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I am a beginner at GCBasic, so please accept my apologies if I am making a silly mistake. To clearly replicate the issue I experienced from the very beginning, I did a fresh install of GCB Studio. I have also taken screenshots so you can see the error first-hand.
Hi GCBASIC community,
The current pwm.h library causing compilation errors on devices like PIC12F683.
To fix this, we updated pwm.h using if condition.
Thanks, again.
Please post the library you have adapted. I will do a diff to ensure the change is merged.
Here is the adapted pwm.h file. I have attached it to this post.
Thanks for your interest.
Can you post a GCBASIC source program that shows the error?
I want to see the error here.
Unfortunately, I've already edited the original file. I was getting a compilation error around lines 461 and 462 in the pwm.h file. The error was occurring for either the 12F683 or the 16F877A.
Then I edited the pwm.h file to support both microcontrollers properly. You can try generating PWM on the 16F877A and 12F683 with the original library to see the compilation error.
Sorry, I cannot reproduce.
Am I using the correct HPWM instructions?
I tried a new and an old installation of GCBASIC and got no errors.
Evan
Hi, I am a beginner at GCBasic, so please accept my apologies if I am making a silly mistake. To clearly replicate the issue I experienced from the very beginning, I did a fresh install of GCB Studio. I have also taken screenshots so you can see the error first-hand.
You have done a great job.
Post the source GCB and the ASM being produced. You may want to create a zip file.
I hope it helps you fix this error.
pAlso, post the original pwm.h
I hope it helps you fix this error.
Use the PWM.H there was a fix in December 2025 ( therefore after the release you have ) to resolve an issue with legacy 8,9&10bit CCP1.
Work ok on test here with your code.
Thanks for reporting.