I've still got some stuff going on here,

I’ve still got some stuff going on here, so the hardware side of my setup is in a bit of flux and I don’t have a quick and easy rig setup to do some testing - so … anyone out there waiting for Teensy 3.1 support who feels like being a bit of a guinea pig?

https://github.com/FastLED/FastLED/archive/FastLED2.1.zip

(You will need to manually move/rename the folder to libraries/FastLED for everything to work right).

I’ve tested that it builds in a couple of different combinations of options/leds, but beyond that I can’t make much in the way of guarantees, but it’d be nice to know if it’s at least tracking in the right direction(s).

(EDIT: It turns out the P9813 support in here (with a bit of tweaking, thanks to Dave Morgan in the comments) is also working, so hey - new chipset as well!)
https://github.com/FastLED/FastLED/tree/FastLED2.1

Since this build also appears to include support for the P9813, I should be able to test it for you tomorrow.

That’d be awesome! I’m fairly certain it won’t work, since it’s mostly an implementation based on reading the data sheet, but i’ve been surprised in the past, so … :slight_smile:

Unfortunately, you were correct - it didn’t work. :wink: Here is the error output from the compiler:

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.
Arduino: 1.0.5 (Windows NT (unknown)), Board: “Teensy 3.1”
FastLEDTest.cpp.o: In function addLeds<(ESPIChipsets)3u, 11u, 13u, (EOrder)10u>': c:\Program Files (x86)\Arduino\libraries\FastLED/FastLED.h:73: undefined reference toCFastLED::addLeds(CLEDController*, CRGB const*, int, int)’
FastLEDTest.cpp.o: In function setup': C:\Program Files (x86)\Arduino/FastLEDTest.ino:34: undefined reference toFastLED’
FastLEDTest.cpp.o: In function CFastLED::show()': c:\Program Files (x86)\Arduino\libraries\FastLED/FastLED.h:158: undefined reference toCFastLED::show(unsigned char)’
c:\Program Files (x86)\Arduino\libraries\FastLED/FastLED.h:158: undefined reference to CFastLED::show(unsigned char)' FastLEDTest.cpp.o: In functionloop’:
C:\Program Files (x86)\Arduino/FastLEDTest.ino:45: undefined reference to `FastLED’
collect2.exe: error: ld returned 1 exit status

This is how I set up the controller. Is this correct?

	FastLED.addLeds<P9813, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);

I’m not sure what’s going on yet, but the compile issue looks to be a false alarm. I was doing some testing to see if it was the Teensy, or the P9813 that was causing the issues, and now it compiles with no errors. I’ll do some more testing and report back.

So the first issue was caused by me as a relative Arduino newbie. :wink: Now that I fixed that, I got it compiled and loaded, and it works … somewhat.

I did my testing using your Blink example. The first thing I noticed is that the code to set the LED to Black wasn’t working. I thought that was odd but I ignored it. Then I tried setting a different LED in the string (other than 0) to Red and that also worked. But then I tried setting an LED to other colors (like Green and Blue) and they didn’t work either. So something seems up with color selection (although that makes no sense to me).

Next I got ambitious and decided to try setting all LEDs in the string to Red, one at a time in a loop. I have 100 LEDs on my string, and it started out working great but then things got a bit erratic after around 50 LEDs or so. Sometimes there would be a pause, and then two LEDs would like up at once. Then eventually, random LEDs started coming in in colors other than Red.

My current Teensy testbed isn’t the best setup either (it’s very temporary until some more parts arrive). As such, I decided to try compiling it for the Seeeduino board I got from Cool Neon (basically a Duemilanove). This setup is very stable and is what I’ve been using for the last week to do a lot of development for the Total Control Lighting hardware. The sketch compiles with no errors on the Teensy, but when I make no other changes except to select the Duemilanove instead, I get these errors:

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.
Arduino: 1.0.5 (Windows NT (unknown)), Board: “Arduino Duemilanove w/ ATmega328”
C:\Program Files (x86)\Arduino\libraries\FastLED/chipsets.h: In member function ‘void P9813Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED>::writeBoundary() [with unsigned char DATA_PIN = 11u, unsigned char CLOCK_PIN = 13u, EOrder RGB_ORDER = RGB, unsigned char SPI_SPEED = 0u]’:
C:\Program Files (x86)\Arduino\libraries\FastLED/chipsets.h:180: instantiated from ‘void P9813Controller<DATA_PIN, CLOCK_PIN, RGB_ORDER, SPI_SPEED>::showColor(const CRGB&, int, uint8_t) [with unsigned char DATA_PIN = 11u, unsigned char CLOCK_PIN = 13u, EOrder RGB_ORDER = RGB, unsigned char SPI_SPEED = 0u]’
Blink.ino:45: instantiated from here
C:\Program Files (x86)\Arduino\libraries\FastLED/chipsets.h:154: error: ‘class SPIOutput<11u, 13u, 0u>’ has no member named ‘writeWord’
C:\Program Files (x86)\Arduino\libraries\FastLED/chipsets.h:154: error: ‘class SPIOutput<11u, 13u, 0u>’ has no member named ‘writeWord’

One interesting observation is that I get this same exact error related to the P9813Controller if I select any of the controllers that use a clock pin (for controllers that only require a data pin, the code compiles with no errors).

huh - ok, i’ll have to do some work - the P9813 code is a bit stale, it’s possible I tweaked around the SPI classes after working on it in a way that I haven’t propagated around everywhere.

For your 100 led string test - what are you using for power? There may be a power problem after you get past a certain point. I’m curious why green and blue aren’t working - I suspect I’m going to have to get my hardware setup here going to really test/debug what’s going on in here.

(The big reason for putting up this link was the teensy 3.1 support, though, the P9813 was a “maybe, but not likely” :slight_smile:

That said - if you re-fetch the code, I have just pushed a fix for the build error.

And I lied - i just found a bug in the P9813 code from comparing the code to a re-read of the data sheet - pull now, and hopefully that will work.

Which then brings us back to the problem you have with longer strips - I actually think that may be a function more of the timing than anything - on the teensy 3 i’m pushing a 24Mhz SPI clock, which means ~20Mbps data rate - which I suspect the P9813 may not like at longer lengths.

AH! And according to the datasheet, the maximum clock speed is 15Mhz - not the 24 that i’m allowing… one more checkin and that should give a nice cap on the data rate which should take care of your “more than 50” issue…

Thanks for the quick updates Daniel! I’ll wait for the last update and then try again. To answer your other question, I’m driving the LEDs with a 30A supply, as the end result will have 600 LEDs. I am however currently only driving it on one end of the string. I will eventually re-inject power every 100 LEDs, and I suspect that will spill into both strings at the injection point and should help (right now I definitely get a color fade when all LEDs are driven to full white).

As another data point, I’m not currently using any resistors out of the Arduino - I’m connecting directly to the string. FWIW though, all the other code I’ve been working on has been very reliable. Most of the time I don’t even see any color shift issues, as I’m normally not driving all LEDs at full white, or anything close.

So - you should be able to grab code now - and it’ll have the three fixes (build fix on duellimenove, P9813 protocol fix, clocking fix).

You should be fine on power, the flickering problem that you had is, often, a power problem, but it is also a problem that exhibits when running the SPI clock too fast - some LED chipsets can be run at a higher/faster rate, but only for short strips, then they start freaking out.

Thanks for the feedback - it was actually quite useful in pegging the problems I needed to look at, even though I can’t run anything here at the moment :slight_smile:

I actually have a basic blink sketch working on that last build you posted (or maybe this is the final one - I grabbed it about two minutes before your post). In any case, it’s working just fine with the 9813 now on the Arduino, and it’s CRAZY FAST compared to what it was before!! :slight_smile:

I have to run out to do some errands now, but after lunch I should have time to try another test with the Teensy. I’ll be sure to let you know how it goes. Thanks for all the help! :slight_smile:

I couldn’t stand the wait … so I didn’t. :wink: I just tried with the Teensy and it works fine. I also tested other colors and they are working correctly as well.

And just to make sure I’m understanding this correctly, I ran a loop to blink each of the 100 LEDs - one at a time with no delay. Then I put that inside another loop and executed the outer loop 100 times. The results took about five seconds to complete. Does that mean I was seeing a 4000 frame per second rate?

I assume that FastLED.show does a refresh of the entire string, right? So that would be one refresh for the Red and one refresh for the black, times 100 LEDs, times 100 iterations = 20,000 refreshes of the string in five seconds. Is that really right?

Your assumption/understanding is correct :slight_smile: Welcome to stupid high POV rates!

I have a matrix consisting of 1056 (22x48) WS2801 pixels. The blink sketch only showed one blinking LED. The fast2dev sketch worked great and went through each and every pixel without and problems.

Sorry, but I’m a somewhat noob to Teensy/Arduino and I know nothing about programming. So I built myself a pretty large LED Display in our living room (sunk invisibly into the wall). Here is a video of it: http://www.youtube.com/watch?v=CpbJ6QXxt9k

I’m running it with Glediator (http://solderlab.de) through an Arduino Mega but I’m not satisfied with the frame rates. With fast moving images it becomes very jiggly and the frame rate drops to about 3-5FPS. (See: http://www.youtube.com/watch?v=lJgDDpZQy7k and http://www.youtube.com/watch?v=u5jw2YdJiAM).

So I bought a Teensy3.1 in hopes that it will be faster but I just can’t get it to run with the Arduino Mega sketch. I don’t know why but I thought it was running with FastSPI but I guess I was wrong. Does anybody have any clue how I could get it to run on Teensy3.1? Maybe with FastLED library?

This is the original sketch for the Arduino Mega: https://drive.google.com/file/d/0BwcEBbPY7cRIS1FkVXppdzZyanc/edit?usp=sharing
And this is a sketch that I found somehwere that is suposedly for Teensy3.0: https://drive.google.com/file/d/0BwcEBbPY7cRIV3hwaWFzMDRMdmc/edit?usp=sharing
(but the author told me he never got it to work 100%. It somewhat works on Teensy3.1 and is incredibly fast but has alot of “graphic-errors”, wrong colors, alot of pixels showing blinking uncontrolled etc…)

I would really appreciate any help.

has anyone tried ws2812b and a teensy 3.1 yet? i cannot get it to work but had no problems with the 3.0. used code grabbed from the above branch today so should have latest but only got a bit of flicker. Used a 74HCN245 for level conversion on a single pin (and without) and tried all the examples too. might be a daft error somewhere but i’ve checked just about everything now and can’t see it if so! sadly i don’t have my 3.0 any more to try that in place :confused: I am happy to volunteer as a guinea pig if there’s any chance it’s a code thing :slight_smile:

It’s possible it’s a code thing - unfortunately, you are the first person to have actually tried the teensy 3.1 code yet. I may have to get one of my 3.1’s setup with a logic probe to see what’s going on, it’s possible that some of the instruction timings have changed between the teensy 3.0 and the 3.1 that’s causing a problem for the ws2812b and friends.