Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pcon opened this issue Aug 26, 2022 · 3 comments
Open

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

pcon opened this issue Aug 26, 2022 · 3 comments

Comments

@pcon
Copy link

pcon commented Aug 26, 2022

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
Copy link
Author

pcon commented Aug 26, 2022

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

@mcauser
Copy link
Owner

mcauser commented Aug 26, 2022

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
Copy link
Author

pcon commented Aug 28, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants