SPCW pointed this thread out to me on mine, so, i'll fetch what i've got over here...
I purchased 10 of the little chips off ebay. Becarefull with the chips when soldering them as they are extremely sensitive to heat... I think i've killed 4 out of the 10
The constant current chip is the WS2811. The chip itself has two speeds, 400KHz or 800KHz. the WS2812 runs at 400KHz and the WS2812B runs at 800KHz.
Communication to these devices is via a daisy chain with a NRZ type wave form. Each chip has 3 channels with 8 bit PWM.
So, at 800KHz to send a 1 bit you send a high pulse of duration 0.8uS and the a low of 0.45uS.
To send a 0 bit you send a high pulse of durations 0.4uS and then a low of 0.85uS.
Total bit lenght is 1.25uS +-300nS
The timing tolerances are +-150nS
Now, the arduino's run entire strings of these things with the MCU running at 8MHz so one would think a 64MHz 18F46K22 would not have an issue...
However, when i kick out a sequence manually like this...
Code:
LATD.0 = 1
ASM
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
;10
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
;20
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
;30
nop
nop
nop
nop
nop
nop
nop
nop
;38
ENDASM
LATD.0 = 0
ASM
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
;10
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
;20
nop
nop
nop
nop
nop
nop
nop
nop
nop
;29
ENDASM
Everything works fine. Even using GOSUB's to the on and off bit subroutines works without an issue after a little trimming by trial and error (as above).
However, as soon as i use any sort of IF statement to read from an array, all the timings seem to go out the window and i can not adjust it enough to compensate.
My calcs say that the 46K22 @ 64MHz makes 64 instructions per uS.
Even if i cut off all the NOP's from the off time trailing sequence the pic still can not make the calculations (IF condition) within the required time.
I have tried everything i can think of so far...
I look forward to people's responses.
Bookmarks