logo elektroda
logo elektroda
X
logo elektroda

[W600 Chip] Configuring PWM for RGBCCT Lightbulb LED Channel Brightness Control

DanteBC 1290 14
ADVERTISEMENT
  • #1 20884210
    DanteBC
    Level 4  

    Disassembled and successfully flashed an openbeken firmware for my lightbulb based on a W600 chip.

    By trial-and-error method, I managed to figure out five pins that are used for LED channels:
    red - pa5
    green - pb13
    blue - pb15
    WW - pb8
    CW - pb16

    I can activate those via LED pin mode just fine, but I feel like I need a PWM mode to actually control channel brightness. But it looks like I can only enable PWM mode on pins pb14-18. Maybe I need to use some other pin mode I'm missing. As far as I understand, there is no LED controller in this lightbulb because channels are controlled directly. Can anyone help me with this?
  • ADVERTISEMENT
  • #2 20884432
    p.kaczmarek2
    Moderator Smart Home
    It seems that not yet all PWM pins are enabled in hal_pins_w800.c, which is also used for W600:
    Code: C / C++
    Log in, to see the code


    I can try to enable remaining pins for you, would you be able to test new build once it's ready? I don't have W600 at hand, so it might take several attempts to get it right.
    Helpful post? Buy me a coffee.
  • #3 20884444
    DanteBC
    Level 4  

    p.kaczmarek2 wrote:
    I can try to enable remaining pins for you, would you be able to test new build once it's ready? I don't have W600 at hand, so it might take several attempts to get it right.


    Sure. Let's try it. I prefer using OTA, so I don't have to desolder the chip again.
  • #4 20884639
    p.kaczmarek2
    Moderator Smart Home
    
    red - pa5
    green - pb13
    blue - pb15
    WW - pb8
    CW - pb16
    

    According to datasheet, PA5 is PWM_1, PB13 is PWM_2, PB15 is PWM_4, PCB8 is PWM_5 and PB16 is PWM_3 , so it should work.
    Can you download build files from this pull request (find "download build artifacts, unpack zip"), do OTA, and recheck?
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1015
    Helpful post? Buy me a coffee.
  • #5 20884691
    DanteBC
    Level 4  

    As far as I see all Wxxx images are failed to build, therefore there are no images of them inside the artifacts zip. Can you check please?
  • ADVERTISEMENT
  • #6 20884697
    p.kaczmarek2
    Moderator Smart Home
    Sorry, there must be some typo or something, I am helping now in about 4 threads and I am doing it in "round robin" manner, I haven't noticed it failing.
    Oh yes, it's a typo:
    Screenshot of a compilation error message indicating a typo in the code.
    I have put a dot instead of a comma. Let me fix this... and then try.

    Added after 1 [minutes]:

    When you test it, please test two things:
    - are the PWMs that worked before STILL working?
    - are new PWMs working?
    Please REBOOT between every try, just to be sure... later check without reboots. Again, I don't have this device, so I need your help with testing.

    Added after 9 [minutes]:

    EDIT: One more fix added
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #7 20884731
    DanteBC
    Level 4  

    While it builds, I've noticed that PWM works a bit strangely. It never fully turns the channel off. Even on 0 or toggle off, it still glows slightly.

    Gonna check the new build now. Thank you for your time. I appreciate your help so much.
  • #8 20884734
    p.kaczmarek2
    Moderator Smart Home
    If you have time to test more, we can also fix this next issue as well. Maybe we need to turn off PWM entirely or smth.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #9 20884736
    DanteBC
    Level 4  
    Sure thing. As long as you have time.

    Added after 13 [minutes]:

    Tested all 5 PWM channels separately and they all work well. Except for the not turning off part.
    One more question, how should I properly number the channels?
  • Helpful post
    #10 20884764
    p.kaczmarek2
    Moderator Smart Home
    That W600 build has finally succeeded, it seems. It should be ready for testing.
    Helpful post? Buy me a coffee.
  • #11 20884822
    DanteBC
    Level 4  

    Tested all 5 PWM channels separately and they all work well.
    Figured out the proper channel numbers too, so now I can set brightness, temperature, and color.
    Everything works, except for the not turning off part.
  • Helpful post
    #12 20884872
    p.kaczmarek2
    Moderator Smart Home
    Very well, it went easier than expected. Let me merge this branch and now let's look into the second issue.

    Still, I am suprised that the code below does not work:
    Code: C / C++
    Log in, to see the code

    Let's try to insert a conditional pwm_stop here (if value is 0):
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1016
    Again, wait for the build to finish and check, also watch for flickering when adjusting PWM value (I am not sure if this platform likes repeated start calls)
    Helpful post? Buy me a coffee.
  • #13 20884900
    DanteBC
    Level 4  

    Tested the new build and now everything works as it should! Channels work exactly as they should and 0 PWM actually turns off the channel. Color channels do not interfere with each other either. Thank you so much for your work!
  • #14 20884917
    p.kaczmarek2
    Moderator Smart Home
    You're welcome, and now.. once you have this bulb fully working, can you tell me whether it's present on our list?
    https://openbekeniot.github.io/webapp/devicesList.html
    If not, consider posting a short teardown/guide (maybe some photos or marking from package, info where it was bought, etc...)
    Helpful post? Buy me a coffee.
  • #15 20884951
    DanteBC
    Level 4  

    It's not present there. I'll make a few pictures of the insides, while it's in the disassembled state, and a few assembled too. I don't have the packaging as it was bought quite a while ago. But I'll provide as much info as I can.

Topic summary

✨ The discussion revolves around configuring PWM for an RGBCCT lightbulb utilizing a W600 chip after flashing it with openbeken firmware. The user identified the pins for the LED channels and sought assistance in enabling PWM mode for brightness control. Responses indicated that not all PWM pins were enabled in the firmware, and a collaborative effort ensued to modify the code. After several iterations, the PWM channels were successfully tested, resolving issues with channel brightness control and ensuring that a PWM value of 0 effectively turned off the channels. The user also agreed to document the lightbulb for inclusion in a device list.
Generated by the language model.

FAQ

TL;DR: On a W600 RGBCCT bulb, 5 PWM channels now work; “All 5 PWM channels … work well.” Update firmware, map pins, and use the 0% off fix. [Elektroda, DanteBC, post #20884822]

Why it matters: This helps makers fix dimming and true-off behavior on W600-based RGBCCT bulbs using OpenBeken.

Quick Facts

Which W600 pins drive RGBCCT channels on this bulb?

The tested bulb routes channels as follows: Red = PA5, Green = PB13, Blue = PB15, Warm White = PB8, Cool White = PB16. These pins were discovered by probing and then verified under OpenBeken after enabling PWM per pin. Use this as a starting map for your device. If your board differs, re-check with a meter and LED tests. [Elektroda, DanteBC, post #20884210]

How many PWM channels were verified working on W600 for this build?

Five PWM channels were tested individually and confirmed to work. After assigning the pins, the user could set brightness, color temperature, and color successfully. This verified end-to-end control across RGBCCT. If any channel fails, recheck its role and PWM assignment. [Elektroda, DanteBC, post #20884822]

Which W600 pins support PWM for brightness control?

According to the provided mapping, PA5 is PWM_1, PB13 is PWM_2, PB16 is PWM_3, PB15 is PWM_4, and PB8 is PWM_5. These channels enable smooth dimming when configured in OpenBeken. Assign the PWM role to each listed pin to control RGBCCT outputs. [Elektroda, p.kaczmarek2, post #20884639]

How do I enable PWM on W600 and map channels in OpenBeken?

  1. Update to a build that enables W600 PWM pins, then perform OTA flashing.
  2. In OpenBeken, assign each discovered pin the PWM role matching its PWM_x index.
  3. Test each channel’s dimming and verify brightness, CT, and color control. This procedure validated RGBCCT control on the referenced bulb. [Elektroda, p.kaczmarek2, post #20884639]

Why do my LEDs glow faintly at 0% PWM, and how do I fix it?

Earlier firmware reduced duty to zero but left PWM running, causing faint glow. A fix added a conditional stop so 0% fully disables the PWM output. As the maintainer put it, “insert a conditional pwm_stop.” Update to a build containing this fix to eliminate residual glow. [Elektroda, p.kaczmarek2, post #20884872]

After the fix, does 0% PWM fully shut off the channel?

Yes. The tester confirmed that 0% PWM now truly turns off the LED channel. They also noted normal operation with independent channels, which indicates correct PWM stop behavior at zero. Update and re-test if you still see a faint glow. [Elektroda, DanteBC, post #20884900]

Do color channels interfere with each other during dimming?

No. After applying the fixed build, color channels operate independently without crosstalk. This allows reliable RGBCCT mixing and scene transitions. If you see coupling, check wiring or transistor leakage on your specific board. [Elektroda, DanteBC, post #20884900]

What is the correct PWM channel numbering to use?

Use the mapping from the maintainer: PA5→PWM_1, PB13→PWM_2, PB16→PWM_3, PB15→PWM_4, PB8→PWM_5. Assign these indices to your RGBCCT roles in OpenBeken. This aligns the firmware’s PWM channels with the W600 hardware. [Elektroda, p.kaczmarek2, post #20884639]

How can I update firmware without desoldering the W600 module?

Use OTA updates. OTA was preferred and used throughout testing, avoiding desoldering. Flash the provided OpenBeken test build over the network, then verify PWM behavior. Ensure stable power and Wi‑Fi during OTA to prevent interruptions. [Elektroda, DanteBC, post #20884444]

What should I verify after flashing a test build?

Confirm that PWM channels which previously worked still behave correctly. Then check that newly enabled PWM pins operate and dim as expected. Reboot between tries to ensure clean initialization before each test run. This helps isolate configuration issues from transient states. [Elektroda, p.kaczmarek2, post #20884697]

Can changing brightness cause flicker on W600?

It can under certain conditions. The maintainer advised to “watch for flickering when adjusting PWM value,” especially with repeated starts. The 0% stop fix reduces residual output but repeated start calls might still cause artifacts on this platform. Test carefully at low duty levels. [Elektroda, p.kaczmarek2, post #20884872]

What PWM duty/value range does OpenBeken use on W600?

OpenBeken uses a 0–100 value for brightness, then scales by 2.55 to set hardware duty (0–255). This conversion ensures full-range control while keeping a simple percentage in UI and scripts. Update logic applies the stop at 0% to fully disable output. [Elektroda, p.kaczmarek2, post #20884872]

How do I share my working bulb so others benefit?

Check if your device appears on the OpenBeken devices list. If not, post a short teardown or guide with photos and purchase details. This helps others identify compatible bulbs and replicate your configuration. [Elektroda, p.kaczmarek2, post #20884917]

What caused the initial build failure for W600 images?

A simple typo in the code caused the W600 images to fail. The maintainer noted placing a dot instead of a comma, then fixed it and rebuilt. After that, testing proceeded via OTA. [Elektroda, p.kaczmarek2, post #20884697]
Generated by the language model.
ADVERTISEMENT