Counting digital pulses and resetting

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I have a 555 generating pulses feeding a 4029 or a 4017 which counts them. When the 4029/4017 reaches, say, 5 counts, I detect it with a couple of AND gates and then reset the 4029/4017 so it starts counting again from 0.

This works fine when the output of the divider/counter is used to drive say a 7-seg display or an LED.

However this technique of resetting still allows the count to reach number '5' even for a few milliseconds and this is undesirable. What is the proper way of counting to X and resetting at X+1 but without allowing X+1 to appear at the output ?
 
Maybe not 100s of milliseconds but there is a spike at the output. As you can see the outputs will also need to drive relay switches, and I am scared that some relays receiving spikes and maybe even accidentally switch on.
 

Attachments

  • 555 and counters.JPG
    555 and counters.JPG
    361.3 KB · Views: 64
AX tech editor
Joined 2002
Paid Member
Maybe not 100s of milliseconds but there is a spike at the output. As you can see the outputs will also need to drive relay switches, and I am scared that some relays receiving spikes and maybe even accidentally switch on.

Probably the problem is that you correctly decode the '5' but to reset the counter, you need another clock pulse and until that one comes along, the '5' is tehre.
So you should use the gate detection of '5' to reset and clock the counter at the same time. You can combine clocks with a couple of diodes.
Or maybe you should invest some time in using a microcontroller. Cheaper and simpler, but needs a learning curve.

jan
 
Probably the problem is that you correctly decode the '5' but to reset the counter, you need another clock pulse and until that one comes along, the '5' is tehre.
So you should use the gate detection of '5' to reset and clock the counter at the same time. You can combine clocks with a couple of diodes.
Or maybe you should invest some time in using a microcontroller. Cheaper and simpler, but needs a learning curve.

jan

The chip resets immediately on the '5' - here is the simulated oscilloscope output from pin '3' at the top and the clock pulse at the bottom. The intention is to count: '1', '2', '1', '2', '1' .... so when the '3' comes in the count goes back to '1' - but there is a spike that appears (necessarily) on '3'.

Maybe this spike is nothing to worry about, I am just looking for a cleaner way.

I have no experience with microcontrollers, but I have read they are programmable in assembly, and I do code in assembly (Z80, 68000 and mostly 80x86) - however it probably is a huge learning curve for me right now.
 

Attachments

  • resetting 4017 counter from its own output produces some spikes.JPG
    resetting 4017 counter from its own output produces some spikes.JPG
    57 KB · Views: 58
I have a 555 generating pulses feeding a 4029 or a 4017 which counts them. When the 4029/4017 reaches, say, 5 counts, I detect it with a couple of AND gates and then reset the 4029/4017 so it starts counting again from 0.

This works fine when the output of the divider/counter is used to drive say a 7-seg display or an LED.

However this technique of resetting still allows the count to reach number '5' even for a few milliseconds and this is undesirable. What is the proper way of counting to X and resetting at X+1 but without allowing X+1 to appear at the output ?

So latch the display on the other edge of the clock pulse so the counter will reset while you're not looking. Cheesy but effective and no worse than 555 timers.

Or, take a totally different approach and use a microcontroller and do the 7 segment decoding in software where you can easily implement text in addition to digits. Of course I'm advocating mission creep but fewer packages. Or use a multicharacter display instead of discrete 7 segment units.

 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.