Adafruit is open and shipping! Let's build back better, together!
0

LPD8806 Latching Before latch signal
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: LPD8806 Latching Before latch signal

by pburgess on Mon Jul 23, 2012 11:25 pm

Hi John,

Appreciate the offer, but the library seems to be working pretty reliably at this point, so I don't think we need to pick anything apart right now.

pburgess
 
Posts: 4067
Joined: Sun Oct 26, 2008 2:29 am

Re: LPD8806 Latching Before latch signal

by Safarir on Sat Aug 11, 2012 2:45 pm

Safarir
 
Posts: 8
Joined: Mon Jul 23, 2012 5:39 am

Re: LPD8806 Latching Before latch signal

by richms on Sat Aug 11, 2012 7:51 pm

Now that really is awesome. Well done!

richms
 
Posts: 558
Joined: Tue Jan 20, 2009 3:05 am
Location: New Zealand

Re: LPD8806 Latching Before latch signal

by pburgess on Sat Aug 11, 2012 11:54 pm

Neat!

I have a clear plastic top hat (I think it's supposed to be an ice bucket for champagne) that I'd been hanging on to for some kind of LED project. But yours totally pwns any idea I had in mind. :D

pburgess
 
Posts: 4067
Joined: Sun Oct 26, 2008 2:29 am

Re: LPD8806 Latching Before latch signal

by owendelong on Mon Jan 07, 2013 9:05 pm

I think this is now well understood, but just in case, I actually managed to track down some of the engineers that know the LPD8806.

The chip has no latch, as others have suggested. Instead, as soon as data is received, the chip transfers the data into the PWM registers in order...

The first bit must be 1. The next 7 bits control the PWM for output 1.
The next bit must be 1. The next 7 bits control the PWM for output 2.
...
The next bit must be 1. The next 7 bits control the PWM for output 6.
Once all 6 PWM outputs are full, additional data received is passed through to the data output pins of the chip so long as the first bit of each octet is 1.

The PWM values are active on the LEDs as soon as they are fully received. There is no latch and no need to latch the data.

Sending an octet containing all zeroes has the following effects:

1. The chip will reset so that the next data byte received will control PWM output 1.
2. The all-zeroes octet is copied to the output pin so that all chips are reset.

For unknown reasons, the propagation of the all-zeroes octet seems to die out over about 32 LEDs or 1 meter (I haven't yet tested whether it is LED count or distance for sure), so you need to repeat the all-zeroes octet once for each meter.

The color order of the LED strips sold by Adafruit is GRB. The 52 pixel/meter strips I've seen from Gree-LED are BRG. The 8806 treats it as 6 PWM outputs and it's up to the circuit board manufacturer to control which order the LEDs are wired to the pins.

owendelong
 
Posts: 74
Joined: Fri Feb 10, 2012 4:25 am

Re: LPD8806 Latching Before latch signal

by pburgess on Tue Jan 08, 2013 5:06 pm

This mirrors my own findings. Reassuring to hear it from the engineers themselves though. Thanks!

Latest version of the LPD8806 library includes huge comment block explaining pretty much the same.

pburgess
 
Posts: 4067
Joined: Sun Oct 26, 2008 2:29 am

Re: LPD8806 Latching Before latch signal

by JohnSan on Sat Jan 12, 2013 2:24 pm

Hi.

I have just tried the updated LPD8806 library and it runs slower than the earlier version.

The earlier version I had was modded with 'Mondeo' speed increase changes.... i think it was just reducing the pause value.

Using an Arduino Pro Mini (16Mhz clock), the original takes around 120ms to chase a pixel down a 5m strip.
Changing to the new library increases that to around 190ms.

No idea why.
JohnSan
 
Posts: 10
Joined: Mon Feb 27, 2012 11:53 am

Re: LPD8806 Latching Before latch signal

by pburgess on Sat Jan 12, 2013 4:01 pm

Not familiar with the 'Mondeo' code. Can you provide a link?

The latest library is pretty tight and eliminated needless voodoo like the pause. Are you using hardware SPI or bitbang mode?

pburgess
 
Posts: 4067
Joined: Sun Oct 26, 2008 2:29 am

Re: LPD8806 Latching Before latch signal

by JohnSan on Sun Jan 13, 2013 10:04 am

Hmmmm.
I can't find the original info on 'Mondeo' anywhere. (It was around March 2012).

I could paste here, the faster LPD8806.cpp with the mods in and a note about it, if thats any help.
JohnSan
 
Posts: 10
Joined: Mon Feb 27, 2012 11:53 am

Re: LPD8806 Latching Before latch signal

by pburgess on Sun Jan 13, 2013 9:14 pm

Sure. Or if it's easier, just this: are they running the SPI bus at 4 MHz? That might account for it.

pburgess
 
Posts: 4067
Joined: Sun Oct 26, 2008 2:29 am

Re: LPD8806 Latching Before latch signal

by JohnSan on Mon Jan 14, 2013 12:39 pm

Yes.
SPI bus speed was changed...
I've copied parts of the file here.


// ++++++++ was SPI.setClockDivider(SPI_CLOCK_DIV8); // 2 MHz +++++++++
SPI.setClockDivider(SPI_CLOCK_DIV2); // INCREASE to 8MHz

Also, there is a Pause() statement commented out....

writeLatch(numLEDs); // Write latch at end of data

// We need to have a delay here, a few ms seems to do the job
// shorter may be OK as well - need to experiment :(
// delay(pause); // ++++++++++ COMMENTED OUT PAUSE +++++++++++

I think the Pause() made the biggest difference since it introduced 3mS delay.
I don't think that delay exists in the 'new' files anyway?
JohnSan
 
Posts: 10
Joined: Mon Feb 27, 2012 11:53 am

Please be positive and constructive with your questions and comments.