logo elektroda
logo elektroda
X
logo elektroda

Exploring SP530E 5CH PWM+SPI LED Controller with OpenESP on ESP32-C3

divadiow 13155 41
Best answers LABEL_AI_GENERATED

How can I get PWM and SPI LED control working on an SP530E with OpenESP/OpenWLED on ESP32-C3?

SPI LED control now works on the SP530E in OpenESP: flash the 4 MB `OpenESP32C3_1.18.154_4M.factory.bin`, set P19 as `SM16703P_DIN`, and use about a 100 Ω series resistor on the data line; that setup drove a 5 V, 2 m strip with a rainbow animation [#21635132] For PWM, the runtime `PWMFrequency` command exists, but earlier builds did not expose frequency change in the UI and a higher-frequency attempt still showed no output; later testing found the LEDs did work at 1 kHz, so PWM may need a lower frequency or a code tweak such as changing the LEDC frequency/duty settings [#21635165][#21698771][#21637433] When SPI and PWM pins are both assigned, the default color picker couples them: “Toggle Light” turns on the WS2812B and PWM LEDs together, animations turn the PWM LEDs off, and a solid color lights both to the same color [#21637433] If you want to separate them, enable flag 3 to show the raw PWM controller instead of the combined RGB/CW picker [#21637433] There is also a dedicated SP530E WLED build and step-by-step guide if you prefer WLED over OpenESP [#21698731]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
  • IO9 must be held low during flashing

    #31 21654367
    StephSDW
    Level 3  
    Posts: 4
    On SP530E we have :

    GND | TX | RX | SN ( not sure the name) | IO9 | 3.3V

    I found an error on my cable type :

    SP530E GND to GND (USB TTL)
    SP530E TX to RX (USB TTL)
    SP530E RX to TX (USB TTL)
    SP530E SN not used
    SP530E IO9 to GND all the time during the flash procedure
    SP530E 3.3V to 3.3V (USB TTL)

    Am I good?

    I will try to add a 12V or 5V delivery power on.

    Because for now I have this message on ESPTOOL :
    A fatal error occurred: Failed to connect to Espressif device: Invalid head of packet (0x00): Possible serial noise or corruption.
  • ADVERTISEMENT
  • #32 21654368
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14771
    Help: 659
    Rate: 12914
    Can you show a photo of your connections? It makes diagnosis easier. We had similar question few days ago and it turned out that user didn't connect common ground... it does not look like the case for you, but maybe you have too long wires or something

    Added after 41 [seconds]:

    Also try swapping RX and TX
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #33 21654371
    divadiow
    Level 38  
    Posts: 5220
    Help: 449
    Rate: 918
    StephSDW wrote:
    add a 12v or 5V

    also, if you do try other power source, it'll be an or, not USB-TTL 3.3v and external power
  • ADVERTISEMENT
  • #34 21654381
    StephSDW
    Level 3  
    Posts: 4
    Actually like that
    USB to TTL converter connected to a black electronic board with jumper wires
    Black electronic board with soldered wires on wooden surface

    I will try abrogate power so external power removing the 3.3 volt from USB TTL

    Thanks for your help, I'm totally novice in that kind of things
  • Check USB-UART current, wiring, and BOOT pin flashing

    #35 21654383
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14771
    Help: 659
    Rate: 12914
    I don't know this USB to UART converter, but does it provide enough current?

    The wires are a bit long....

    I am also not sure about solder joints - do you use flux?

    Maybe you can watch our channel to see how I flash devices: https://www.youtube.com/@elektrodacom

    |Try with this video:



    It's similar for ESP but you also ground BOOT pin as far as I remember, and use esptool, ofc.
    Helpful post? Buy me a coffee.
  • Flash encryption flag blocks UART flashing

    #36 21654491
    StephSDW
    Level 3  
    Posts: 4
    Yes ! It works with the same length of cable. It works ! I can communicate and do the things..
    I try to put the https://github.com/patrick3399/SP530E-WLED-Custom?utm_source=chatgpt.com on.

    It return that error :
    A fatal error occurred: This chip has encrypt functionality in UART download mode disabled. This is the Flash Encryption configuration for Production mode instead of Development mode.

    I just try removing --encrypt and it seems to work... I don't understand everything. But If I reboot the SP530 I have nothing working no Wi-Fi or something like that.
    I want to integrate that product into Home Assistant that's why I'm trying this.
  • ADVERTISEMENT
  • #37 21654534
    divadiow
    Level 38  
    Posts: 5220
    Help: 449
    Rate: 918
    what is the result if you run esptool.exe get_security_info on the SP530E when it is in UART download mode?
  • Helpful post

    WLED SP530E firmware port with direct binaries

    #38 21698731
    johnvoipguy
    Level 4  
    Posts: 3
    Help: 1
    Rate: 1
    >>21654323 Hi, Just went down a similar road as you! After overcoming many newbie obstacles.

    I documented and posted on GitHUB a very easy to understand step-by-step guide to convert SP530E to WLED Firmware!

    I have modified the latest firmware from WLED to support the SP530E (PWM, and SPI) and plan to keep up with releasing SP530E version in step with WLED releases. Current SP530E build integrated WLED v0.15.1.

    ### **✅ No More Artifact Hunting**

    - Direct download links: `builds/latest/WLED_SP530E_Full_Latest.bin`

    - GitHub releases with proper binaries

    - No digging through CI artifacts

    ### **✅ Professional Distribution**

    - Automated builds on every commit

    - Proper version tagging

    - Ready-to-flash 1.6MB binaries with correct esptool commands

    ### **✅ Transparent Development**

    - Full source code visibility

    - Build process documentation

    - Community can contribute improvements

    ## **✅ Complete Documentation**

    - `README.md` with full setup instructions

    - `SP530E_UPGRADE_CHECKLIST.md` with your customizations

    - `BUILD_OPTIMIZATION.md` with build details
    ## 🌐 **Links**
    **Main Repository:**
    ```
    https://github.com/johnvoipguy/wled-sp530e-mods/
    ```
    **Direct Binary Downloads:**
    ```
    https://github.com/johnvoipguy/wled-sp530e-mods/releases/latest/
    ```
  • #39 21698766
    divadiow
    Level 38  
    Posts: 5220
    Help: 449
    Rate: 918
    whoa. nice work. that'll please quite a few people I'm sure. And no need to disable any protections first?
  • #41 21698794
    johnvoipguy
    Level 4  
    Posts: 3
    Help: 1
    Rate: 1
    >>21698771 Hmm, I'm still catching up on all the topics here, but in WLED UserMod PWM_Output frequency can be set in the WebUI on the fly.

    Added after 2 [minutes]:

    >>21698766 I'm not sure what you mean by protections?

Topic summary

LABEL_AI_GENERATED
Discussion about the SP530E 5-channel PWM + SPI LED controller based on ESP32-C3, originally intended for WLED/OpenESP testing. The thread covers device identification, manual pin mapping, and the unusual combination of 5 PWM outputs plus SPI LED support. Early attempts focused on OpenESP/OpenBK7231T-style PWM control, PWM frequency changes, and simulator support, but the controller initially showed no visible LED output despite GPIO activity. Later testing revealed that the board switches the LED channels on the low side (ground switching), and that correct operation required specific PWM settings: 16 kHz frequency and reduced duty resolution. With those settings, RGBCW outputs lit correctly, while the red channel remained problematic, likely due to hardware or pin-specific issues. SPI support was eventually confirmed using SM16703P on the data pin, with PixelAnim and rainbow animation working on a 5V strip. The discussion also includes flashing and recovery attempts, WLED custom builds for SP530E, esptool/espefuse security and encryption issues, UART download mode troubleshooting, common-ground and external power requirements, and later community firmware releases that add dedicated SP530E support for both PWM and SPI.
AI summary based on the discussion. May contain errors.

FAQ LABEL_AI_GENERATED

TL;DR: 16 kHz factory PWM was logged; "2 kHz + 8/4‑bit is the only usable output" on custom WLED, per builder. This ESP32‑C3 SP530E needs efuse‑aware flashing, custom WLED for GPIO19, and OpenESP lacks SPI today. [Elektroda, divadiow, post #21230102]

Why it matters: This FAQ helps makers fix flashing, PWM, and SPI issues on the SP530E when using OpenESP/OpenBeken or WLED, fast.

Quick facts

Quick Facts

What is the SP530E 5CH PWM+SPI LED controller, in short?

It is a BTF Lighting–sold board using an ESP32‑C3 with five PWM MOSFET channels and an SPI pixel output. The MCU drives a 74HC245D level shifter configured A→B, then gate resistors into MOSFETs. It exposes on‑board status LEDs and UART for debugging. Factory firmware ran PWM at 16 kHz, and the board level‑shifts the digital data line to 5 V. [Elektroda, divadiow, post #21230102]

Can the five PWM channels and the SPI output be controlled independently?

The attached manual and user review indicate no restriction on independent control. "I don't think I see anything that says they can't be controlled independently." Treat PWM (e.g., RGBCW) and SPI strips as separate outputs in the app when available. Hardware uses separate paths: five MOSFET PWM channels and one SPI data path through the 74HC245D. [Elektroda, divadiow, post #21231424]

How do I enter bootloader mode on SP530E and run esptool?

Use this 3‑step:
  1. Solder the rear pads and pull IO9 low to enter download mode.
  2. Connect UART to GPIO20/21 (RX/TX) and power the board.
  3. Run esptool to query or flash (e.g., get_security_info, flash_id, write_flash). This board identified as ESP32‑C3 with 4 MB embedded flash and 40 MHz crystal in logs. [Elektroda, divadiow, post #21230102]

How do I check and change Flash Encryption/Secure Boot status on this board?

Check with: esptool get_security_info. The sample unit showed Flash Encryption enabled and SPI_BOOT_CRYPT_CNT 0x1. The user then burned efuses DIS_DOWNLOAD_MANUAL_ENCRYPT and SPI_BOOT_CRYPT_CNT, after which Flash Encryption read disabled and the counter was 0x3. Treat efuse changes as permanent and plan backups first. [Elektroda, divadiow, post #21230102]

Can I restore the factory firmware after burning those efuses?

The user warned that returning to factory may not be possible after burning DIS_DOWNLOAD_MANUAL_ENCRYPT and SPI_BOOT_CRYPT_CNT. Always check current security with get_security_info and keep full backups. Without original encrypted images matching the original security state, the vendor firmware may not boot. [Elektroda, divadiow, post #21332044]

What esptool write_flash command and offsets worked for WLED on ESP32‑C3 4 MB?

Example used: esptool.py -b 115200 write_flash 0x0 C3_bootloader.bin 0x8000 C3_partitions_4M.bin 0x10000 WLED_0.15.0-b7_ESP32C3_4MB.bin. This targeted bootloader at 0x0, partitions at 0x8000, and app at 0x10000. The session identified an ESP32‑C3 revision v0.4 with 4 MB embedded flash, and verified hashes after flashing. [Elektroda, vo1xabrad, post #21331970]

How do I know WLED actually booted on the SP530E?

You should see the WLED setup AP broadcasting. If nothing appears, open a serial terminal on UART TX and capture boot logs. The author expects the AP to show if the firmware booted correctly, so logs help confirm or diagnose. [Elektroda, divadiow, post #21333651]

Why does the WS2812 data line stay high or not drive my strip?

On SP530E, the 74HC245D level‑shifts MCU outputs, and not all pins reach the driver. GPIO12–19 are restricted in stock WLED builds on C3. Use a custom build that disables USB_CDC, then drive data on GPIO19. The author saw digital animations work after unlocking IO19; without it, the data output idled high. [Elektroda, divadiow, post #21230102]

What GPIO mapping works for PWM and on‑board parts?

Observed map: 0 BlueLED, 1 GreenLED, 3 Button, 4 WW, 5 CW, 6 G, 7 B, 10 R, 19 Data (WS2812). UART is GPIO20/21 (RX/TX). GPIO0/1 also drive board LEDs. The MCU connects to 74HC245D for PWM channels through gate resistors to MOSFETs. [Elektroda, divadiow, post #21230102]

Can OpenESP/OpenBeken change PWM frequency on ESP32‑C3 right now?

OpenESP uses ESP‑IDF’s LEDC for PWM, which supports frequency control. However, the current HAL did not call ledc_set_freq in the referenced code, so the user’s pwmfrequency command had no effect yet. "LEDC is used for PWM." [Elektroda, p.kaczmarek2, post #21231588]

Is SPI LED output supported in OpenESP on this device yet?

Not yet. The user confirmed no OpenESP support for SPI on this SP530E at the time of testing. PWM also showed issues pending LEDC implementation updates in the ESP HAL. [Elektroda, divadiow, post #21230102]

What PWM frequencies actually worked on this board?

Factory firmware drove PWM at 16 kHz and looked clean. A WLED contributor hardcoded 2 kHz with 8/4‑bit to get usable analog output on this SP530E. Without that, their analog LEDs were dim or unstable. This board behaves unusually under default WLED settings. [Elektroda, divadiow, post #21230102]

I see Wi‑Fi PHY calibration warnings after flashing—normal?

Logs showed: "failed to load RF calibration data (0x1102), falling back to full calibration," followed by saving new calibration and AP start at 192.168.4.1. This appeared during first Wi‑Fi bring‑up after flashing. It did not prevent AP mode. [Elektroda, divadiow, post #21230102]

How do I unlock GPIO12–19 for WLED on ESP32‑C3?

Use a custom WLED build that disables USB_CDC for ESP32‑C3. The thread links a community compiler. After that, IO19 produced working WS2812 animations on the SP530E. Default builds do not expose those pins. [Elektroda, divadiow, post #21230102]

Any quick checks to confirm OpenESP/OpenBeken is alive on SP530E?

Check on‑board LEDs on IO0/1, which light under OpenESP. Watch the serial boot log for AP startup and DHCP server at 192.168.4.1. The log also prints the device MAC and memory stats during boot. [Elektroda, divadiow, post #21230102]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT