Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 2 1 2 LastLast
Results 1 to 25 of 26

Thread: Weird Results with OctoWS2811 on Teensy 3.1

  1. #1
    Senior Member Wozzy's Avatar
    Join Date
    Jan 2013
    Location
    Philadelphia, Pennsylvania USA
    Posts
    354

    Weird Results with OctoWS2811 on Teensy 3.1

    I am getting weird results running OCTOWS2811 on the Teensy3.1
    If I install a Teensy3.0 in the breadboard, and compile it for Teensy3.0 works great, slow smooth color transitions.
    If I swap it for a Teensy3.1, and recompile it for Teensy3.1, I get flickering and jittering random colors.
    The breadboard is wired just like in the example with 100 ohm resistor and jumper on pins 15-16.
    I get the same results with the example rainbow sketch.
    I have another Teensy3.1, so I'll solder up some pins and give that a try.
    Is anyone else seeing similar issues.

    Code:
    /*  OctoWS2811 Rainbow.ino - Rainbow Shifting Test
        http://www.pjrc.com/teensy/td_libs_OctoWS2811.html
        Copyright (c) 2013 Paul Stoffregen, PJRC.COM, LLC
    */
    
    #include <OctoWS2811.h>
    const int ledsPerStrip = 33;
    DMAMEM int displayMemory[ledsPerStrip*6];
    int drawingMemory[ledsPerStrip*6];
    const int config = WS2811_GRB | WS2811_800kHz;
    OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);
    int rainbowColors[2160];
    
    void setup() {
      for (int i=0; i<2160; i++) {
        int hue = i / 6;
        int saturation = 100;
        int lightness = 50;
        // pre-compute the 180 rainbow colors
        rainbowColors[i] = makeColor(hue, saturation, lightness);
      }
    
      leds.begin();
    }
    
    void loop() {
      rainbow(0, 5000);
    }
    
    void rainbow(int phaseShift, int cycleTime)
    {
      int color, x, y, offset, wait;
    
      wait = cycleTime * 1000 / ledsPerStrip;
      for (color=0; color < 2160; color++) {
        for (x=0; x < ledsPerStrip; x++) {
          for (y=0; y < 8; y++) {
            int index = (color + x + y*phaseShift/2) % 2160;  // 2160 elsewhere & 180 here is cool
            leds.setPixel(x + y*ledsPerStrip, rainbowColors[index]);
          }
        }
        leds.show();
        delayMicroseconds(wait);
      }
    }
    Teensy 3.1
    Click image for larger version. 

Name:	Teensy3.1.jpg 
Views:	893 
Size:	84.2 KB 
ID:	1211

    Teensy 3.0
    Click image for larger version. 

Name:	Teensy3.0.jpg 
Views:	582 
Size:	72.2 KB 
ID:	1212

  2. #2
    Senior Member Wozzy's Avatar
    Join Date
    Jan 2013
    Location
    Philadelphia, Pennsylvania USA
    Posts
    354
    Just to be sure, I reloaded a new Arduino 1.0.5 installation on my WinXP machine.
    BTW This time I put it in C:/Arduino-1.0.5
    However, this did not correct the problem.

    Next I soldered header pins on my other Teensy3.1, and inserted it in the breadboard circuit.
    This one exhibits the exact same behavior as the first.

    I guess I need to dig into the OctoWS2811 timing.
    Last edited by Wozzy; 12-15-2013 at 08:46 PM.

  3. #3
    Senior Member Wozzy's Avatar
    Join Date
    Jan 2013
    Location
    Philadelphia, Pennsylvania USA
    Posts
    354
    I'm not having much success using my WS2811 lightstrips with the Teensy 3.1

    I tried to run some older sketches that used the FastSPI_LED2 library on the Teensy3.1, but I'm getting delay.h errors
    I also tried to compile the FirstLight example sketch included with FastSPI_LED2 RC5 Library, I receive several errors.

    I changed the LED Arrangement configuration to:
    FastSPI_LED2.addLeds<WS2811, DATA_PIN, GRB>(leds+18, NUM_LEDS/3);

    The delay.h error I receive is:
    ...FastSPI_LED2/delay.h: In function 'void _delaycycles_AVR() [with int LOOP = 6; int PAD = 0]':
    ...FastSPI_LED2/delay.h:33:4: error: unknown register name 'r16' in 'asm'


    I've attached a screen-cap of the error screen.
    Has anyone else seen this, or figured a workaround?
    I already alerted Daniel Garcia over on FastSPI_LED Users on G+
    Click image for larger version. 

Name:	Arduino1.0.5.jpg 
Views:	225 
Size:	107.7 KB 
ID:	1217

  4. #4
    Senior Member
    Join Date
    Jun 2013
    Location
    Torrance CA
    Posts
    415
    Do you have a way to convert the 3.3V signal from the Teensy 3.1 to 5V, e.g. a 74hc245? Maybe the IO signals of the MK20DX256 in the T3.1's aren't as strong as the ones in the T3.0's MK20DX128?

  5. #5
    Senior Member Wozzy's Avatar
    Join Date
    Jan 2013
    Location
    Philadelphia, Pennsylvania USA
    Posts
    354
    Potatotron,

    No I'm running the light strips directly...
    The Greeled strips have never had a problem with this.

    That's a good idea though... I'll drag the scope upstairs and take a look.
    Last edited by Wozzy; 12-15-2013 at 11:24 PM.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,031
    I'll look into this soon.

  7. #7
    Senior Member Wozzy's Avatar
    Join Date
    Jan 2013
    Location
    Philadelphia, Pennsylvania USA
    Posts
    354
    Thanks Paul... I'm convinced it's a timing issue.

    It wasn't the voltage, in fact my Teensy3.1 output signal was just slightly higher than the 3.0

    I created a sketch that just keeps updating the lightstrip with a single color (cyan)

    I hooked the outputs to the scope for both the 3.0, and 3.1, one at a time.
    In the photos below, all scope settings, program sketch, and circuits are the same.
    You can see that the frequency is much higher on the 3.1.

    Click image for larger version. 

Name:	Oscope Teensy 3.0.jpg 
Views:	238 
Size:	120.2 KB 
ID:	1220Click image for larger version. 

Name:	Oscope Teensy 3.1.jpg 
Views:	783 
Size:	127.9 KB 
ID:	1221

    I'll hook up the logic analyser to try and make sense of this,
    but it'll have to wait a few days as I'll be traveling starting very early tomorrow morning.
    Last edited by Wozzy; 12-15-2013 at 11:26 PM.

  8. #8
    Senior Member
    Join Date
    Oct 2013
    Posts
    116
    Quote Originally Posted by PaulStoffregen View Post
    I'll look into this soon.
    So uhhhh... if it turns out that you need to touch up the library a bit for the T3.1 and it just so happens that you can turn OctoWS2811 into DodecaWS2811 (ya know, while you've got the hood open and all), then that'd be pretty nifty wouldn't it? Erm... not that I have an agenda or am asking you to look into that, of course! >.> <.<

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,031
    Ha, I had to google "dodeca"

    I looked at this quickly and I'm also seeing strange waveforms. Will investigate in detail on Monday.

    Odds are pretty much zero I'm going to expand beyond 8 output, at least anytime soon. But I did put gamma correction into movie2serial not long ago, so you can expect to see that...

  10. #10
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,031
    I'm testing a fix now. Look for it later today....

  11. #11
    Administrator Paul's Avatar
    Join Date
    Oct 2012
    Posts
    385
    I uploaded 1.18-rc1 with a fix in the OctoWS2811 library.

    http://forum.pjrc.com/threads/24676-...te-1-Available

    Please let me know how this works for you?

  12. #12
    Junior Member
    Join Date
    Jan 2014
    Posts
    2
    hello forum!

    i just bought my first teensy : a 3.1 for a project with severals WS2811 led strip
    so i installed teensyduino 1.18 and the OctoWS2811
    i checked all the connexion and everything looks like ok
    and i tried the basic test but nothing happened. and the best i could get was to light on several led in white at the begining of the strip
    Do you have any idea what hapened?

    thanks for your help

  13. #13
    Senior Member
    Join Date
    Oct 2013
    Posts
    116
    Quote Originally Posted by likid View Post
    hello forum!

    i just bought my first teensy : a 3.1 for a project with severals WS2811 led strip
    so i installed teensyduino 1.18 and the OctoWS2811
    i checked all the connexion and everything looks like ok
    and i tried the basic test but nothing happened. and the best i could get was to light on several led in white at the begining of the strip
    Do you have any idea what hapened?

    thanks for your help
    Hard to be sure w/o some details of how things are wired up (e.g. how are they powered, whats tied back to GND, etc), but I'd wager that its grounding issue or that you forgot to connect pins 15&16 on the teensy.

  14. #14
    Senior Member mortonkopf's Avatar
    Join Date
    Apr 2013
    Location
    London, uk
    Posts
    923
    Quote Originally Posted by likid View Post
    hello forum!

    i just bought my first teensy : a 3.1 for a project with severals WS2811 led strip
    so i installed teensyduino 1.18 and the OctoWS2811
    i checked all the connexion and everything looks like ok
    and i tried the basic test but nothing happened. and the best i could get was to light on several led in white at the begining of the strip
    Do you have any idea what hapened?

    thanks for your help
    Did you bridge pins 15 and 16?

  15. #15
    Junior Member
    Join Date
    Jan 2014
    Posts
    2
    thanks for your quick replies,
    i tryed to draw something to show how it is wired

    Click image for larger version. 

Name:	Untitled-1.png 
Views:	321 
Size:	5.8 KB 
ID:	1288

  16. #16
    Senior Member mortonkopf's Avatar
    Join Date
    Apr 2013
    Location
    London, uk
    Posts
    923
    Quote Originally Posted by likid View Post
    thanks for your quick replies,
    i tryed to draw something to show how it is wired

    Click image for larger version. 

Name:	Untitled-1.png 
Views:	321 
Size:	5.8 KB 
ID:	1288
    So, I just switched out a Teensy 3.0 for a Teensy 3.1 on a octows2811 set up that I know works robustly for the 3.0 (34x8 array, 100 ohm resistors, short wires, common ground, etc - it has worked well for a long time), and I have the same sort of issue, a lot of flicker. I only get the fixed white leds if the CPU is on 24MHz, but the colours are all over the place on 48MHz. I also updated Teensy Loader to 1.18-rc1. I have also looked at changing the resistor value, which has not seemed to help.
    Last edited by mortonkopf; 01-15-2014 at 09:13 PM.

  17. #17
    Junior Member
    Join Date
    Jan 2014
    Posts
    1
    I had the very same flickering+strange colors behaviour with my Teensy 3.1 and OctoWS2811 as described in the first post (using the setup from the OctoWS2811 page + example sketch). Switching to Teensynduino 1.18-rc1 fixed the problem. Thanks!

  18. #18
    I am new to Teensy and LEDs and I am also getting wierd results.

    My setup:
    Teensy 3.1
    Arduino 1.05
    Teensyduino 1.19
    2 strips of DC5V WS2811 pixel nodes, 50node a string
    Hardware connected as described here for a Teensy 3.0: https://www.pjrc.com/teensy/td_libs_...l#videodisplay
    Running BasicTest Example Program

    I can run one strip alone OK but only RED, GREEN, and BLUE colours work (YELLOW 0xFFFF00, PINK 0xFF1088, ORANGE 0xE05800, WHITE 0xFFFFFF go to red after a very quick flash of the correct colour).

    When I add a second strip to Pin 14, both strips go into a speeded-up color wipe that is only red.

    Can anyone suggest what I should do next to figure out what might not be working?

    Is the Teensy 3.1 pin configuration different from the Teensy 3.0 perhaps?

  19. #19
    Quote Originally Posted by billtubbs View Post
    When I add a second strip to Pin 14, both strips go into a speeded-up color wipe that is only red.
    Is it something to do with power consumption? I have 2x 50 leds running off the teensy which is plugged into my MacBook Pro via USB. Should I be moving to a dedicated 5V power supply?

  20. #20
    Senior Member
    Join Date
    Jun 2013
    Location
    Montréal
    Posts
    467
    100 leds * ~60ma = 6 amps. The USB port on a Macbook can probably source a Maximum of 1 amp (probably only 500ma for generic devices) so you are way beyond what the port can provide...

  21. #21
    Senior Member
    Join Date
    Jun 2013
    Location
    Torrance CA
    Posts
    415
    As nclecaude says you definitely need a dedicated power supply for this. One thing you could do for testing is keep all the LEDs at a very low power level (e.g. no pixel component brighter than 0x0f). But even then I wouldn't run more than ~ 50 LEDs without a dedicated power supply.

    Are you using the new WS2812Bs (4 pins per LED)? My experience is Teensy 3.1 + WS2812B always requires the 74hct245 level shifter, whereas with Teensy 3 and the older WS2812s (6 pins per LED) you could often get away without it.

    Finally, it's unlikely this is your problem but please check your wiring and make sure everything is correct. Just last Friday I was trying to play with some FadeCandy-ish temporal dithering and nothing was working and I almost threw the whole kit out the window…until I looked closer and found I'd connected pins 16 & 17, not 15 & 16.

  22. #22
    Thanks nclecaude and potatotron.

    I guess I thought I could test this out with a couple of LED strips and my breadboard before buying a power supply! Clearly not.

    I did try a simpler test sketch that only lights three LEDs at a time and it works fine showing all colours properly (and proving the point that it was a power problem).

    I just ordered two 40A power supplies and an OctoWS2811 Adaptor just to be safe!

    Thanks for your help.

    B.t.w. One LED was dead right from the start. Is that quite common or did I destroy it myself with what I did here?

  23. #23
    Senior Member
    Join Date
    Jun 2013
    Location
    Montréal
    Posts
    467
    Was it the first one ?

  24. #24
    Actually it was the third one in the first strip! This was one of three that I separated from the other boards so perhaps I damaged it when I did that.
    Click image for larger version. 

Name:	LED strip 50.jpg 
Views:	191 
Size:	153.8 KB 
ID:	2568
    Last edited by billtubbs; 08-18-2014 at 03:01 AM.

  25. #25
    Here is my revised Basic Test code if anyone else wants to test a new strip of LEDs without blowing their power supply:

    Code:
    /*  This is a variation on the Basic RGB LED Test provided
        by Paul Stoffregen:
        http://www.pjrc.com/teensy/td_libs_OctoWS2811.html
    
       Instead of lighting all your LEDs at once, this routine
       lights three at a time to conserve power while still 
       allowing you to check if all your LEDs are working.
       
       See the serial output for a log of the LEDs being lit.
    
      Required Connections
      --------------------
        pin 2:  LED Strip #1    OctoWS2811 drives 8 LED Strips.
        pin 14: LED strip #2    All 8 are the same length.
        pin 7:  LED strip #3
        pin 8:  LED strip #4    A 100 ohm resistor should used
        pin 6:  LED strip #5    between each Teensy pin and the
        pin 20: LED strip #6    wire to the LED strip, to minimize
        pin 21: LED strip #7    high frequency ringining & noise.
        pin 5:  LED strip #8
        pin 15 & 16 - Connect together, but do not use
        pin 4 - Do not use
        pin 3 - Do not use as PWM.  Normal use is ok.
    
      This test is useful for checking if your LED strips work, and which
      color config (WS2811_RGB, WS2811_GRB, etc) they require.
    */
    
    #include <OctoWS2811.h>
    
    // Adjust these constants to the LED strips you have connected
    const int ledsPerStrip = 50;
    const int numberOfStrips = 2;
    
    DMAMEM int displayMemory[ledsPerStrip*6];
    int drawingMemory[ledsPerStrip*6];
    
    // Make sure this configuration is right for your LED strips
    const int config = WS2811_RGB | WS2811_800kHz;
    
    OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);
    
    void setup() {
      // initialize serial communication  
      Serial.begin(38400);
      
      leds.begin();
      leds.show();
      
    }
    
    #define BLK    0x000000
    #define RED    0xFF0000
    #define GREEN  0x00FF00
    #define BLUE   0x0000FF
    #define YELLOW 0xFFFF00
    #define PINK   0xFF1088
    #define ORANGE 0xE05800
    #define WHITE  0xFFFFFF
    
    int a = 1, b = 2, c = 3;
    
    void loop() {
      char s[20];
      // uncomment for voltage controlled speed
      // millisec = analogRead(A9) / 40;
    
      leds.setPixel(a, RED);
      leds.setPixel(b, GREEN);
      leds.setPixel(c, BLUE);
      leds.show();
      Serial.print("LEDs lit: ");
      sprintf(s, "%3d, %3d, %3d", a, b, c);
      Serial.println(s);
      delay(500);
      
      leds.setPixel(a, BLK);
      a = b;
      b = c;
      c = (c + 1) % (numberOfStrips*ledsPerStrip);
        
    }
    Last edited by billtubbs; 08-18-2014 at 03:06 AM. Reason: Trying to show code in comment

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •