Coder Social home page Coder Social logo

djulien / ws281x-splitter-dev Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.38 MB

WS281X string splitter and breakout firmware for Microchip PIC16F15313.

Verilog 4.19% SystemVerilog 0.36% Makefile 5.23% Lasso 0.10% Shell 0.49% C 34.07% Assembly 55.57%

ws281x-splitter-dev's Introduction

WS281X-Splitter Overview

Connection diagram WS281X-Splitter has 2 main purposes:

  1. (Splitter) Split one long string of WS281X pixels into multiple (up to 4) shorter strings. This can be used as an alternative to daisy-chaining multiple WS281X strips/strings and/or to avoid the need for null pixels - the distance to first pixel is considerably longer (~ 30 feet) than the distance between pixels (~ 2 feet).
  2. (Breakout) Show the next WS281X RGB data pattern (24 bits) at the current position within a group of WS281X pixels, and current FPS (8 bits). This breakout info can be used to diagnose controller or communication problems.

The firmware is written specifically for the Microchip PIC16F15313, but can be adapted to some other PICs. The firmware uses Timers 0-2, MSSP, PWM, and CLC peripherals. The CLC allows WS281X signal data to be sent and received at full speed (800 KHz) using a low-power 8 MIPS 8-bit microcontroller.

The hardware is designed to be inlinable with WS281X strips. For example, here is a prototype PCB using minimal parts:

Usage as Splitter

Splitter diagram Connect WS281X-splitter as follows to use the splitter function:

  • WS281X input data stream on RA3
  • up to 4 WS281X strips/strings on RA1, RA2, RA5, and RA4

In your sequencing software, the splitter will be represented by 1 WS281X pixel followed by another string of WS281X pixels which will be split into 1-4 segments. Insert the extra pixel immediately ahead of the pixels to be split. Set its 24-bit value to the quad-length* of the first, second, and third segments respectively. Any pixel values after the first + second + third length will be sent to the fourth segment. For example, a splitter pixel value of 0x102003 will redirect the WS281X input stream on RA3 as follows:

  • the next 4 * 0x10 = 64 pixels will go to Segment 1 on RA1
  • then 4 * 0x20 = 128 pixels will go to Segment 2 on RA2
  • and then 4 * 0x03 = 12 pixels will go to Segment 3 on RA5
  • any remaining pixels values will go to Segment 4 on RA4

*Quad-length is 1/4 the number of WS281X pixels in a segment. This allows an 8-bit value to designate a length up to 1024 pixels.

Usage as Breakout

Breakout diagram To use the breakout function, connect RA3 of the WS281X-Splitter to the end of a WS281X pixel strip/string (or directly to a WS281X controller port) and then connect 24 or 32 WS281X pixels to RA0. The first 24-bit RGB WS281X pixel value received by WS281X-Splitter will be broken out as follows:

  • the first 24 WS281X pixels on RA0 will show the 24-bit RGB pixel value received (msb first)
  • if more than 24 pixels are connected to RA0, then the next 8 pixels will display the FPS (msb first)

In the breakout, white pixels represent an "on" bit and red/green/blue/cyan represents an "off" bit within the first/second/third/fourth bytes. For example, a pixel value of 0xF0CC55 received at 30 FPS would be displayed as follows: Breakout example

In your sequencing software, the only change needed is to insert one WS281X pixel representing where the WS281X-Splitter is connected.

Current Status

  • firmware still under development
  • example PCB done (see pcb folder)

Build Instructions

To assemble the firmware use steps 1 - 4, below. To use the pre-assembled .hex file, skip directly to step 4.

  1. Clone this repo
  2. Install Microchip MPLABX 5.35 or GPASM or equivalent tool chain. Note that MPLABX 5.35 was the last version that supported MPASM rather than MPASMX.
  3. Build the project
  4. Flash the dist/WS281X-Splitter.hex file onto a PIC16F15313*. Example command line (for Linux): sudo ./pkcmd-lx-x86_64.AppImage -w -p16f15313 -fdist/WS281X-Splitter.hex -mpc -zv

* PIC16F15313 is a newer device supported by PICKit3. However, it can be programmed using the older PICKit2 and the very useful PICKitPlus software.

Version History

Version 0.21.9 9/30/21 switched to 8-bit PIC with CLC. basic split and breakout functions working for PIC16F15313 Version 0.15.0 ?/?/16 started working on a Xilinx XC9572XL CPLD (72 macrocells) on a Guzunty board

Reference Docs

(eof)

ws281x-splitter-dev's People

Contributors

djulien avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.