Skip to content
/ HyperSPI Public
forked from awawa-dev/HyperSPI

HyperHDR bridge using SPI bus. Connects Raspberry Pi with a generic Raspberry Pi Pico (rp2040)/ESP32/ESP8266 to control a LED strip. Fasted possible cable solution for external Pico/ESP LED driver. Data integration check included.

License

Notifications You must be signed in to change notification settings

Amuuo/HyperSPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HyperSPI

SPI bridge for AWA protocol to control a LED strip from HyperHDR (version v17 and above).
Diagnostic data available at the serial port output (@115200 speed).
Rpi acts as a master, ESP8266/ESP32 is in slave mode.

LED strip / Device ESP8266 ESP32
SK6812 cold white yes yes
SK6812 neutral white yes yes
WS281x yes yes
SPI (APA102, SK9812, HD107...) no yes

Why this project was created?

  • SPI is much faster. HyperSPI works best at speed over 20Mb.
  • SPI doesn't have any data integration check. But AWA protocol does have one.
  • you don't need to have 2Mb capable serial port on your ESP board.
  • I needed it and I was able to implemented it ;)
  • There is a hardware limitation for the Rpi current design...even if you connect your grabber to the USB3.0 in the USB2.0 mode the adalight running driver causes quite a big USB transfer drop. So we can replace Adalight with a pure SPI data transfer as an alternative.

See what's happening for USB2.0 bus... my problematic Ezcap 320 @ 50 fps fell back to USB2.0 mode and did not like the CH340G serial port driver at all (real USB3.0 should not be affected, but not tested it):
slow

That's how the grabbers works when other device is disconnected from the USB port. fast

Software configuration (HyperHDR v17 and above)

Select esp8266 protocol for ESP proprietary SPI protocol, esp32 for ESP32 boards or 'standard' for other devices.
Make sure you set "Refresh time" to zero, "Baudrate" should be set to high but realistic value like 25 000 000.
Enabling "White channel calibration" is optional, if you want to fine tune the white channel balance of your sk6812 RGBW LED strip.

obraz

Hardware connection

ESP8266 (only 3 SPI cables are needed: MOSI, MISO, SCLK + common ground)

ESP8266 SPI input: GPIO 14 for Clock (SCK), GPIO 12 for Data (MISO), GPIO 13 for Data (MOSI)
LED output: GPIO 2

cables
rpi
esp

ESP32 (need all 4 SPI cables + common ground)

Warning: HyperSPI set SPI_MODE0 on default due to a bug with a SPI bit shift link, you may need to change it to SPI_MODE3 for slower speeds

ESP32 SPI input: VSPI interface, GPIO 5 for SPI Chip Select, GPIO 18 for Clock (SCK), GPIO 19 for Data (MISO), GPIO 23 for Data (MOSI)
LED output (non-SPI): GPIO 2
LED output (SPI): GPIO 0 for Clock, GPIO 2 for Data

esp2 esp

Compiling

Compile the sketch using Arduino IDE. You need:

Options (first lines of the sketch):

For RGB strip like WS8212b comment it with a '//', leave it for RGBW SK6812:
#define THIS_IS_RGBW

For RGBW cold white LED strip version if above declaration is defined, delete it or comment it with '//' for RGBW neutral:
#define COLD_WHITE

Skip first led in the strip, that is used as level shifter:
bool skipFirstLed = true;

Don't change LED's count as it is dynamic.

About

HyperHDR bridge using SPI bus. Connects Raspberry Pi with a generic Raspberry Pi Pico (rp2040)/ESP32/ESP8266 to control a LED strip. Fasted possible cable solution for external Pico/ESP LED driver. Data integration check included.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 84.9%
  • C 8.9%
  • CMake 3.2%
  • Python 3.0%