Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 12 of 12

Thread: LPD6803 LED string on T3.0 with FastSPI_LED

  1. #1
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,117

    LPD6803 LED string on T3.0 with FastSPI_LED

    I have a short string of LDP6803-based LEDs and I'd like to use a Teensy 3.0 to control them.

    I understand this chip is not supported by FastLED.... any advice on whether/how to use FastSPI_LED with a Teensy 3.0?
    Last edited by oddson; 12-07-2016 at 02:15 PM.

  2. #2
    Senior Member
    Join Date
    Jan 2013
    Posts
    181
    I have read on the inter-webs that an earlier version of FastLED supported the LDP6803. But more recent version do not.

    Adafruit has a library for LDP6803 and Arduino. I have not used it. I looked through the library code. LDP6803 uses a 2 wire interface: data and clock. The Adafruit library appears to use a bit-banging approach and the user can specify the digital pin to use for each, data and clock. I don't see anything in it that won't work on a Teensy but I might have missed something. So, it might work on Teensy. Try it!

  3. #3
    Senior Member
    Join Date
    Jan 2013
    Posts
    181
    Quote Originally Posted by oddson View Post
    any advice on whether/how to use FastSPI_LED with a Teensy 3.0?
    I re-read your post. The only thing I can think of are:
    A: Use an older version ( 1.<something>), not 3.x) of FastLED, or
    B: contact the FastLED creators and ask if they will support it. That might be unlikely given that they've already made the decision to drop LPD6803 many versions ago. Ask if they have any other suggestions?

  4. #4
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,117
    yeah I've read some of the same things... the old version is called FastSPI_LED (the new one dropped the SPI from the name with support for other communication protocols).

    I was wondering if anyone has direct experience with the OLD library on a non-AVR Teensy?
    I'm going to give it a try but I'm out of my element (non-MIDI!) so I'm hoping to get some advice on avoiding the rocks along the way.

    For example the .cpp of the old library starts with the following:
    Code:
    #if defined(ARDUINO) && ARDUINO >= 100
      #include "Arduino.h"
      #include <pins_arduino.h>
    #else
      #include "WProgram.h"
      #include <pins_arduino.h>
    #include "wiring.h"
    I'm skeptical if stuff like this will work with Teensy at all without a bunch of changes I may not be competent to make.

    Right now I'm not even really sure how the shifting address thing works

    If a T2.0 would work better I could pry one out of an old project... but only if I knew I could get it to work much easier.

    BTW - I'm not looking to do fancy control... just twinkling and slow colour shifts on a 15 light string for a Christmas decoration (lighting a miniature Christmas village).

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,171
    FastSPI_LED was widely used on Teensy 3.0 a couple years ago.

    If you go back to the old versions, probably the biggest obstacle you'll face is the many C++ parsing bugs that ctags added to Arduino. They're still fixing problems. FastLED was hit the hardest, due to extensive use of C++ templates and other features. You'll probably need to go back to Arduino 1.6.5 or even Arduino 1.0.6. I generally keep support for old Arduino versions right before Arduino made major changes, for exactly this sort of reason.

    There was a brief period in FastLED's history where KINETISK_SPI0 was named only SPI0 in kinetis.h. That was a rather shortsighted mistake on my part. If you find a version that gives errors about SPI0 or SPI_t undefined, probably the simplest thing would be to go back a little farther. Or you could edit the code to replace all those with the newer names in Teensyduino's kinetis.h file.

    I would *not* recommend pestering the FastLED developers for help. Daniel and Mark recently put FastLED on hold, following a death in Daniel's family. This just isn't a good time to hit them up with questions, especially about old hardware they decided to no longer support.
    Last edited by PaulStoffregen; 12-08-2016 at 08:27 AM.

  6. #6
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,117
    @markonian...

    The AdaFruit thing looks promising... example file complied OK for 3.0 so I guess I need to try hooking it up and having a go...


    @Paul: Thanks for the info. Just deciphering your message I learned about ctags and C++ templates.

    Out of curiosity... if I were to try to install Ardiuno 1.0.6 how do I add Teensyduino to it?

  7. #7
    Senior Member
    Join Date
    Jan 2013
    Posts
    181
    Quote Originally Posted by oddson View Post

    The AdaFruit thing looks promising... example file complied OK for 3.0 so I guess I need to try hooking it up and having a go...
    The fact that you it compiled is a good sign. Which version of Arduino IDE / Teensyduino are you using for this?

    Also, how are the LEDs being powered and what voltage? I ask this because a bit more nuance exists if driving 5v LEDs from the 3.3v Teensy 3.0. I.e., is a level-shifter needed or does it work well enough without it? In a hurry? Try it without level-shifting first.

    I took another look at the Adafruit library source. The LDP6803s use a "clocked" protocol which allows a driver library to be simpler than if it were "clockless". The library uses a bit-banging approach to controlling the clock and data signals and uses Timer1 for timing. Again, try it. It looks like it might just work or be very close.

  8. #8
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,117
    Oh sh*t... totally forgot about signal voltage.... got all caught up on the software side.

    Thanks for the reminder

  9. #9
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,117
    Neither the Teensy 2.0 or 3.0 seem to work with the LED string and the example code from the Adafruit library.

    I see the main loop LedOut() sends a clock and data for each cycle but I have no clue how timer1 / interrupt stuff works...

    Anything I should try before admitting defeat?

  10. #10
    Senior Member
    Join Date
    Jan 2013
    Posts
    181
    Quote Originally Posted by oddson View Post
    Neither the Teensy 2.0 or 3.0 seem to work with the LED string and the example code from the Adafruit library.

    I see the main loop LedOut() sends a clock and data for each cycle but I have no clue how timer1 / interrupt stuff works...

    Anything I should try before admitting defeat?
    Yes.

    Let us see your circuit or at least give us the exact details of how everything is connected.

    Are you using the example sketch titled "strandtest"? Have you modified it, for example, to change pin assignments?

    What is the normal operating voltage of your LED strip?

    It's way too early to admit defeat As long as we have more ideas to try. I have to assume that the Adafruit library and example works on Arduino hardware if connected correctly. Code-wise, Teensyduino does a pretty good job of emulating the Arduino environment. There are a few things to be aware of when coding for Teensy 3 vs Arduino, but first...

    I suggest we start with double-checking the basic details. I want to verify that your circuit and sketch look like they aught to work. And that we're both talking about the same code and circuit.

    I'm able to find the LPD6803 Datasheet online but I don't know any more details of your LED strips. Any chance you have a link to them to share?
    Last edited by markonian; 12-09-2016 at 07:38 PM.

  11. #11
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,117
    Thanks for taking the time:
    Here's the wiring reference I found for the string... the one I have matches the third example.

    http://www.doityourselfchristmas.com...Colors#LPD6803

    The hot/ground is both obvious and confirmed in the lights working and I've tried switching data/clock just in case.

    I've tried pins 0,1 and 2,3 -- mostly 2,3 so I don't have to remember to alter the code.

    I am trying the strandtest code unaltered... when on 2,3 as it looked like it should work to me.
    Click image for larger version. 

Name:	LED_strip_t2.png 
Views:	56 
Size:	361.3 KB 
ID:	9093

    I'm compiling code for no USB and that's a T2 to avoid the voltage issue.
    Last edited by oddson; 12-09-2016 at 10:20 PM.

  12. #12
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,117
    Sorry.. the code needs to be altered for the number of LEDs and I've forgotten to do that on a number of tests but I think it shouldn't matter... it should still show the color-wipes and rainbows on the 15 LEDs I do have connected.

Posting Permissions

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