mcauser/micropython-74hc595

Example of using two 74hc595 to control a matrix of LEDs

Opened this issue · 3 comments

pcon commented

I'm trying to use this to control a matrix of LEDs by hooking the positive as rows to one SR and then the negatives as columns to another SR. I'm having them share the same rclk and srclk pins and just using different ser pins (simplifying by not having oe or srclr at least for now).

I'm following the left half of this wiring diagram for reference.

It would be nice if there was an example of how to use this for two different SR sharing the same clocks but different latches. No amount of fiddling seems to get them to actually work as expected.

pcon commented

I'd also add that I'm using the bitbang implementation since I'm a bit confused by how to use SPI with the Seeed XIAO-RP2040

You only need 1x 74HC595 to drive a 8x8 led matrix.
eg. https://medium.com/arduino-playground/using-a-74hc595-to-control-a-led-matrix-84559feee7cd
You could use 2x 74HC595s, one driving the high side and one driving the low side, and chain them to share the same clock.
You may notice LED brightness issues when you try to drive an entire row/column, with 1 resistor shared between 1-8 LEDs.

I'd recommend using a MAX7219 instead. It's also chainable, driven by SPI and has brightness control.

pcon commented

I'm going to end up with a 6x6 matrix of LEDs and 6x6 matrix of buttons so I think that the 2x 74CH595 is the best overall use case for me. What I'm not sure about is the procedure for using two of them. Like if I had a 2x2 matrix do I set b0000_0001 for the high side and b0000_0001 for the low side to enable the first row and column? Is there a specific order to sending the bits and latching to make it work properly.