|
30 | 30 | pull block ; wait for fresh data
|
31 | 31 | out y, 32 ; get count of NeoPixel bits
|
32 | 32 |
|
33 |
| -; NeoPixels are 800khz bit streams. We are choosing zeros as <312ns hi, 936 lo> |
34 |
| -; and ones as <700 ns hi, 546 ns lo> and a clock of 16*800kHz, so the always-high |
| 33 | +; NeoPixels are 800khz bit streams and we run at 16*800kHz. |
| 34 | +; We are choosing zeros as [4,12] ~= <312ns hi, 938 lo> |
| 35 | +; and ones as [9,7] ~= <700ns hi, 546ns lo> and a clock of 16*800kHz, so the always-high |
35 | 36 | ; time is 4 cycles, the variable time is 5 cycles, and the always-low time is 7 cycles
|
36 | 37 | bitloop:
|
37 |
| - pull ifempty [1] ; don't start outputting HIGH unless data is available (always-low part) |
38 |
| - mov pins, ~ null [3] ; always-high part |
| 38 | + pull ifempty [4] ; don't start outputting HIGH unless data is available (always-low part) ; low 7 |
| 39 | + mov pins, ~ null [3] ; always-high part ; high 4 |
39 | 40 | {} ; variable part
|
40 |
| - mov pins, null ; always-low part (last cycle is the 'pull ifempty' after wrap) |
| 41 | + mov pins, null ; always-low part (last cycle is the 'pull ifempty' after wrap) ; low: 1 |
41 | 42 |
|
42 |
| - jmp y--, bitloop ; always-low part |
| 43 | + jmp y--, bitloop ; always-low part ; low: 2 |
43 | 44 |
|
44 | 45 | ; A minimum delay is required so that the next pixel starts refreshing the front of the strands
|
45 | 46 | pull block
|
|
0 commit comments