Menu

hpwm

samco
5 days ago
4 days ago
  • samco

    samco - 5 days ago

    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)

     
  • Angel Mier

    Angel Mier - 5 days ago

    can you attach your source file or an example of the code that fails? this will help us to fix this more quickly.

    Angel.

     
  • samco

    samco - 5 days ago

    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

     
  • samco

    samco - 5 days ago

    here is the gcb

     
  • samco

    samco - 5 days ago

    here is the gcb

     
  • samco

    samco - 5 days ago

    Angel, what could be the problem, i wan to use the sample for something then found out isn't compiling, just stuck here (:

    samco

     
  • Angel Mier

    Angel Mier - 5 days ago

    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?

     
  • Angel Mier

    Angel Mier - 5 days ago

    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

     
  • samco

    samco - 4 days ago

    okay! i have done that and is working now thank you Angel.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.