Twin 4017 decade counter divider scalable counter idea
You can see a small 60fps movie of the lights cycling up to speed through delays between LEDs of from 25ms down to 0ms in steps of 5, then it holds on with no delays in an endless loop, here (726KB MOV). You can see a bit of flickering with the 0ms delay cycle at the end, but in real life, it's impercetable, all LEDs appearing steadily on. However, introducing a 1ms delay per LED does cause very visible flickering, but this shouldn't be the case when I move the final display to the PIC (likely a 16F84A or 16F648A). For some reason, the BS2p40 is just a slow mover, despite its rated clock speed.
Sorting the problem into categories of "What I have," and "What I need," and then ignoring the "What I have" part, ideally the looping of the 1st 4017 would reset the 2nd one, but also, each needs to tie to its own reset from its 1st unused output pin to keep from introducing empty outputs into the cycle. This has proven difficult, as it doesn't operate like a computer program, where everything that should get called gets called. If something happens too fast here, such as a chip's resetting itself, then the other thing that should happen, i.e. the other chip clocking, doesn't happen. I feel there's some diode-based trickery that might solve this, allowing me to tie pins into "nets," but making it so certain resets and clocks can't go the wrong direction in these interconnections.
Another option I thought of late last night was to use the devices more truly as decade counters, and tie some combination into a reset. E.g. I need this to loop after the 32nd output, so I can let the second one loop through a natural decade with no self-resets, but then tie both resets high through 2 transistors in an AND gate setup, with their bases tied to both 4017's 3rd outputs. When both chips are on their 3rd output, that means it's at clock 33, and it's time to reset. Naturally, this throws up another problem: in order to clock the 1st chip, I need to know when the 2nd one is looping. In this setup, I can only do this through the 1st output of the 2nd chip, but the 1st outputs of both will be high at startup, which means when I power the circuit, chip 2 will clock chip 1. I get around this with a bootup clocking through to 23, but that feels messy. If only these #@(%*! 4017s reset on the falling edge, all my troubles would be over. I could simply tie which pin I want to reset something, and when it drops down again, reset - perfect. It almost makes me wonder why they made it rising-edge, or at least, why they didn't give me a choice.
It's a nice pair of chips, allowing me to clock through a varying number of inputs with a single pin from the microcontroller, but it seems that every time I think I have it, clock and reset pins are vying with one. It feels like a riddle, though. A riddle with an answer to which I'm getting closer. I could solve all of this with shift registers, but I'd need 4 of them, and it would be such a waste of their abilities. I could also solve things more easily with components only, but there'd be so many of them. The idea here is to use a very small number of things to accomplish what should be a simple task, using only a single input (and another for reset would be nice, too).
Twin 4017 decade counter divider scalable counter idea
You can see a small 60fps movie of the lights cycling up to speed through delays between LEDs of from 25ms down to 0ms in steps of 5, then it holds on with no delays in an endless loop, here (726KB MOV). You can see a bit of flickering with the 0ms delay cycle at the end, but in real life, it's impercetable, all LEDs appearing steadily on. However, introducing a 1ms delay per LED does cause very visible flickering, but this shouldn't be the case when I move the final display to the PIC (likely a 16F84A or 16F648A). For some reason, the BS2p40 is just a slow mover, despite its rated clock speed.
Sorting the problem into categories of "What I have," and "What I need," and then ignoring the "What I have" part, ideally the looping of the 1st 4017 would reset the 2nd one, but also, each needs to tie to its own reset from its 1st unused output pin to keep from introducing empty outputs into the cycle. This has proven difficult, as it doesn't operate like a computer program, where everything that should get called gets called. If something happens too fast here, such as a chip's resetting itself, then the other thing that should happen, i.e. the other chip clocking, doesn't happen. I feel there's some diode-based trickery that might solve this, allowing me to tie pins into "nets," but making it so certain resets and clocks can't go the wrong direction in these interconnections.
Another option I thought of late last night was to use the devices more truly as decade counters, and tie some combination into a reset. E.g. I need this to loop after the 32nd output, so I can let the second one loop through a natural decade with no self-resets, but then tie both resets high through 2 transistors in an AND gate setup, with their bases tied to both 4017's 3rd outputs. When both chips are on their 3rd output, that means it's at clock 33, and it's time to reset. Naturally, this throws up another problem: in order to clock the 1st chip, I need to know when the 2nd one is looping. In this setup, I can only do this through the 1st output of the 2nd chip, but the 1st outputs of both will be high at startup, which means when I power the circuit, chip 2 will clock chip 1. I get around this with a bootup clocking through to 23, but that feels messy. If only these #@(%*! 4017s reset on the falling edge, all my troubles would be over. I could simply tie which pin I want to reset something, and when it drops down again, reset - perfect. It almost makes me wonder why they made it rising-edge, or at least, why they didn't give me a choice.
It's a nice pair of chips, allowing me to clock through a varying number of inputs with a single pin from the microcontroller, but it seems that every time I think I have it, clock and reset pins are vying with one. It feels like a riddle, though. A riddle with an answer to which I'm getting closer. I could solve all of this with shift registers, but I'd need 4 of them, and it would be such a waste of their abilities. I could also solve things more easily with components only, but there'd be so many of them. The idea here is to use a very small number of things to accomplish what should be a simple task, using only a single input (and another for reset would be nice, too).