0

neopixel timing accuracy requirement
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

neopixel timing accuracy requirement

by plutonic on Fri Apr 13, 2018 3:22 am

Hi, I looked at the neopixel tutorial and it says it needs an 800 khz signal but doesn't anywhere say what the timing tolerance is. Do I need to use a controller board with an xtal oscillator, or is it sufficient to just come pretty close? I want to run a meter or so (60 leds) of neopixel or dotstar from a gemma or trinket and can write the timing code in C or assembler, but there's no crystal on the board. Dotstar would obviously work, but my frugal side prefers neopixel because it's cheaper, if all I have to do is write a little more code. Thanks!

plutonic
 
Posts: 41
Joined: Wed Jan 06, 2016 3:21 am

Re: neopixel timing accuracy requirement

by kcl1s on Fri Apr 13, 2018 7:06 am

Timing has already been taken care of in the Neopixel Arduino library. The Gemma or Trinket need no additional hardware. Check here for all things Neopixel. https://learn.adafruit.com/adafruit-neopixel-uberguide?view=all

Fellow Hobbyist
Keith

kcl1s
 
Posts: 846
Joined: Tue Aug 30, 2016 12:06 pm

Re: neopixel timing accuracy requirement

by plutonic on Wed Apr 18, 2018 4:01 am

kcl1s wrote:Timing has already been taken care of in the Neopixel Arduino library. The Gemma or Trinket need no additional hardware. Check here for all things Neopixel. https://learn.adafruit.com/adafruit-neopixel-uberguide?view=all

Fellow Hobbyist
Keith


Kcl1s, thanks, I did look through the uberguide and didn't see any timing tolerances there. The neopixel is supposed to run at 800 khz, but if your board has no xtal and its frequency drifts by a few percent, does the neopixel still work?

I'm planning to use the Gemma M0 or Trinket M0 with CircuitPython. I mentioned earlier that I can write low level code in C if required, but it sounds like CircuitPython now already has it. Either way I wouldn't be using an Arduino lib, though I can examine the arduino code to check how it works. Anyway, everyone seems to be using neopixels with no xtal so I guess it works ok and I'll just go with it. Thanks again.

plutonic
 
Posts: 41
Joined: Wed Jan 06, 2016 3:21 am

Re: neopixel timing accuracy requirement

by kcl1s on Wed Apr 18, 2018 7:27 am

There are Circuit Python Neopixels examples using a Neopixel module as well. This tutorial uses Circuit Python for Neopixels on an MO board (Itsy Bitsy) https://learn.adafruit.com/led-trampoline?view=all

Keith

kcl1s
 
Posts: 846
Joined: Tue Aug 30, 2016 12:06 pm

Re: neopixel timing accuracy requirement

by adafruit_support_bill on Wed Apr 18, 2018 7:41 am

The device timing tolerances for are documented in the datasheet: https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf

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

Re: neopixel timing accuracy requirement

by plutonic on Tue Apr 24, 2018 11:23 pm

Thanks Bill! It looks like it works by pulse duration and there's about 150ns tolerance. Maybe on a Cortex M0 it's even possible to stay in tolerance while banging the port under a multitasker. My guess from how the spec is written is that the whole thing works by pulse width and RC delays so there is no issue with long term drift. I'm sure that would have been obvious to you electronics folks but I'm just a software programmer so I don't automatically think that way :).

plutonic
 
Posts: 41
Joined: Wed Jan 06, 2016 3:21 am

Please be positive and constructive with your questions and comments.