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.

counting a 24 pulse signal

Status
Not open for further replies.
thanks everyone, it was actually to discuss something not regarding electronics, so i have sent a PM.


as for the diagram, i have looked back at it and i just want to confirm something. above the ripple counter there is a box marked out, i assume this is still part of the counter, the top pin on the left i assume is the reset, but that also goes into a gate with the clock. is the gate part of the ripple counter, is the pin between reset and clock, count enable?

thanks again
 
The "Res" signal goes to pin 2 and the output of U7 goes to pin 1 of the counter. The symbol in the LTSpice library is a bit funky...
 
Last edited:
The "Res" signal goes to pin 2 and the output of U7 goes to pin 1 of the counter. The symbol in the LTSpice library is a bit funky...


ok great, hopfully i can get it all working when the parts arrive, so i will let you know.
 
oh and one last thing, what program is that you are using? it looks amazingly useful. i think i need to invest in it, it would save me a lot of burnt out components.
 
oh and one last thing, what program is that you are using? it looks amazingly useful. i think i need to invest in it, it would save me a lot of burnt out components.

LTspice. Free down-load at Linear.Com. If you get it, also join the LTspice User's Group on Yahoo.
 
wow free, now i wasn't expecting that!

thanks again, this site seems to be an infinite welth of knowledge.... or maybe its just you?
 
right, i have finally got all the components to make this...

but i have put it together and there seems to be two problems, the first problem is that the LED is very dim, i am using a normal green LED to test it, and i took out the resistor but still you can barely see that it is lit.

secondly the light is flashing very fast about 10 times faster than it should though it is very hard to tell exactly how fast it is flashing because i don't have the equipment.

i tried using a transistor to opperate the light but it didn't seem to work, the LED was on all the time.

i have checked all my connections a couple of times, and checked the specs with the data sheets and it seems ok, having said that i have made stupid mistakes before,

but any ideas would be great,
 
What voltage are you supplying the 4000 series cmos logic on?
Are you mixing TTL/CMOS?
What is the amplitude of the BPM clock?
Are you sure that it is a "clean" square wave? (
Did you put any 100nF bypass caps from Vdd to Vss on the logic chips?

Hook your Green LED to a 5V supply through a 1K resistor. How bright is it? You can NEVER run an LED without a current limiting resistor in series with it. I suggest getting an ultra-bright LED. Even when running it at 4mA, it will be bright enough. I have some first generation green LEDs that are really dim even with 20mA flowing through them.
 
What voltage are you supplying the 4000 series cmos logic on?
Are you mixing TTL/CMOS?
What is the amplitude of the BPM clock?
Are you sure that it is a "clean" square wave? (
Did you put any 100nF bypass caps from Vdd to Vss on the logic chips?

Hook your Green LED to a 5V supply through a 1K resistor. How bright is it? You can NEVER run an LED without a current limiting resistor in series with it. I suggest getting an ultra-bright LED. Even when running it at 4mA, it will be bright enough. I have some first generation green LEDs that are really dim even with 20mA flowing through them.

ok some of those questions i don't understand.

all three of the chips are connected to a regulated 5v supply from the device putting out the clock signal

i am not sure what you mean by TTL/CMOS but the chips are HCF4024BE, CD4012CN and CD4011BE

i am pretty sure the clock is 0v to 5v

the clock may not be a 100% perfect square wave but from what i can find out it seems to be perfect.

there is no bypass cap fitted, so i have just fitted one but no difference

i hooked up a high brightness white LED, this is very bright when connected to 5v with the 1k resistor, but it is very dim when connected to the output of the ripple counter, still it is brighter than the green one which makes it easier to see, and when trying to count it (i set the BPM to 60) it seems to be flashing roughly 10 a second, so ten times faster.

but the reset part seems to work, and it is doing something, but i am not sure why it is counting so fast unless it is a problem with my clock signal.

i used a microprocessor to do the same job, and that is working fine, so i know the clock is working, and i know its 24 pulses that need to be counted, i wonder if the ripple counter is maybe more sensitive than the microprocessor.
 
All your logic is CMOS. Always bypass logic chips power to ground, short leads, using a 100nF capacitor.

If there is any "fuzz" (technical term for multiple clock edge crossings) on the clock signal, then it might happen that the counter will multiple count, but a micro might "debounce" the fuzz due to software delays.

Try a low-pass RC filter consisting of a series 10K resistor, and a shunt 10nF or 100nF to ground between the clock input and the first Nand gate. If it is fuzz, that might cure it.

If everything works right, the duty cycle of the LED flash will be 1/24, which will make it look quite dim. Since you wanted it to flash on the 24th beat, I figured that is what you wanted. How about if you use the decoded 24th beat to trigger a one-shot which extends the on time of the led to about a 50/50 duty cycle?
 
All your logic is CMOS. Always bypass logic chips power to ground, short leads, using a 100nF capacitor.

If there is any "fuzz" (technical term for multiple clock edge crossings) on the clock signal, then it might happen that the counter will multiple count, but a micro might "debounce" the fuzz due to software delays.

Try a low-pass RC filter consisting of a series 10K resistor, and a shunt 10nF or 100nF to ground between the clock input and the first Nand gate. If it is fuzz, that might cure it.

If everything works right, the duty cycle of the LED flash will be 1/24, which will make it look quite dim. Since you wanted it to flash on the 24th beat, I figured that is what you wanted. How about if you use the decoded 24th beat to trigger a one-shot which extends the on time of the led to about a 50/50 duty cycle?

it is quite possible that there is fuzz, it was never really built for fast signal rate, but i am not quite sure what you mean about the low pass filter, do you mean i have a 10k resistor attached to a 100nf cap and one end goes to ground and the other to the clock?

i like your idea of extending the duty cycle, but i am wondering if it could be done with a capacitor in some way, or maybe a pull up resistor?

thanks again for your help, i am sure we will get this working!
 
Here is a revised schematic with a the filter shown. You have one unused gate. Try hooking it up as shown. That will give your Led flash a duty cycle of about 1/3. Lowering the current limiting resistor will make it a bit brighter, too.
 

Attachments

  • Count24a.png
    Count24a.png
    42.1 KB · Views: 171
Last edited:
Here is a revised schematic with a the filter shown. You have one unused gate. Try hooking it up as shown. That will give your Led flash a duty cycle of about 1/3. Lowering the current limiting resistor will make it a bit brighter, too.

right, the NAND idea to change the duty cycle of the LED worked perfectly the LED is now up to full brightness,

but adding the filter to the clock pulse did nothing, its still 10x too fast. is there anything i could have shorted that might make it do that? if i wanted to make it ten times faster what what would i have had to do?

also there is a bit of a strange error, if i stop the clock signal when the LED is on, the LED stays on, if i stop it when it is off it stays off, because it is flashing so fast its a random chance that the LED will either stay on or stay off.

but so far its getting there, the brighter LED is perfect! also this means that the quad input duel NAND gate is obsolete doesn't it? the same could be done with a duel input NAND gate?

thanks again for your help!
 
ok i took the lead that goes from the U5 NAND gate to reset and disconnected it, the light still flashed but slightly slower, only slightly though. with the wire attached to the reset pin on the CD2024 and the other end going nowhere i found that the light stopped flashing unless i was holding the wire. now that seems to me like there is some interferance somewhere, because the light was only flashing when i held the wire, and i don't mean the bare wire but actually the plastic insulated part,

could i have an issue with the chips being too close together?
 
ok i took the lead that goes from the U5 NAND gate to reset and disconnected it, the light still flashed but slightly slower, only slightly though. with the wire attached to the reset pin on the CD2024 and the other end going nowhere i found that the light stopped flashing unless i was holding the wire. now that seems to me like there is some interferance somewhere, because the light was only flashing when i held the wire, and i don't mean the bare wire but actually the plastic insulated part,

could i have an issue with the chips being too close together?

hi,
CMOS type ic's have a very high input impedance, this means that inputs must never be left floating.
Holding the wire induces mains hum and other interference into the ic and it will misbehave.

Inputs should be either grounded [0v] or tied high to +Vcc
 
hi,
CMOS type ic's have a very high input impedance, this means that inputs must never be left floating.
Holding the wire induces mains hum and other interference into the ic and it will misbehave.

Inputs should be either grounded [0v] or tied high to +Vcc

ah ok, thanks for that,

what about outputs? the last two outputs of the 7 stage ripple counter go to nothing, could that cause a problem? should i ground them?

thanks
 
ah ok, thanks for that,

what about outputs? the last two outputs of the 7 stage ripple counter go to nothing, could that cause a problem? should i ground them?

thanks

hi,
No, Outputs are not a problem.

If you want to run the 4024 without the RESET [for a test], tie the RESET pin #2 of the 4024 to 0V.
 
hi,
No, Outputs are not a problem.

If you want to run the 4024 without the RESET [for a test], tie the RESET pin #2 of the 4024 to 0V.

ok, i linked it to gound and it flashes as fast as it does when its not linked to anything and i am just holding it,

i attached it to the outputs of the ripple counter one by one, each one made the LED come on or flash, except pin 11 (q2) which did nothing, could there be a flaw in the chip if q2 is not firing?
 
ok, i linked it to gound and it flashes as fast as it does when its not linked to anything and i am just holding it,

i attached it to the outputs of the ripple counter one by one, each one made the LED come on or flash, except pin 11 (q2) which did nothing, could there be a flaw in the chip if q2 is not firing?

hi,
Just to double check.
Normally the datasheets start the Qn output labels as Q0, Q1 ... Q6, LTspice 4024 labels start at Q1,Q2 ...Q5.
I would expect a short flash from Q2.

Look at this image and confirm this is how you have it wired.

Count24a.pngAAesp02.gif
 
Last edited:
hi,
Just to double check.
Normally the datasheets start the Qn output labels as Q0, Q1 ... Q6, LTspice 4024 labels start at Q1,Q2 ...Q5.
I would expect a short flash from Q2.

Look at this image and confirm this is how you have it wired.

View attachment 38885View attachment 38886


just checked and that is the same diagram i followed, the pins discribed are wired as they should be,

but when i said Q2 i was looking at the chip upside down, its Q5 that does nothing
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top