Page 1 of 1

AP102 LEDs

Posted: Fri Nov 08, 2019 9:51 pm
by mnf
Just noticed a small bug in the Arduino (I've tested) implementation of AP102C component.

A simple single strand of LEDs connected to SPI (hardware) works AOK - if you remember to set B2 to output.

- But I noticed that one LED was not lit.

Rather than counting to 60 (ran out of fingers) - I reset the strip length to 10 - and only 9 LEDs are lit at the start of the strand.

Note that all the LEDs are functional - (setting the strand length to 61 lights all the LEDs although there are only 60)
There isn't a 'hidden' LED at the start of the strand.

The C code looks OK - for SetAllLEDColour and Refresh. (while FCL_INDEX < 10 - gives 0..9)

The Adafruit strandtest works correctly....
apa.JPG
apa.JPG (17.33 KiB) Viewed 3453 times
Martin

Re: AP102 LEDs

Posted: Sat Nov 09, 2019 8:25 pm
by mnf
The cause of this is the lack of an end frame in Refresh()..

From the data sheet:
data.PNG
(125.43 KiB) Downloaded 906 times
So adding my own refresh macro which adds an end frame:
MyRefresh.JPG
MyRefresh.JPG (17.82 KiB) Viewed 3429 times
- and the correct number of LEDs now illuminated..

Martin

Re: AP102 LEDs

Posted: Sat Nov 09, 2019 8:49 pm
by chad
Thanks for looking at this. At some point I am going to be using a bunch of apa102s.

Chad

Re: AP102 LEDs

Posted: Mon Nov 11, 2019 10:05 am
by mnf
Not quite a complete fix - needs the bit-bang alternative too! Hopefully easy for Ben & co to incorporate.

I've been trying (and failing) to get them working with an ATTiny85...

Martin

Re: AP102 LEDs

Posted: Mon Nov 11, 2019 2:04 pm
by Benj
Brilliant, Thanks for letting us know and well done for finding the cause of the problem.

I've added the End Frame to the refresh function now and pushed the fix to the update system.

Let me know how you get on.