4017 CMOS interference

Discussion in 'The Projects Forum' started by magnet18, Dec 22, 2010.

  1. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    Hi everyone,
    I am working on a clock project in my free time and i have run into an issue with the 4017 decade counter. I made a breadboard circuit with the decade counter and powered it without any signal going in on pin 14 (the clock in pin), the LED's i was using on the output pins began flashing rapidly. I did a little probing with my oscilloscope and discovered that each of the 10 pins is going high 6 times a second, which means the chip is triggering at 60Hz. Probably not a coincidence that its exactly the AC line frequency. Ive tried placing capacitors between the chips power in on pin 16 and ground and it didn't help. When i attempt to apply voltage to pin 14 the flashing stops and it will occasionally count forward 1 but after that the chip appears "frozen", and wont respond to any voltage anywhere. I also tried using a voltage regulator and got the same results. Any help would be greatly appreciated.
    Thanks
     
  2. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    The 4017 is a Cmos IC that has an extremely high input impedance that picks up interference from 60hz because the very long connecting wires on a breadboard are antennas.

    The clock input of the 4017 must be fed through short wires on a pcb (not on a breadboard) from a clock oscillator that has its output go high and go low.
     
    magnet18 likes this.
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You must never leave CMOS inputs "floatiing" (disconnected). They must have a current path to either Vdd or Ground, or the IC can oscillate at random frequencies.

    Unused OUTPUTS should be left disconnected.
     
    magnet18 likes this.
  4. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    If you can attach a schematic of you circuit as it is currently connected, we can help you identify any possible problems with the circuit and suggest corrections.


    hgmjr
     
    magnet18 likes this.
  5. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    Im not really concerned with the schematic as it is seeing as ive used the exact same circuit before successfully. I figured it was probably some problem involving the breadboard but wasn't sure, ive heard of breadboard lines acting as capacitors before but not antennas, it makes sense though.
    Does anyone know of any ways to successfully use the chip in a breadboard though? I was having some trouble with the logic and wanted to debug it on the breadboard before putting it on a crowded little pcb. Would using a socket and then just bending pin 14 on the socket and soldering the clock in directly to that work? Or should all input pins be disconnected?
    Thank you all for the help :)
     
    Last edited: Dec 22, 2010
  6. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    All input pins on a logic IC must be high or low, not disconnected.
    Output pins can be disconnected if they are not used.

    The supply voltage to a logic IC should have a bypass capacitor, a 0.1uf ceramic capacitor is good, connected as close to the supply pins of the IC as is possible with very short wires.

    A pushbutton causes erratic logic swings to a logic IC because the contacts bounce many times each time the pushbutton is used. The logic counts each bounce as a new signal.
     
    magnet18 likes this.
  7. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    I apologize if i wasn't clear, by disconnected i meant disconnected from the breadboard lines.
    Basically im looking for a way it can be used with a breadboard.
    Thanks for the tip on the pushbutton though, i wasn't aware of that.
     
  8. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    A schematic would help. It would eliminate assumptions on both sides. A schematic is the blueprint of the electronic circuit, and will do more than a 1000 words.

    For example, pin 13 must be grounded.

    [​IMG]

    This is figure 9.2 from my LEDs, 555s, Flashers, and Light Chasers article.
     
  9. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    Alrighty then, heres the schematic...
    [​IMG]
    (the negative sign on the electrolytic should be a positive)
    I originally attempted to build this directly onto a pcb but it wouldn't rollover correctly, so i was attempting to build it in stages on a breadboard to try to find where I went wrong and be certain it works when I ran into my problem.
    Now im just wondering if theres any way to use a 4017 with a breadboard at all or if i should just attempt it on a pcb again.
     
  10. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    OK, you show an open input on the clock line. The clock input is very picky about the magnitude and shape of this signal, where is it coming from?

    [​IMG]

    The area circled in red looks like you are trying for a power up reset. The area in blue appears to be an AND gate. The two diodes going to pin 15 on both circuits also don't do anything that I can tell. They are just there. You could remove them, leave a piece of wire, and eliminate the 100KΩ resistor and it would do the same thing.

    The intended purpose is obvious enough, it is the 1-12 hour counter. I would have done the AND gate differently (2 diodes and one resistor), but if it works good enough.

    One hint in drawing schematics, signal flow (in this case counter flow) should be right to left, not left to right as you have drawn.

    Right now the three big suspects are the hour input signal, the reset line, and the power supply ripple. Do you have an oscope?

    What is the normal logic level in the reset line?
     
    Last edited: Dec 23, 2010
    magnet18 likes this.
  11. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    I took the time to redraw what I think I'm seeing, plus another way to do the same logic.

    [​IMG] [​IMG]

    You don't need a very wide signal for the reset line, the one you have is measured in half seconds, where milliseconds will do.

    I didn't show the chip filter caps, they are assumed.

    Hope it is of some help.
     
    Last edited: Dec 23, 2010
  12. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    The electrolytic you circled is intended to pull the master reset line up on power up for a few milliseconds to prevent any odd states in the chips such as multiple high outputs, these usually work themselves out after a rollover but i don't like them. The diodes aren't necessary in this part of the circuit but in the previous decade counter segments-
    [​IMG]
    (there are two of these, one for seconds and one for minuets)
    - they keep the signal from the rollover at the 6 from getting into the master reset line and resetting the counters farther up in the minuets and hours and potentially day of week counters. They aren't ALL necessary, but better safe than sorry.

    I'm using a quartz x-tal with a frequency of 32.768Khz, dividing it with a 4060 down to two Hz and again with a 4013 flip-flop down to the necessary 1 Hz. I do have an o-scope (i recently got it for christmas :) ) and this portion of the circuit works fine, the hours display was my only issue.

    The signal is running right-left only because it makes it easier to keep track of since this is how it will be laid out on the clock in real life.

    Could you go into more detail about how you would wire the reset, I think that may be a problem because it seemed to be triggering when it shouldn't in my earlier tests, and simpler is better.
     
  13. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    Regular gates are better of course, but a combination of AND / OR is hard to get on one chip.

    You don't need the diode or resistor on Minutes X1 at all. I like the minutes X10, but if you use my scheme raise the resistor value to 1MΩ. I just noticed I made a mistake on my schematic as to value locations, I'll be fixing it.

    With as many OR gates you have it may be worth adding a quad 4 input OR chip such as a 4071.

    I find this website a handy reference...

    http://users.otenet.gr/~athsam/database.htm
     
    Last edited: Dec 23, 2010
    magnet18 likes this.
  14. nerdegutta

    Moderator

    Dec 15, 2009
    2,515
    785
  15. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    You are welcome.

    Mag, are you planning on driving nixie tubes? You are one of few I've seen that seems to have a clear idea on how to make a clock. Many posters are noobs that have problem understanding counters in general.
     
  16. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    sorry if this is a bit naive, but what OR gates are you referring to exactly?
    I know i have the AND logic on the hours but i wasn't aware of any others.
    Also, this shouldn't make any difference that i know of but each of the pin outputs is going to a transistor to drive one of the pins on a nixie tube, heres a link of the minuets circuit operating. http://www.youtube.com/watch?v=4dmVFIjPuXQ

    (and thanks greatly for the link)
     
    Last edited: Dec 23, 2010
  17. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    Haha, lapse in posting updates :p
    yes, i am making a clock :)
    i spent a few weeks researching and educating myself on the basics of digital circuitry and counters over the summer and have been slowly progressing since.
    you can see from my profile im pretty much self educated, the only things ive learned in school are the basics of what electricity is, even then i had an argument with my teacher over which way current actually flows :)
    lacking actual education im pretty much a noob in some areas you wouldn't think of, i pretty much just fly by intuituion and internet data...
     
  18. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    Diode gates are fundamental, the problem is they are also analog. Look the two schematics I drew on post #11, they are basically the same logic, one using classic logic, the other using diode gates. The drawing you showed on post #12 going into pin 15 of the minutes X10 chip is a diode OR gate. Most logic actually connects to Vcc or ground (high or low), look at what the diode gate does if the input is connect to either Vcc or ground.

    [​IMG]

    The problem comes in when one feeds another. The two resistors become a voltage divider (which is why I say they have analog characteristics). Come to think of it, that was probably your core problem, you had two gates feeding each other with matched resistors.

    Still, they can be dang useful. Mixed with CMOS gates they can make very useful gates.

    I increase the resistance X10 every state of the gate to combat the resistor divider problem. It is an imperfect solution. A transistor buffer that goes to a full 1/0 will reset the resistances, just like a CMOS gate.

    CMOS gates have one characteristic that helps a lot, they use ½ Vcc as a trip point, which means you don't have to be exactly ground or exactly Vcc, the CMOS input cuts you some slack.

    You hang around here long and you will learn. Most of the guys around here like to teach, Sgt. Wookie is probably the only person that beats me in verbosity.

    Have you read this?

    LEDs, 555s, Flashers, and Light Chasers
     
    magnet18 likes this.
  19. magnet18

    Thread Starter Senior Member

    Dec 22, 2010
    1,232
    124
    Ok, i get it, the chip resets on either a pin 5 high OR a master reset high.
    I haven't read that yet, but i will when i get a chance. Ive built a few kits before with 555's but haven't really looked into it in detail yet. This is actually my first project doing more than putting kits together, the seconds counter being the first circuit ive ever really made. Probably a bit big for a first step, but ive gotten this far so i think ill manage :)
     
  20. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    I think you meant pin 15 on that last post. Hope you did at least. :D Pin 5 is an output.

    I'm going to bed, and then Christmas stuff starts. I'll check in now and again, so if I don't come back immediately I haven't forgotten you.

    Merry Christmas!
     
Loading...