Author Topic: PI zero pixel drive board  (Read 5859 times)

Offline ronp

  • Newbie
  • *
  • Join Date: Nov 2014
  • Location:
  • Posts: 29
  • Kudos: 1
PI zero pixel drive board
« on: December 20, 2015, 06:12:33 PM »
With the PI zero being $5, it makes sense to have a cheap daughter card to drive pixels. There are three options.

1) Currently there is some code that will drive WS281x from the PWM outputs. Only one output available on the 40 pin connector.
2) Use a PIC or equivalent chip to convert the SPI output to pixels. This limits the number of pixels since the PIC can not both receive and output the data.
3) Use a small CPLD to convert the SPI output to pixel data. This requires the SPI port data rate to be reduced to 800Khz.

http://www.diychristmas.org/vb1/showthread.php?5358-PI-SPI-to-pixels-WS281x

And while we are at it, we could put a USB hub chip on the board.

Any thoughts?

Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,939
  • Kudos: 141
Re: PI zero pixel drive board
« Reply #1 on: December 20, 2015, 10:30:08 PM »
Sorry, I have a browser tab open for the other thread, but haven't had a chance to sit down in the past few days to reply to it.

The current code works to drive two WS281x outputs on the 40-pin connector on the A+/B+, or one WS281x output on the 26-pin connector on the original A/B.  The author of the rpi_ws281x library has a new version which is supposed to work on the Pi v2 B and there is also a forked implementation of the library which is supposed to work on the v2 B as well.  I haven't had a chance to test either of these other than compile-testing the forked library.  I posted instructions here on the Falcon site for users to test applying the forked code and patching it into FPP.  I have only heard back from one user so far with non-positive results, so I will try to find time to test myself sometime soon.

The CPLD option sounds enticing to me based on your previous description.  I believe we limit the current SPIws2801 Channel Output in FPP to 1530 channels for 510 pixels.  I don't know if that would have to go down to lower the SPI speed to 800Khz.  Have you done the math on how many WS281x pixels we could theoretically drive at that speed?  I believe the WS2801 can go much higher than the current 1Mhz we are using, but I wasn't able to get them to work reliably when I tried bumping up to 2Mhz.  This could be related to the 3.3v data signal though, rather than the SPI speed.

Based on comments I've seen here and on the other forums, we already have quite a few users who are using the Pi to directly drive WS281x pixels since it a much cheaper option than any existing 4-port controller.  I've heard of several users setting their neighbor(s) up with a Pi and a couple hundred pixels for a MultiSync Remote for less than $100.  I can't recall the maximum number of pixels the rpi_ws281x library is supposed to support, but if using that or another method as you propose can support 400-600 or more pixels, that could be a decent size pixel tree running off a $5-30 "controller" (plus extra for SD/power/etc.)  Throw in a few uAmp's and power injection and I could have done all of my windows and house trim with 3-4 Pi's.

I still need to find a Zero to play with.  I wonder if I should try calling Barnes & Noble again or just stop by. :)  The last time I called a week or so ago they didn't have the December issue of MagPi in yet or had sold out already (the person I spoke to didn't know which).

All that being said, I am very open to working with you on this, whether it is a wholesale change to 800khz if that won't affect our current channel count or if it means a checkbox on the channel output to support the lower speed.
-
Chris

Offline David Pitts

  • Administrator
  • *****
  • Join Date: Mar 2013
  • Location: Falcon, CO
  • Posts: 3,709
  • Kudos: 61
Re: PI zero pixel drive board
« Reply #2 on: December 20, 2015, 11:38:12 PM »
I am curious if the spi port can be driven at 800K. I remember when designing for FPD it was a power of 2 type thing. 500K, 1M, 2M etc...
PixelController, LLC
PixelController.com

Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,939
  • Kudos: 141
PI zero pixel drive board
« Reply #3 on: December 20, 2015, 11:49:21 PM »
That brings back my memory and sounds correct, I think you are right.  That is probably why I remember testing 2M.

Offline ronp

  • Newbie
  • *
  • Join Date: Nov 2014
  • Location:
  • Posts: 29
  • Kudos: 1
Re: PI zero pixel drive board
« Reply #4 on: December 22, 2015, 08:20:34 PM »
If the 40-pin connector supports two strings, than that is probably sufficient for most people.

The CPLD implementation would only support one string output at a time. If you run at 800KHz, there is only a one byte delay in the output, so the math easy pretty easy to figure out how many pixels you can drive. Using the chip select I could switch between two outputs. The output time for 510 pixels is ~12.24mS at 1Mhz and ~15.3mS at 800KHz. So you could probably extend this to about 650 pixels in 20mS.

So while I was waiting for your response, I was looking at some of the Microchip parts. For a $3 processor, the same price as the CPLD, I bet I could read the FPD output and generate 4-8 outputs. This would require no changes to the PI software.

Challenge me.

Ron




Offline JonB256

  • Supporting Member
  • ******
  • Join Date: Mar 2013
  • Location: Granbury, Texas
  • Posts: 3,835
  • Kudos: 81
    • Granbury Christmas Lights
Re: PI zero pixel drive board
« Reply #5 on: December 22, 2015, 08:52:46 PM »

Challenge me.

Ron

Seriously, Ron, there's no possible way you could do that.



is that good enough?

Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,939
  • Kudos: 141
Re: PI zero pixel drive board
« Reply #6 on: December 22, 2015, 09:35:36 PM »
If the 40-pin connector supports two strings, than that is probably sufficient for most people.

The CPLD implementation would only support one string output at a time. If you run at 800KHz, there is only a one byte delay in the output, so the math easy pretty easy to figure out how many pixels you can drive. Using the chip select I could switch between two outputs. The output time for 510 pixels is ~12.24mS at 1Mhz and ~15.3mS at 800KHz. So you could probably extend this to about 650 pixels in 20mS.

So while I was waiting for your response, I was looking at some of the Microchip parts. For a $3 processor, the same price as the CPLD, I bet I could read the FPD output and generate 4-8 outputs. This would require no changes to the PI software.

We have one user who has reported that a fork of the fork of jgarff's rpi_ws281x library on github has worked on a Pi v2, and Jeremy also has a "rpi2" branch now, so I think we can safely say that we will have direct support for ws281x on the Pi v2 sometime early early next year in the FPP master code branch.

I think that some of it boils down to cost.  Having a Hat that could plug into a Pi that could drive 4 or 8 outputs of a few hundred pixels or more on each output could be enticing to some users if the price is right.  The BBG w/ F4-B is a pretty low-cost 4-port string controller that can drive 2000 pixels.  If a Pi Hat driven by SPI could provide 4 or 8 string outputs at a lower cost then that would be a good option for users.  I would probably want it to have a unique ID compatible with the FPD and F16v2 (when we add support for that) so that FPP can detect the board as it can detect the FPD with the latest firmware.

I would still like to have a simple 2-string power injection board for the Pi with level shifter IC, RTC, and a power supply circuit for the Pi itself.  Maybe an optional USB hub as you mentioned.  This would let you take the $5 Zero and a wireless dongle and drive 400 pixels using the current rpi_ws281x code.  I believe that pixel count can go much higher but it just needs to be tested.  This would be a very nice option, we have a lot of users bringing their neighbors online or putting Pi's or BBB's on marching bands or parade members, etc..

Offline David Pitts

  • Administrator
  • *****
  • Join Date: Mar 2013
  • Location: Falcon, CO
  • Posts: 3,709
  • Kudos: 61
Re: PI zero pixel drive board
« Reply #7 on: December 22, 2015, 10:53:00 PM »
If the 40-pin connector supports two strings, than that is probably sufficient for most people.

The CPLD implementation would only support one string output at a time. If you run at 800KHz, there is only a one byte delay in the output, so the math easy pretty easy to figure out how many pixels you can drive. Using the chip select I could switch between two outputs. The output time for 510 pixels is ~12.24mS at 1Mhz and ~15.3mS at 800KHz. So you could probably extend this to about 650 pixels in 20mS.

So while I was waiting for your response, I was looking at some of the Microchip parts. For a $3 processor, the same price as the CPLD, I bet I could read the FPD output and generate 4-8 outputs. This would require no changes to the PI software.

Challenge me.

Ron

To get 800K rate from Pi may not be possible but if we can that would be nice. I do like the micro-processor idea with a possible USB bootloader of its own. Requiring user to have a Pickit has been a drag on other designs we have done.   


Offline ronp

  • Newbie
  • *
  • Join Date: Nov 2014
  • Location:
  • Posts: 29
  • Kudos: 1
Re: PI zero pixel drive board
« Reply #8 on: December 22, 2015, 10:57:08 PM »
So this is a good conversation, it is helping me to figure out what to do for next year.

So for sure we should do a buffer board for the WS281x outputs, the WS2801 output and maybe RS-485 for the UART (renard). Adding the RTC shouldn't be too hard. I would have to look into the power supply, generally it is cheaper to buy the power supplies.

I have mixed feelings about the USB hub, the controller chips are ~$3 and with the connectors it wouldn't be much cheaper than just buying a hub.

That said there is no low cost solution for the other pixel types. I don't know if there is enough interest.

The F4B appears to go on a Beagle Bone black which is not $5. Is there a similar version for the PI?

So, there should be a low cost adapter for 4-8 pixels, where other pixel types would be supportable. The bootloader would up the cost.

Ron






Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,939
  • Kudos: 141
Re: PI zero pixel drive board
« Reply #9 on: December 22, 2015, 11:18:40 PM »
If the buffer board had some jumpers on it to connect the buffers to the proper pins on the GPIO header, then theoretically the same board could be used for WS281x and WS2801.  The reason for the optional power converter is so that the user can just run the Pi off the pixel power, like the BBB can do with the F4-B and F16-B.  I think our main BBB users with issues this year were using the Octoscroller, but I don't recall any complaints about power on the F4-B/F16-B powered BBB's.

I don't see a huge need for a hub since we allow using the microSD for FPP storage now, so I could go either way on needing it.   I agree, the chip and connectors do add to the cost so if it was included I would probably prefer for it to be optional.

There is no F4-B type board for the Pi currently.  The F16 v2 should support connecting directly to a Pi via SPI in 2016 once Dave and I get together, but that is a high-end option and I think that having a low-end option of a 4 or 8 port board that connected to the Pi would be good.

Offline David Pitts

  • Administrator
  • *****
  • Join Date: Mar 2013
  • Location: Falcon, CO
  • Posts: 3,709
  • Kudos: 61
Re: PI zero pixel drive board
« Reply #10 on: December 22, 2015, 11:25:44 PM »
The USB connector is all that is needed for most PIC's to have USB support for bootloading. If not because you choose a PIC that does not have USB. Look at possibly connecting serial port to PI's serial connection and update firmware using a serial bootloader from a PI script or program. Having a button to put controller into bootloader mode would be cool. Than if we do a group buy for the boards the micro could be programmed with a bootloader/current firmware. If you use a processor that has been around awhile Microchip will even load a program at factory for minimal fee.

I am thinking requiring a programmer is not the way of the future for most new designs.


Offline pixelpuppy

  • Hero Member
  • *****
  • Join Date: Aug 2015
  • Location: Dallas, TX
  • Posts: 506
  • Kudos: 10
Re: PI zero pixel drive board
« Reply #11 on: December 23, 2015, 08:37:47 AM »
That said there is no low cost solution for the other pixel types. I don't know if there is enough interest.
I am ABSOLUTELY interested in low-cost low-port-count controllers, but only for WS2811 pixel types  8)

The reason for the optional power converter is so that the user can just run the Pi off the pixel power
Yes, please.  :)

I don't see a huge need for a hub since we allow using the microSD for FPP storage now
I agree  ;D

I am thinking requiring a programmer is not the way of the future for most new designs.
Good thinking  ;)
Vixen and xLights for sequencing / FPP for scheduling and playing / Falcon controllers for pixels / DIY controllers for everything else

Offline ronp

  • Newbie
  • *
  • Join Date: Nov 2014
  • Location:
  • Posts: 29
  • Kudos: 1
Re: PI zero pixel drive board
« Reply #12 on: December 26, 2015, 01:04:22 PM »
So I have a rough drawing for a WS281x pixel board.

Do you have a preference on real time clock chips?

Included buffers for Renard and WS2801, am I missing anything?

Also, I am not a fan of running power through the controller board for the pixels. Does it make sense to include the fuses for just two outputs. If you are running a small power supply the fuses are unnecessary, since supplies have current limits.




Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,939
  • Kudos: 141
Re: PI zero pixel drive board
« Reply #13 on: December 26, 2015, 11:24:06 PM »
For some reason the images didn't attach right here, but I did see them in your post in the other thread.

I don't have a chip preference other than it being compatible with something we already support in FPP.

The board looked good to me.  I haven't tried to use the spi output select code in FPP, but FPP is setup to allow using the two separate outputs via the chip select line.  What do you think about the jumper idea I mentioned where you only need 2x 4-pin pixel connectors that are dual-purpose depending on which jumpers are installed.  I'm fine either way, whether there are dedicated pixel connectors or shared.  I don't know how many users will want to run both WS281x and WS2801 at the same time, so offering independent sets of outputs might be just taking up space if a set of jumpers could make a single set of output connectors dual-purpose.

I think the pixel power on board is warranted here because of the intended use for these boards.  I think it will simplify install and use if there is only one power connection needed to the power supply and pixels only need to connect to the board and not have some wires go to the board and some going to the power supply.

I don't think a lot of our users have surface-mount experience, would you see this board offered with the surface-mount item pre-attached?

Offline ronp

  • Newbie
  • *
  • Join Date: Nov 2014
  • Location:
  • Posts: 29
  • Kudos: 1
Re: PI zero pixel drive board
« Reply #14 on: December 27, 2015, 02:39:26 PM »
I will update the outputs to support two WS2801 outputs using the chip select. I also like your idea of jumpers to select either function. Which will drop the headers to two.

I found that you support the Microship clock chip MCP7941x, which comes in a 8-pin DIP. I will switch to that component.

Also, I will pickup the holes on the PI zero, PI B+ and PI 2.

I will put up the board on OSH park, so people can order it. I will also ask Dean if he wants to offer it on his website.

Ron


 

Back to top