1. 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.
    Dismiss Notice

problem with counter up and down circuit

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by klknight93, Dec 29, 2017.

  1. klknight93

    klknight93 New Member

    Joined:
    Dec 29, 2017
    Messages:
    9
    Likes:
    0
    the problem of my circuit is jumping counts. I checked several times already . The stimulation is good . It will start as 0 and increase digit 1 by 1 . it has same result as down counter which is decreasing 1 by 1. However, it is totally different when coming to pcb board and breadboard. After i done the circuit, i tried at breadboard and found out there are few problems occurred . First, it will start with 999 after power supply is connected. Come to the counter up and down , it will keep jumping . I tried switch debouncer too and it is the same result. Currently , i am still check the problem and found out Q0 from 74ls192 will keep on no matter button for up or down. Below there shows the general design and detailed image for connections from proteus . This design on pcb already cost me for 2 weeks and still cant get the solution.


    upload_2017-12-30_12-49-54.png

    upload_2017-12-30_12-51-7.png
     

    Attached Files:

  2. Musicmanager

    Musicmanager Active Member

    Joined:
    Dec 4, 2014
    Messages:
    651
    Likes:
    57
    Location:
    Birmingham, UK
    Hi KLK

    Welcome to ETO .. .. .. ..

    I am a long way from being any kind of expert, however I do recognise that circuit as very similar to one I built a while ago. I think your problem may be the 'floating' pins on U1, U2 & U3 .. .. .. .. I think D0 - D3 on each chip should be grounded.

    If I'm wrong, someone with a better understanding will leap in and correct me, for sure ..

    S

     
  3. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,715
    Likes:
    421
    Location:
    Brisbane Australia
    If you're not using the parallel load then I don't think the value on D0-D3 matters. However, it is good practice to ground unused inputs.

    I suspect your problem is with contact bounce. I've never seen a switch arrangement where the button discharges a capacitor. Try changing to a more conventional debounce circuit.

    Mike.
     
    • Thanks Thanks x 1
  4. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10


     
  5. klknight93

    klknight93 New Member

    Joined:
    Dec 29, 2017
    Messages:
    9
    Likes:
    0
    i will try to use this switch circuit.
    upload_2017-12-30_16-21-8.png
     
  6. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,917
    Likes:
    985
    Location:
    Canada, of course!
    ONLINE
    Old fashioned TTL ICs needed a supply bypass capacitor at each IC.
    Your new circuit has its diodes connected to numbers instead of some circuitry. There is no debouncing.
     
  7. Colin

    Colin Active Member

    Joined:
    Sep 25, 2003
    Messages:
    494
    Likes:
    29
    Location:
    Australia
    All this can be done with one microcontroller and you can add debounce and all sorts of other things without having to add a single new component.
    I have not used chips for 20 years. They are all in the rubbish bin.
     
  8. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10


     
  9. Musicmanager

    Musicmanager Active Member

    Joined:
    Dec 4, 2014
    Messages:
    651
    Likes:
    57
    Location:
    Birmingham, UK
    Explains your sprightly figure then Colin, how about the fish ? :)

    S
     
  10. AnalogKid

    AnalogKid Well-Known Member

    Joined:
    Sep 22, 2011
    Messages:
    1,374
    Likes:
    191
    Location:
    Ohio - GMT-5
    ONLINE
    Having a switch discharge directly a debouncing capacitor is common. You could stick with it, but the circuit has other problems.

    Yes, ground the unused data inputs. Even though they are not used internally, they still have active input stages that do *not* like to float.

    Bounce: In the original circuit, the debounce R and C are too small. The debounce period is only about 700 microseconds. Increasing both the R and C values should fix this. BUT -

    These counters act on a positive edge, which is the trailing (slow) edge of your inputs. You need to reverse the input components so there is a positive edge when the button is pressed, not when it is released. BUT - you are using TTL chips, which require a fairly low impedance path to GND to be seen as a logic low. Try this:

    Connect the switch between the count input and Vcc. Connect both the resistor and capacitor to GND. The switch now will make a rapid rising edge to the count input, what it wants to see, and the capacitor will filter out the bounce. The resistor must be small, like 1K for LSTTL and 470 ohms for standard TTL (330 preferred). And the transition level is around 1.8 V, significantly below Vcc/2. These combine to make the debounce capacitor much larger. Start with R=1K and C=100uF for a debounce period of around 50 milliseconds.

    This also will have the capacitors hold the count inputs low during power-up, which will help with the 999 problem.

    999: The counter increments on a positive-going edge. When power is applied, R5 and R6 apply count edges to both the up and down inputs *after* the power-on reset input has ended. It looks like the down count is coming in last. Increase C3 to 10 uF and increase R1 to 100 K.

    I think the real solution to the 999 problem is reversing the input logic polarity explained above. If everything works, try decreasing C3 to 1 uF and then 100 nF and see if everything still works.

    ak
     
    Last edited: Dec 31, 2017
    • Thanks Thanks x 1
  11. AnalogKid

    AnalogKid Well-Known Member

    Joined:
    Sep 22, 2011
    Messages:
    1,374
    Likes:
    191
    Location:
    Ohio - GMT-5
    ONLINE
    Colin, your response does nothing to help the OP learn about his circuit.
    After only a few *months* of learning how to deal with a PIC, the biggest PITA in the uC world. I assume you are going to pay for the OP's PIC development kit...
    That explains sooooooooooooooooo much.

    ak
     
  12. Musicmanager

    Musicmanager Active Member

    Joined:
    Dec 4, 2014
    Messages:
    651
    Likes:
    57
    Location:
    Birmingham, UK
    Hi AK, and Thanks .. .. .. .

    Not my thread, but I was interested to learn from the solution to the problem.

    The only issue I could see was the floating inputs but I wasn't sure whether that was an issue or not. Your outline however, makes a lot more sense to me .. .. .

    I should apologise for my sarcasm to Colin .. .. .

    Thanks again

    S
     
  13. JimB

    JimB Super Moderator Most Helpful Member

    Joined:
    Sep 11, 2004
    Messages:
    6,699
    Likes:
    650
    Location:
    Peterhead, Scotland
    ONLINE
    Steady on there Mr Music old chap!
    Don't go getting all huggy and fluffy on us.
    Colin is a big boy, I am sure that he can take it, as well as give it out!

    HNY to all.

    JimB
     
  14. AnalogKid

    AnalogKid Well-Known Member

    Joined:
    Sep 22, 2011
    Messages:
    1,374
    Likes:
    191
    Location:
    Ohio - GMT-5
    ONLINE
    Don't. His record of unhelpful "advice" is legend on this and other fora. In my first month after joining here, his response to three different people in three different threads basically was you're too stupid to understand my answer, come back in 20 years after you've learned something, get out of electronics before you kill someone, everything you're doing is wrong - use PIC, etc. I used to tiptoe around him until I read the way more experienced members (including a moderator) respond to him. He's not stupid nor inexperienced, but in my direct experience the odds of him giving useful advice appropriate for the experience level of the OP is around 5%. Colin thinks I'm an idiot, but he thinks everyone is an idiot. That actually is a clue.

    ak
     
  15. Ian Rogers

    Ian Rogers User Extraordinaire Forum Supporter Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,802
    Likes:
    958
    Location:
    Rochdale UK
    ONLINE
    Agreed! Interesting that combinational logic, counters and shift registers are still lessons on his site.

    Anyhow!!! Lets not fail the OP and get back on topic...
     
  16. Musicmanager

    Musicmanager Active Member

    Joined:
    Dec 4, 2014
    Messages:
    651
    Likes:
    57
    Location:
    Birmingham, UK

    Yes, absolutely .. ..
    I'm sorry, I didn't mean to hijack the thread .. .. .. .
    I'm quite sure the help the OP needs is available to him now, Thanks to AK .. .. .. .

    S
     
  17. AnalogKid

    AnalogKid Well-Known Member

    Joined:
    Sep 22, 2011
    Messages:
    1,374
    Likes:
    191
    Location:
    Ohio - GMT-5
    ONLINE
    i i i e ?
     
  18. Musicmanager

    Musicmanager Active Member

    Joined:
    Dec 4, 2014
    Messages:
    651
    Likes:
    57
    Location:
    Birmingham, UK

    LOL .. No, nothing so complicated.
    Just an old habit of mine related to the writing of too many school reports and a dysfunctional OCR system !

    .. .. .. . and whilst I'm writing ..

    HAPPY NEW YEAR EVERYONE :)

    s
     
  19. Ian Rogers

    Ian Rogers User Extraordinaire Forum Supporter Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,802
    Likes:
    958
    Location:
    Rochdale UK
    ONLINE
    Yeah.... Happy new year!!!
     
  20. klknight93

    klknight93 New Member

    Joined:
    Dec 29, 2017
    Messages:
    9
    Likes:
    0
    guys , i tried to use my circuit just shown above , now left bit more then success , i will post a complete circuit after i done . thanks for giving such many info and i really try them .
     
  21. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,715
    Likes:
    421
    Location:
    Brisbane Australia
    Does that mean it worked?

    Mike.
     
  22. klknight93

    klknight93 New Member

    Joined:
    Dec 29, 2017
    Messages:
    9
    Likes:
    0
    yesterday it worked( by using and gate, my counters can be increased 1 by 1 from 0 to 9 but another function cant , u just can succeed either up or down) , but now it is spoiled again T_T . no idea which part making wrong again .
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice