Dear all,
I did some work with APA102 based LED strip with 144 LEDs per meter version. All went rather smooth with both HSPI and bit-banged versions after I figured the required end frame is not 4 bytes of $FF, but 8. So 64 set bits. This is true for whatever number of LEDs you use - 1 or 30. Did not try more as my application only needs 10. So, obviously, one needs to be prepared to experiment with these poorly data-sheeted devices .
Bit banged code, optimised for speed, not code space in the attached file, intended to switch small boat navigation tri-state and anchor masthead light. The code takes ~1800KB and switches the LEDs with small, but noticeable delay at 16MHz. As the code is intended for M2 device, at 32MHz there should be no delay to see. It could be optimised for code space instead, reducing the code to some 400KB or even less, but then LEDs change colours in noticeably one-by-one fashion.
Cheers,
Edmunds
View attachment APA102WorkingSampleMacro.bas
I did some work with APA102 based LED strip with 144 LEDs per meter version. All went rather smooth with both HSPI and bit-banged versions after I figured the required end frame is not 4 bytes of $FF, but 8. So 64 set bits. This is true for whatever number of LEDs you use - 1 or 30. Did not try more as my application only needs 10. So, obviously, one needs to be prepared to experiment with these poorly data-sheeted devices .
Bit banged code, optimised for speed, not code space in the attached file, intended to switch small boat navigation tri-state and anchor masthead light. The code takes ~1800KB and switches the LEDs with small, but noticeable delay at 16MHz. As the code is intended for M2 device, at 32MHz there should be no delay to see. It could be optimised for code space instead, reducing the code to some 400KB or even less, but then LEDs change colours in noticeably one-by-one fashion.
Cheers,
Edmunds
View attachment APA102WorkingSampleMacro.bas