AP102 LEDs

Moderator: Benj

Post Reply
mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

AP102 LEDs

Post 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 2712 times
Martin

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: AP102 LEDs

Post 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 2688 times
- and the correct number of LEDs now illuminated..

Martin

chad
Posts: 198
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 27 times
Been thanked: 33 times
Contact:

Re: AP102 LEDs

Post by chad »

Thanks for looking at this. At some point I am going to be using a bunch of apa102s.

Chad

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: AP102 LEDs

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: AP102 LEDs

Post 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.

Post Reply