Go Down

Topic: "Phantom Lights" in LED Matrix (Read 373 times) previous topic - next topic

Wawa

Never build a LED matrix, but couldn't you use SPI.transfer to speed things up?
Leo..


PaulRB

#16
Sep 14, 2017, 07:44 am Last Edit: Sep 14, 2017, 07:45 am by PaulRB
Noting the new code, does the latch pin need to be low when we're writing to the shift registers? Absolutely not. Just toggle the latch pin low and high after you shift out the data, and you can omit clearing the scanning register, which opens up more processing time.
If I remember correctly, it does not matter whether the code sets the latch pin low before or after writing to the shift register. The data is output on the rising edge of the latch signal. The falling edge is ignored.

As for omitting clearing the register, that was added by the OP to correct the ghosting which was the reason for starting this thread.

PaulRB

#17
Sep 14, 2017, 07:49 am Last Edit: Sep 14, 2017, 08:20 am by PaulRB
Never build a LED matrix, but couldn't you use SPI.transfer to speed things up?
The circuit is driven by an ATtiny85, so I don't know if the SPI library would work. The tiny does have a USI (universal serial interface) which should be able to simulate SPI. But if that can be used, how would speeding the sketch up help? The OP had not reported that speed is a problem.

Wawa

The circuit is driven by an ATtiny85...
Ahh, missed that.
Leo..

Go Up