View Single Post
  #28   Report Post  
Posted to uk.d-i-y
Tim Watts[_3_] Tim Watts[_3_] is offline
external usenet poster
 
Posts: 7,434
Default Laser Christmas outdoor projectors..

On 03/12/16 22:59, Andy Burns wrote:
Tim Watts wrote:

Andy Burns wrote:

do your own bit-banging, you could probably drive 8 strings of RGB
LEDs per GPIO port.


I wonder how practical that would be - bit banging at 400kHz (is that
right - it's been a while?)


800kHz


Blimey! I would not feel confident of bitbanging that in ordinary userland.

Does a Pi have DMA based GPIO?


Yes: GPIO 18 in DMA-PWM mode.

I did look at the Adafruit library for this and IIRC it does as you
described earlier: Has one byte per bit, describing the mark/space of
one PWM pulse. Load up 24xNumLEDs bytes into RAM and let it rip. Do
whatever at the end to cause the registers to be latched to the LED
drive outputs.

I think the Pi only has one such pin so you only get to do one chain
this way.

seems a pretty realtime operation for a full on OS like linux (unless
you actually use RT features or write it as a kernel driver or
something???


Can't remember the name (banana pi? Latte Panda?) but oneof the
pi-alikes has an arduino "slave" onboard, which could do the bitwise
I/O, while the linuxy section decided what colours to send.


That would be elegant. It's the sort of job an 8pin Atmel AVR could
probably manage too for £3 and some really simple programming, assuming
the clock goes high enough (20MHz being the tinyAVR max) to handle bit
banging with reliable timing - OR if it's onboard PWM is upto the job (I
thought tinyAVR PWM was limited to a single mark/space until
reprogrammed, rather than being able to ramp through RAM - but my
experience of PWM on AVRs is minimal)


4k RAM would allow for RGB on over 1000 LEDs leaving working space as
you'd not be using the more wasteful method of the Pi PWM.

I wonder how easy it would be to link it to the over I2C... You only
really need 3-4 commands: SetNumLEDs; SetLEDXwithRGB; BulkLoadBuffer;
SendBufferToLEDs

It does sound a rather neat way of doing it

If that were viable, making a custom "HAT" with 1/2 dozen of these on
board would be pretty cool.