-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use more than 4 registers (hw spi) #1
Comments
Hi @mcer12, Thanks for trying out my library. To store the state of the added pins the library uses a 32-bit variable, which is fairly easy to handle when using bit-operations for setting and sending pins. I figured that adding 32 pins to a pin-limited MCU using four shift-registers would be sufficient for most cases. What is your use case? What is the project you have in mind? How many additional registers would you like to use in your project? BTW. What MCU are you using? If you want to use multiple strings of shift-registers you could experiment with sharing the SPI MOSI/SCLK pins and having one SS (latch) pin per string. This would entail instantiating multiple |
Thanks for the reply! 74HC595 are great for multiplexing and for more moderate resolution you could utilize many registers, I use ESP8266 + 5 registers to drive small 25x11 pixel led grid. I currently use soft library: |
Do I understand correctly that you need 5 registers because you want to drive 25+11=36 lines? With my library it's probably easiest to first try experimenting with multiple strings. How about using one string with four registers for the columns and one with two for the rows? If that works, it will only require one additional pin for SS of the second string and not require any code changes. Perhaps I could make a new version with compile-time option to allow 8 registers using a 64-bit variable, but at the moment I don't have much spare time. If you have the time, you can dive in. The essence of the libraries is not very complicated, but they do contain some extra code to support various MCUs and optimize speed. As I made them open source, you're free to use them as you please. |
Yes you're correct, 36 outputs. This project is already finished and in use (pcbs assembled), so any hardware changes are out of question. If you find time that would be great, I will try to take a look at it as well, having support for 8 (or even more) registers will be a huge step up. Either way, thanks for the hints, really appretiate it. |
Hi, @maxint-rd is there a reason that it's limited to just 4 registers? Any way to use more than 4? There are alternative libraries for 74HC595 but none of them utilizes HW SPI. Thanks in advance!
The text was updated successfully, but these errors were encountered: