Hi, i have a project where I use an atmega to recieve midi and in turn control 4 rgb LED strips. I am using Francois Best MIDI library along with Elco Jacobs ShiftPWM library and switching the ledstrips via darlington transistor arrays (ULN2803). There seems to be some latency though, i.e. a delay between the note message is recieved and the appropriate ledstrip is lit. when there is not alot going on the delay is unnoticable, but if there are a lot of ledstrips being turned on and of then things start to get sloppy.
Is there a faster more reliable way to control 4 RGB ledstrips. Some dedicated IC that talks i2c or some other magic trick ?
I am baffled by how shiftpwm can work in the first place and therefore don't quite understand why i am getting these delays.
The shift PWM takes up a lot of the processor's time so it looks like that is delaying the processing of the midi data. What happens when you try it without the shift PWM and just use a shift outpu?
Had to attach the code as .ino file as it exceeds 9000 characters. I have to admit its a while since i actually looked at the code. The reason I came to think about this isse now was that i was designing a PCB to replace the frankenstein mess of protoboards and wires that lives in my instrument now.
I'm pretty sure its the shiftpwm causing the delay Grumpy_Mike, I have used the midi library for lots of other real world controlling applications and not experienced this problem.
I can see from the little calculator on Elco Jacobs site that the shiftpwm currently incurrs an interupt load of 0.14 (3 registers, 127 brightness levels, 75hz PWM freq, and of course 16mhz clock)
Though i realize now i can drop the number of registers to 2 and maybe drop the PWM freq to around 50hz? giving an interrupt load of 0.07, But i have no idea if this is likely to have any impact.
they are fully adjustable and can be used up to 4A (so it says) and is a much better/cheap way of regulating down to 5v rather than dumping all that volt drop heat out to the heatsink