Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25) not working?

by pburgess on Sun Feb 03, 2013 10:21 pm

Hi Rads,

I do apologize for the slowness of this...it's simply an unprecedented situation and I've been trying to come up with an explanation and a plan for debugging it, or puzzling over if we're just not getting something through to each other. Let's try this:

Please bring up the strandtest sketch that's included with the Adafruit_WS2801 library.

Change lines 30 and 31 as follows:
Code: Select all
int dataPin  = 11;    // Yellow wire on Adafruit Pixels
int clockPin = 13;    // Green wire on Adafruit Pixels

And leave the standard strip declaration in place (DO NOT use the SPI version yet):
Code: Select all
Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin);


Connect the LED strand to pins 11 & 13 and upload this sketch to the board.

If this fails: my only explanation is that the Arduino is defective. If it was purchased from Adafruit, we'll replace it. (And if elsewhere...was it an "eBay special"? Because it sure looks like the genuine deal.)
If this works: getting into Twilight Zone territory. Leave the wiring where it is on 11 & 13, and let's do that thing with the sketch again for hardware SPI. Comment out line 37, enable line 41:

Code: Select all
//Adafruit_WS2801 strip = Adafruit_WS2801(25, dataPin, clockPin);
Adafruit_WS2801 strip = Adafruit_WS2801(25);


Upload revised sketch and observe results.

If this works: you should be able to upload LEDstream at this point.
If this fails: cue theremin music, I'm baffled. You'll need to edit the library source file Adafruit_WS2801.cpp, and look for the 'startSPI' function around line 108. Last line of the function should normally be:

Code: Select all
    SPI.setClockDivider(SPI_CLOCK_DIV16); // 1 MHz max, else flicker

Let's change it to:
Code: Select all
    SPI.setClockDivider(SPI_CLOCK_DIV128); // 125 KHz

This throttles back the SPI speed to its lowest possible setting.

Re-compile the sketch and upload to board.

If this works: substitute SPI_CLOCK_DIV64 and SPI_CLOCK_DIV32 (and the original SPI_CLOCK_DIV16 if these both work), compile/upload, try to narrow down the point of failure.
If this fails: weird science fiction stuff is happening. Try connecting the Arduino to each of the other strands and see if the same phenomenon is observed, or if it's limited to one specific strand. If just the one strand, try moving that one later in the chain and see if the whole string then works.

If after all this we're still hitting a brick wall, this defies all logic and exceeds my ability to diagnose, in which case I will personally wire up and test an identical setup and send you the known working combination directly off my desk. Because I can't explain what you're seeing.
User avatar
pburgess
 
Posts: 2175
Joined: Sun Oct 26, 2008 1:29 am

Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25) not working?

by Rads on Tue Feb 19, 2013 7:35 am

Hi Phillip,

Sorry for not getting back but been on vacation and this is the first chance i've had. Anyhow, it looks like the Arduino is defective, I modified the strandtest sketch with pins 11 and 13 but nothing worked, I checked voltage and this was 5.3V.

Loaded the original sketch (with pins 2 and 3), uploaded and hey presto...I've got multicolour led cycling.

It was purchased from you, but I'm quite some distance (international) so not really worth sending back to you. If you can set me up an arduino that actually works I'll just buy it from you.

Let me know what my next steps are to make sure the one you setup is allocated to me.
Rads
 
Posts: 8
Joined: Thu Jan 24, 2013 2:21 am

Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25) not working?

by Rads on Thu Feb 21, 2013 12:45 am

Trying to keep the thread active so I can eventually have a workign adalight system :wink:
Rads
 
Posts: 8
Joined: Thu Jan 24, 2013 2:21 am

Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25) not working?

by Taigitsune on Wed Feb 27, 2013 2:32 am

Not to trump this thread, but if it helps I'm running into the same problem with a strand of 100 pixels and a Mega 2560. Granted, I didn't obtain either from you and will probably be picking up an actual Uno R3 tomorrow, but if I can help provide more information in any way I'll be happy to.

Thus far I'm able to run strandtest without issue on pins 11 and 13 until I enable SPI per your examples. After that, blotto.
Taigitsune
 
Posts: 1
Joined: Wed Feb 27, 2013 2:28 am

Re: 12mm Diffused Thin Digital RGB LED Pixels (Strand of 25) not working?

by pburgess on Wed Feb 27, 2013 9:02 pm

Taigitsune: refer to the posts in this thread regarding pin numbers and the Mega. You don't want to use 11 and 13.
User avatar
pburgess
 
Posts: 2175
Joined: Sun Oct 26, 2008 1:29 am