LPD8806 Latching Before latch signal

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Safarir
 
Posts: 8
Joined: Mon Jul 23, 2012 5:39 am

Re: LPD8806 Latching Before latch signal

Post by Safarir »

Hi Guy,

Thanks for helping me again, I just want to show you the result of all this:

http://www.youtube.com/watch?v=WWtAasxjNNQ
http://www.youtube.com/watch?v=cSgwTrLwfa0
http://www.youtube.com/watch?v=hzX7KbN5nFE

User avatar
richms
 
Posts: 558
Joined: Tue Jan 20, 2009 3:05 am

Re: LPD8806 Latching Before latch signal

Post by richms »

Now that really is awesome. Well done!

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: LPD8806 Latching Before latch signal

Post by pburgess »

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

User avatar
owendelong
 
Posts: 78
Joined: Fri Feb 10, 2012 4:25 am

Re: LPD8806 Latching Before latch signal

Post by owendelong »

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.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: LPD8806 Latching Before latch signal

Post by pburgess »

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.

JohnSan
 
Posts: 10
Joined: Mon Feb 27, 2012 11:53 am

Re: LPD8806 Latching Before latch signal

Post by JohnSan »

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.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: LPD8806 Latching Before latch signal

Post by pburgess »

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?

JohnSan
 
Posts: 10
Joined: Mon Feb 27, 2012 11:53 am

Re: LPD8806 Latching Before latch signal

Post by JohnSan »

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.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: LPD8806 Latching Before latch signal

Post by pburgess »

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

JohnSan
 
Posts: 10
Joined: Mon Feb 27, 2012 11:53 am

Re: LPD8806 Latching Before latch signal

Post by JohnSan »

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?

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”