Teensy 3.1 + sdCard adapter + wiz820io + 1 SPI output for leds?

Status
Not open for further replies.

visualSound

Well-known member
Looking at the teensy + wiz820io for receiving pixel data and wondering if it could be used in conjunction with 1 SPI output for APA102 pixels.

I was looking at this:

connectionsFOrWiz.jpg
A little confused on the pin numberings- are there any clock / data pairs left over for use with an led strip or are both SPI outputs used by the wiz?
It has pin 7 listed under SD card, but does that also mean it's being used for wiz820?

- I'm not using the sd card
- looking to use fastLED (so it would need pins 11 and 13, or 7 and 14)

Many thanks!
 
From what I understand FastLED can use software SPI so you can define any pin for your APA102 Leds...
Also the Teensy has a single SPI port that can be used either with pins 11/13 or 7/14
I don't think you can share the hardware port between the wizIO and the LEDs since they don't use a standard SPI configuration (i.e. no chip select pin)

I have some APA102 leds on order and plan on controlling them using Artnet too. Please report if you get it working !
 
Just got this answer regarding SPI speeds on the FastLED google group:

Hardware spi on the teensy 3.1 is 24mbps and software is between 4-6mbps

So 5 mbps is 625000 bytes per second.
625000 mbps / 60fps /3 bytes = 3472 leds

So if my math is good that's the number of leds you could control using software SPI at 60fps
 
This seems to be a common use case and one that I've been looking at too but I've not yet found any easy answer yet. In my case, I'm using LPD8806 and WS2801 based LED strips/strands, but they can be driven by SPI hardware and I have the same underlying issues. I would love to read more discussion of Ethernet/WIZ820io/PJRC-adaper + FastLED. I'll give my understanding but others with knowledge please add to or correct me.

Teensy 3.0 and 3.1 have only 1 SPI port. The new Teensy 3 LC has 2 SPI ports but I am ignorant wrt using the second SPI port for anything. The WIZ820io uses SPI but we'd also like to use the SPI hardware to drive our LEDs. I've found 2 sources of issues:

1. the LEDs don't have any sort of chip select, so any SPI sends to the WIZ820io will also sent to the LEDs and that will probably screw up their state.

2. While the Ethernet library uses SPI Transactions, FastLED does not. The Ethernet library uses the built-in SPI library, FastLED uses it's own SPI library.

I don't know how, and it might be impractical, to share SPI between multiple libraries or other code when one of them does not use SPI Transactions or uses different low-level SPI code.

for issue 1, one can imagine adding some sort of gating circuit for the LEDs.I have not prototyped anything like this so I'm just saying it could probably be done with additional hardware. If one were using a logic level shifter already, and it had an Enable/Disable control, perhaps this could be used to implement device select logic for the LEDs.

One could also use FastLED's software SPI on non-SPI pins. This will of course use way more processor resources but might be acceptable if there is nothing else for it to do.

for issue 2, I cannot see a way forward if the LEDs use hardware SPI. FastSPI is already very modular and flexible, and it's own SPI code is refactored into it's own set of classes and supports a wide range of SPI implementations. I find myself wishing that there was an implementation that delegated to the "built-in" SPI library and could, somehow, use SPI Transactions.

I understand the desire to use FastLED and it has become more than just a LED driver library. If I had to implement something today and had to stop waiting for a better solution, I think I'd use FastLED with software SPI using 2 of the available digital pins and see if I could live with the software SPI performance (or, rather, CPU utilization).

I'd love to hear what those with more experience and knowledge think on this topic.
 
Last edited:
Yes I'm aware of the speed differences and honestly software SPI doesn't sound so bad at 3472 leds :) I hadn't really considered using non hardware SPI so that might end up being the route I go.

Along that same train of thought - one could effectively reduce that number down to a nice round 3,200 leds across 4 non hardware SPI pins for 800 leds per pin. Then address them in software as one unit (like octo library does) in the situation where wiring would be easier with split outputs. So it sounds like it could be a pretty robust solution for number of leds vs fps vs flexibility (which is ultimately what I'm been exploring with this thread).

However I need to test out how fast the whole thing runs receiving UDP and sending to leds.




Prior to posting back here again I actually merged a fastLED "first light" example with some UDP receiver code receiving packets of data. Strangely the led's did not misbehave at all, however I have to inspect the data coming in UDP to see if it's getting jumbled.

I will test this further and see if I can get the packet data on the leds successfully and let you know!
 
Status
Not open for further replies.
Back
Top