Hello,
I am planning on using some APA102 leds with a Teensy 3.1
I will probably be using Artnet to control the LEDs using the wiz820io adapter which uses the SPI bus. Is there a big performance loss when using the software SPI rather than the hardware port ? At what speed does the software SPI pushes data vs hardware ? Thanks !
Hardware spi on the teensy 3.1 is 24mbps and software is between 4-6mbps
so if my math is good at around 5mbps I should be able to control around 4000 leds at 60 fps ?
Actually a bit less than that - apa102 pixels have a 32-bit per pixel data format, not 24. So you’re looking at more like 45fps if bit banging can push 6mbps.
Consider the SPI-based Wiz820 also has overhead. Reading whole UDP packets is much more efficient than a TCP stream 1-byte-at-a-time, but still, every packet of data requires many SPI bytes over overhead to manage the W5200 registers. Don’t forget to factor that overhead into your planning.
Also bear in mind you can only clock out around 512 leds in a single strip at 30fps with apa102. Any more than that and you need to split up parallel outputs.
Depends on wiring/power. I’ve driven 768 leds at well over a couple hundred fps off of a teensy 3.1. Don’t discount that 24mbps data rate.
I think that depends on a lot of factors though Daniel, noise levels, quality of the strips, connections between strips etc. The strips I have seem to start generating timing errors after around 600 pixels at 60fps. The datasheet is probably a bit conservative stating 512 max at 30 true, but I think for reliability it’s probably worth sticking near those numbers.
It has less to do with fps and more to do with data rate. Try pulling the data rate down to 20 or 16 or 16Mhz. 600 leds at 60fps is only 1.1mbps of data, when pushing data at 24mbps w/hardware spi that gives you some headroom to play with.
Also don’t forget to be injecting power every 60-120 leds or so.
Well I can only speak for the LEDs I have but I’ve found that no data rate seems to help at all up or down. I found 4 mhz to be most reliable, but I think largely due to a lower sensitivity to noise. I’m injecting power every 54 LEDs.
In my specific case the LEDs are arranged in 54 LED long strips with connections between them, I suspect each of these connections is an impedance mismatch causing the increased noise. Increasing data rate doesn’t seem to help, generally makes it worse. Decreasing down to 4mhz seems to help, but then you start running into bandwidth problems. So yeah I think the moral of the story is to pay close attention to noise, try and match impedance on any connections between strips, and that not all strips are created equal.
And I assume that if you run strips in parallel you divide the 5mbps bandwith between all the strips ?
Just sat down last night to test out APA102’s with the teensy 3.1 and wiz820io sending pixel data via ArtNet and had some interesting results:
Using pin 17 for data and pin 18 for clock even just in the realm of 10 led’s I was getting pretty consistent noise / flickering on my apa-102’s.
I thought that this was due to UDP packet noise or loss until I changed a couple lines of code to use ws2812’s via pin 17 (tried 18 too) which ran perfectly with no flickering or noise - even at closer to 170 pixels in length.
Might this be a timing issue?
I’m going to try pulling down the data rate as you mentioned Daniel
Interesting, please keep us updated !
Did you connect the 3.3V signals directly to the LED strips, or were they run through 3 to 5V buffers, like a 74HCT245?
- PaulStoffregen
it was connected directly bypassing my level shifters however later on the next day when I was able to test this out with nothing else utilizing the home network I was able to get good results using both strips direct off of 3.3v logic. (I was connected very close to the pin)
The teensy 3.1 seemed to have trouble keeping up with the artnet data once I was sending closer to 6-8 universes. Usually only the first and/or second would come in and sometimes the last one.
At what point would the teensy 3.1 hardware and wiz820io combo start dropping packets on a hardware level? how many universes?
I’m trying to figure out if my code is just doing things inefficiently/incorrectly or if I’m hitting a wall with universe limits…
Did you change the SPI speed for the wizIO820 to make it run at 24mhz ?
No I didn’t! How do you do that?
Check this post:
https://forum.pjrc.com/threads/24688-Artnet-to-OctoWS2811?p=42828&viewfull=1#post42828
Although I think the file as changed recently.
Perhaps Paul can confirm what to change exactely ?
Just received 2880 apa102 leds,
Will test out performance soon 