Counter-based Port Expansion for Arduino, ESP, Etc From Scrap.
by Northstrix in Circuits > Microcontrollers
285 Views, 2 Favorites, 0 Comments
Counter-based Port Expansion for Arduino, ESP, Etc From Scrap.
This simple project will allow you to expand the number of available outputs on platforms like Arduino, ESP, etc.
How This Works
A binary counter increments its internal state at each clock pulse. Latch changes its state when the synchronization pulse reaches high level. By connecting the inputs of latches (or registers) to the outputs of the counter and sending a certain amount of pulses to the counter. While the counter has already counted to the value that you need. Its possible to achieve the desired result at the outputs of the latches by sending a synchronization pulse to all latches at the same time.
Note: There are much better ways of expanding number of available ports. 74HC595N or MCP23017 are better suitable for this purpose. The goal of this project is to build a useful staff from scrap that would otherwise end up being stored in the box forever. You can easily expand the number of outputs to 32, 64 or even 128 by using this method, but I'm only going to demonstrate the concept here. For that reason (and because I don't have a larger breadboard) I'm only going to expand the number of outputs to 4.
Pick the Components
1) MCU (Arduino, ESP, STM, or whatever)
2) Binary counter (or just build one yourself)
3) Either one 4-bit register or 4 latches or 4 flip-flops
4) * Couple of 4k - 10k resistors. In case the circuit will not work properly add two resistors between res and ground and/or ref and ground.
I've used K561IE10 as a binary counter and K555TM7 as 4 latches. You can also build the whole circuit using only NAND elements.
Flash Your MCU
This code is so simple to have any compatibility issues. You can even run it on a toaster.
Wire It Up!
It's up to you now.
Enjoy the Result
Congratulations! You've learned how to utilize a staff from the late 70's and early 80's. And probably saved couple of dollars on new components.