hey, after i updating my compiler to the new version i got this error please someone should help me on how to solve it, on the old compiler it compile fine but when i copy past on new one it doesnt work rather show this error (2025.10.04 (Windows 64 bit) : Build 1523)
pwm.h ** (461): Error: Cannot store 2.6 in the byte variable DC1B0 (System Include)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
' ---
'Main code
'freq 40khz
'variable duty from 0% to 100%
do
'Turn up brightness over 2.5 seconds
For Bright = 1 to 255
HPWM 1, 40, Bright
wait 10 ms
next
'Turn down brightness over 2.5 seconds
For Bright = 255 to 1
HPWM 1, 40, Bright
wait 10 ms
next
loop
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
it seems to be a bug on the pwm code for the legacy chips, I found that If you change the pic speed to any value lower than 10mhz (like a 8mhz crystal) it compiles successfully on that chip, can you test if this work around produces the expected PWM?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Disregard my previous post, Evan just fixed the bug on the library, download this attached package and double click on it to add to GC Studio, this should fix the issue. Test and report back.
hey, after i updating my compiler to the new version i got this error please someone should help me on how to solve it, on the old compiler it compile fine but when i copy past on new one it doesnt work rather show this error (2025.10.04 (Windows 64 bit) : Build 1523)
pwm.h ** (461): Error: Cannot store 2.6 in the byte variable DC1B0 (System Include)
can you attach your source file or an example of the code that fails? this will help us to fix this more quickly.
Angel.
chip 16F876A,20
;#option explicit
' ---
'Main code
'freq 40khz
'variable duty from 0% to 100%
do
'Turn up brightness over 2.5 seconds
For Bright = 1 to 255
HPWM 1, 40, Bright
wait 10 ms
next
'Turn down brightness over 2.5 seconds
For Bright = 255 to 1
HPWM 1, 40, Bright
wait 10 ms
next
loop
here is the gcb
here is the gcb
Angel, what could be the problem, i wan to use the sample for something then found out isn't compiling, just stuck here (:
samco
it seems to be a bug on the pwm code for the legacy chips, I found that If you change the pic speed to any value lower than 10mhz (like a 8mhz crystal) it compiles successfully on that chip, can you test if this work around produces the expected PWM?
Disregard my previous post, Evan just fixed the bug on the library, download this attached package and double click on it to add to GC Studio, this should fix the issue. Test and report back.
Angel
okay! i have done that and is working now thank you Angel.