0

Individual neopixels, PCBs, and whiteout
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Individual neopixels, PCBs, and whiteout

by dee_sap on Fri Mar 09, 2018 12:35 pm

I'll preface this with the fact that I'm learning everything as I go, imagine I don't know what I'm talking about. I'm having issues with pixel whiteout on a manufactured prototype PCB, using individual neopixels.

The board includes an ATTiny84 doing a few things, including controlling 4 individual neopixels. It is at the moment powered via an Arduino Uno 5V out and sent commands from the Uno via I2c. I prototyped this all on perfboard using a 300 ohm resistor on the data line. It worked great! When I had the PCB made to spec (not perfect for some connections, but the pixels haven't changed), the same set up whited out all 4 neopixels. I kept upping the data resistor until I could get the first of 4 to work correctly with a 47k resistor, a significant upgrade from the 300 I usually use.

However, pixels 2, 3, and 4 all whiteout still. I've double checked my "ground" to make sure it's common. I've double checked my voltage and am getting 4.7V off the 5V line of the uno that's temporarily powering/controlling this setup. All the same to my previous prototyping that worked.

I suppose I have 2 questions:
1 - When using individual neopixels, should I use resistors on all data lines to avoid whiteout downstream?
2 - Any thoughts as to why I'm seeing such dramatic difference with a manufactured PCB vs perfboard, all else being the same? Are traces really that different than short 22AWG solid core? Know of any good references on PCB manufacturing?
3 - While I've search for whiteout and found some descriptions of the issue, do you have any sort of "definitive" description of the issue? Also, can you add a very short link about that issue to the uberguide? It took me a LONG time to find info on that issue.

Thanks!

dee_sap
 
Posts: 8
Joined: Fri Feb 17, 2017 2:35 pm

Re: Individual neopixels, PCBs, and whiteout

by adafruit_support_bill on Fri Mar 09, 2018 1:09 pm

Generally you do not need resistors on the data lines between pixels. They are only needed if your data wire from the processor to the first pixel is much longer than a foot or two.

What you do need is decoupling capacitors for each pixel as shown in the reference circuit on the last page of the data sheet. Omitting these can result in inconsistent behavior.

adafruit_support_bill
 
Posts: 70492
Joined: Sat Feb 07, 2009 10:11 am

Re: Individual neopixels, PCBs, and whiteout

by dee_sap on Fri Mar 09, 2018 1:20 pm

Thanks. My decoupling caps aren't ideally placed, but I was hoping that wasn't it since the behavior is consistent. Also, the behavior was so consistent with issues related to the D-in resistors I've found reading about whiteout. Back to the drawing board (literally).

dee_sap
 
Posts: 8
Joined: Fri Feb 17, 2017 2:35 pm

Re: Individual neopixels, PCBs, and whiteout

by dee_sap on Sat Mar 10, 2018 1:02 pm

Any other thoughts? I've got decoupling caps now on all neopixels, directly to the Vss and Vdd. The first of 4 pixels works with a 47k resistor on the data line, but the remaining 3 pixels are solid white.

dee_sap
 
Posts: 8
Joined: Fri Feb 17, 2017 2:35 pm

Re: Individual neopixels, PCBs, and whiteout

by adafruit_support_bill on Sat Mar 10, 2018 1:51 pm

If you post some photos of your board we can take a look and try to spot the problem.

adafruit_support_bill
 
Posts: 70492
Joined: Sat Feb 07, 2009 10:11 am

Re: Individual neopixels, PCBs, and whiteout

by dee_sap on Thu Apr 26, 2018 6:57 pm

Hi, I never posted a photo of the boards because I kept forgetting. But, in the end I checked the signal with my (new) scope and discovered the problem. The whiteout wasn't a hardware issue, it was a timing issue. The Attiny84 (at 8Mhz) using the standard Neopixel library was not timing things right. I played with all the options I could find and in the end couldn't get it to work. The 0 bits were taking 500 nanoseconds and being read as 1s by the pixels.

(In the attached photo, the signal shown is before the resistor I believe and before the filter cap, so a little ugly)

I found this library - https://github.com/cpldcpu/light_ws2812/ and it worked perfectly with no changes to the hardware. The 0 bits with this setup were just shy of 300 nanoseconds, well within the range of acceptable for the neopixels.

Is there some known problem with the AtTiny84 at 8Mhz with the neopixel library? It wouldn't do anything unless I used the + KHZ400 option. As in, on the scope nothing was transmitted without that. With that, it's too slow. The Adafruit library works well with other things I've worked on, so I'd rather not have to learn a new library's quirks...
Attachments
DS1Z_QuickPrint1.png
DS1Z_QuickPrint1.png (33.99 KiB) Viewed 247 times

dee_sap
 
Posts: 8
Joined: Fri Feb 17, 2017 2:35 pm

Re: Individual neopixels, PCBs, and whiteout

by adafruit_support_bill on Thu Apr 26, 2018 7:18 pm

I don't believe anyone here has tried it with the ATTiny84. But we do use it extensively on the ATTiny85s (e.g. Trinket and Gemma) without problems.

Looking at the code, there is an explicit compile-time condition for the ATTiny85:

https://github.com/adafruit/Adafruit_Ne ... NeoPixel.h
Code: Select all | TOGGLE FULL SIZE
// Add NEO_KHZ400 to the color order value to indicate a 400 KHz
// device.  All but the earliest v1 NeoPixels expect an 800 KHz data
// stream, this is the default if unspecified.  Because flash space
// is very limited on ATtiny devices (e.g. Trinket, Gemma), v1
// NeoPixels aren't handled by default on those chips, though it can
// be enabled by removing the ifndef/endif below -- but code will be
// bigger.  Conversely, can disable the NEO_KHZ400 line on other MCUs
// to remove v1 support and save a little space.

#define NEO_KHZ800 0x0000 // 800 KHz datastream
#ifndef __AVR_ATtiny85__
#define NEO_KHZ400 0x0100 // 400 KHz datastream
#endif

// If 400 KHz support is enabled, the third parameter to the constructor
// requires a 16-bit value (in order to select 400 vs 800 KHz speed).
// If only 800 KHz is enabled (as is default on ATtiny), an 8-bit value
// is sufficient to encode pixel color order, saving some space.

adafruit_support_bill
 
Posts: 70492
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.