Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Counter clock/trigger

Status
Not open for further replies.

John_B

New Member
Hi
I am sure this has been asked before but after hours of searching I came up empty
I want to increment a bcd counter (74HC192)on each closure of a momentary switch (easy enough I have that bit sorted) what I really would like is an increment on each press AND a fast increment if the switch is held closed for a set time period.

I am still in the very early stages of micro pro's so would prefer to do this without pic's and the like maybe in about 50 years when I have my head round micropro's then I'll re-do it :)

Any ideas?

also how do I add a signature or catchphrase or whatever they are called??

Ta muchly
John
(Invariably I do whatever the voices tell me !)
 
Last edited:
Hi,

you could use a monoflop which controls a gated oscillator circuit and OR the inputs of slow and fast clock for the counter clock input.

Boncuk
 
ah thanks for that Boncuk yeah..

I couldnt get past an astable held off with a monostable but kinda inelegant I thought.

I will look into it !

John
(Invariably I do whatever the voices tell me !)
 
You could use the switch to apply V+ via a resistor R to a capacitor C. After a delay C will have charged to a point where it can turn on a simple oscillator made using one gate of a quad Schmitt NAND gate (CD4093). The oscillator output and the switched V+ can be OR'ed using other gates in the CD4093 to provide the counter clock signal.
 
You could use the switch to apply V+ via a resistor R to a capacitor C. After a delay C will have charged to a point where it can turn on a simple oscillator made using one gate of a quad Schmitt NAND gate (CD4093). The oscillator output and the switched V+ can be OR'ed using other gates in the CD4093 to provide the counter clock signal.
You would need two gates to make a relaxation oscillator.

You need to do more the OR the signals, since the high from the switch will keep the OR output high, independent of the oscillator state. You could use an AND gate, with the switch and the inverted oscillator output (oscillator high when in the static state) as inputs. Alternately you could feed both into an EXOR.
 
You would need two gates to make a relaxation oscillator.
One Schmitt NAND is enough for an oscillator.

You need to do more than OR the signals, since the high from the switch will keep the OR output high
You're right. So as per Boncuk's suggestion above this should do it :-

Clocker.gif
 
You could use an AND gate, with the switch and the inverted oscillator output (oscillator high when in the static state) as inputs.
But you need to do more than that :)! A monostable seems necessary to debounce the switch.
 
You are correct. One inverter Schmidt trigger gate can make a relaxation oscillator.

Certainly the switch needs to be debounced for the circuit to prevent multiple triggers, which you didn't mention in post #4 but I assumed was there.
 
thanks guys I need to find some time to look at this lot *S* I will get back with an update ...unfortunately real life (work) takes presidence this weekend.
 
By way of explanation of the circuit in post #6 :-
C3, R4, U3, U4 form a monostable circuit providing a switch-debounce function with a pulse width of ~ 12mS. If that's insufficient increase R4.
U1, C2, R3 form a gated oscillator.
C1, R5 provide a delay of ~ 1 sec before the oscillator is gated on. Adjust R5 as necessary to alter the delay.
Adjust R3 to alter the oscillator pulse repetition rate (~ 15 Hz).
The pulse outputs of the monostable and oscillator are combined by gate U2 to give the required clock signal for the counter.
 
Colin it might be if :-...(choose any one!)

1 you know how to use em
2 you got them
3 you want them
:)
I do realise pics are the way but my brain WILL NOT absorb micro pro's. I have tried a few times and failed miserably ...but I am learning them again (well trying) but in the meantime I simply want my little project running...later I probably will go over. As stated in my Original post !

It isn't just a fast counter (thats easy) it is a counter that will increment once with each button press AND a faster run of the numbers if the button is held shut for (say) 2 seconds or more.

The pulse that increments the BCD counter will be also go to a bilateral switch which will act as a key press to trigger an event in software running on my pc (its in a flight similator)
 
It is a counter that will increment once with each button press AND a faster run of the numbers if the button is held shut for (say) 2 seconds or more.
 
I know. It's on a PIC. That's what makes it so easy. No parts. You can change any feature at any time. It can count up or down. It can count to any number. I would never go back to discrete components.
 
Colin
Thanks for your input. I am envious.

I really do appreciate what you are saying and if you lived next door I would happily let you code it for me or beat it into me with a stick ...its just I seem unable to absorb pic (well all micro) coding.
I have spent years (yup years!) trying...its like a blindness..I sit a lesson and understand perfectly whats happening and how it works. Walk away and on returning back for more it is literally like I have never seen this stuff before....VERY frustrating....

I am the same with music !

Its not that I am dim LoL I have a high IQ (212) a member of MENSA have a Ma degree in Mechatronics oh and a MSCE... arghhhhhh just trapped in a discrete world (not good for tricky projects)
 
even more frustrating especially as the one of the counters I now need will need to count up and down to just 360 and rolling over on both up and down .....a discrete headache !!!
 
I am totally senile and that's why I have structured my website so that everyone can understand programming and circuit design.
It's just a matter of "copy and paste" and add one line of code at a time.
All I ma saying is this: I would never go back to through-hole components or discrete chips once you go to microcontroller-designs and surface-mount.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top