Closed kevinjwalters closed 4 years ago
i tested this with dotstars now (trinket m0, data -> d0, clock -> d1) no weird colors like for the ws2801 if i rise the clock pin after the data bit is written (like in pull request adafruit/Adafruit_CircuitPython_WS2801#4), everything still works like expected
@schelmo wanna submit a PR here too? :)
The APA102C datasheet from DotStar Addressable 5050 RGB LED does make it look like these are edge triggered on the rising edge for reading data from DI:
Curious that it works either way with CircuitPython, though.
The C/C++ code in https://github.com/adafruit/Adafruit_DotStar/blob/master/Adafruit_DotStar.cpp has three implementations - the two non-hardware assisted ones in that code all do clocking after the data is set as one would expect.
This (deprecated) https://github.com/adafruit/Adafruit_DotStar_Pi/blob/master/dotstar.c#L472 code seems a bit similar to above. Data is correctly asserted before clock pulsing in that.
Fixed by #35
@schelmo has noted that clock rises before data bit is written on the bitbanging implementation in
_ds_writebytes()
in https://github.com/adafruit/Adafruit_CircuitPython_WS2801/pull/4That code is the same and probably originated from here. Check origins of this code and find other occurrences. Forum post to see if anyone is using non hardware assisted pins, i.e. why has this only just been noticed.
(This could be a direct translation of some flawed C code which worked because timing was far tighter??)