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

Up/Down Counter Circuit

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by Mastahh, Nov 20, 2010.

  1. Mastahh

    Mastahh New Member

    Joined:
    Nov 19, 2010
    Messages:
    61
    Likes:
    0
    I want a circuit that will count up from 0 to 9999.
    This circuit will use a dual 7 segment display.
    Also, i want it to count down at any point, for example, if the value is 30, it should go back to 29, then 28 etc.
    I have done some research and know that the 4029 and 4511 will help me achieve this.

    Attached is my circuit so far. It does the basic counting from 0-9 upwards and downwards.
    How can i carry on from this circuit to make it count up and down using a dual 7 segment display, or two individual 7 segment displays?

    Thanks a lot!!!

    =]
     

    Attached Files:

  2. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,178
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    Look at this link, it may suggest a solution.
    http://www.electro-tech-online.com/...asic-3-digit-led-decade-up-down-counter1.html
     
  3. Mastahh

    Mastahh New Member

    Joined:
    Nov 19, 2010
    Messages:
    61
    Likes:
    0
    Thanks for your swift reply.

    My problem is that the program i use, 'Circuit Wizard' does not include the '74' chips used within the link you provided.

    I think that the only chips that will benefit and suit my purpose will be the 4029 or the 4050, combined with the 4511.

    How would i establish the carry out using either of the above chips?

    Thanks!
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,178
    Likes:
    644
    Location:
    Ex Yorks' Hants UK

    hi,
    Do you have the datasheet for the 4029.?
    You would use the /TC to cascade the 4029's, used together with the UP/DN you should be able to count up/down, ensure that /CE is the correct sense.

    Do you follow ok.?

    EDIT:
    Look at page 807 on this pdf
     

    Attached Files:

    Last edited: Nov 20, 2010
  6. Mastahh

    Mastahh New Member

    Joined:
    Nov 19, 2010
    Messages:
    61
    Likes:
    0
    Hey,

    Im sorry but i do not follow what you are trying to say there.

    Do you mind to elaborate, and perhaps use the pins on my attached diagram so it is easier to understand if that it okay??

    Thanks a lot!!
     
  7. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,178
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    Did you read that pdf document I attached to my last post.?? Let me know.?
    On page 807/808 it shows the circuit diagram for the 4029 up/dwn counter.
     
  8. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,178
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    I have done a quick edit of your drawing showing 3 decades, just add a 4th.

    Check this against the pdf I posted...OK

    EDIT:
    Note in the pdf how the up/down direction is selected, the CLK pulse will count up or down depending on the state of the U/D pin.
    So you will have to modify your gate latches a little..
     

    Attached Files:

    Last edited: Nov 20, 2010
  9. Mastahh

    Mastahh New Member

    Joined:
    Nov 19, 2010
    Messages:
    61
    Likes:
    0
    Hey,

    Yeah, thanks i have read it.
    I have created a circuit with two 7 segment displays.

    my problem is that when i press the count up button the first time, both displays show the number 1. Then, when it go to number 9, the 'tens' section comes down to 0. When the 'units' column counts up to 0, then the tens column goes back to 1. It is always stuck between 1 and 0.

    How can i prevent this??

    [The tens is the bottom 7 segment]
     

    Attached Files:

  10. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,178
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    If you relook at pages 807/808, two circuits are shown, one is for a synchronous counter and the other for a ripple thru counter.

    Your circuit is a combination of both.!, I would choose the synchronous version, it uses less gates than the ripple.

    Also in your circuit you are showing a count up and count down clock,,,,, the clock is common to both up and down operations its the UpDn pin that determines the count direction.
    Redraw and post the final circuit
     
  11. Mastahh

    Mastahh New Member

    Joined:
    Nov 19, 2010
    Messages:
    61
    Likes:
    0
    Hey,

    Thank you so much for all your help so far.

    I just have one more problem unfortunately...

    My count down works fine, 000, 999, 998, 997, 996, 995, 994 etc.

    However my count up has a glitch.

    When i first click on the push to make to count up, all of the value go to one.
    So its like 000, 111, 112, 113.

    How would i prevent that so it counts normally.

    Also, the second one counts up at the wrong time.
    So that is like 000, 111, 112, 113... 118, 119, 110, 121, 122, 123... 128, 129, 120, 131, 132 etc

    How would i make this count normally too?

    Thank you so much!!

    =]
     

    Attached Files:

  12. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,178
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    Add these two 10K's , you should not leave CMOS inputs open...
    Rewire the clock and the Up/Dn select as shown here.

    NOTE: if your switches are 'noisy' you may require a simple debounce circuit.

    EDIT:
    You dont need that latch on the clock circuit...!

    I am assuming that the Up/Dn select switch is a latching switch.?? [ ie: single pole changeover]
     

    Attached Files:

    Last edited: Nov 21, 2010
  13. Mastahh

    Mastahh New Member

    Joined:
    Nov 19, 2010
    Messages:
    61
    Likes:
    0
    Hey,

    I have redrawn my circuit according to both your pictures attached.
    However, on the first one, nothing works at all. The 7 Segments stay frozen at value 8.

    On the second one, it can only count down.
    Counting up does not work at all!

    Sorry if you already know this, but to count down, only the clock has to be high.
    However, to count up, both the clock and the UP/DOWN has to be high.

    Maybe that will help.

    Thanks

    =]
     
  14. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,178
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    Been out for a while, I will relook at your diagram.. get back to you.

    hi again,
    In simulation that 1st stage is counting ok , up and down,,,, I will run the 2nd stage to confirm and post again.
     

    Attached Files:

    Last edited: Nov 21, 2010
  15. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,178
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    Ran the 2nd stage all OK.

    Counts up fro 0 to 12 and then back down from 12 to 0

    Can you check your layout and post a corrected circuit, just in case we are not working from the same diagram...:)
     

    Attached Files:

  16. Mastahh

    Mastahh New Member

    Joined:
    Nov 19, 2010
    Messages:
    61
    Likes:
    0
    Hey,

    Attached are the pictures you wanted me to show.

    In the first picture, you can see that the count up switch is pressed but the 7 segment displays show no change.

    In the second picture, all the displays start off at 9, and again, you can see that the count up switch is pressed but to no avail.

    [Also, im just asking here but would there be any difference if i use the 4510 instead of 4029? The reason is because the 4510 has a reset pin, whereas the 4029 does not, and a reset would be useful to me]

    Thanks a lot as always!!!

    =]
     

    Attached Files:

  17. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,178
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    Will look at your diagrams.
    You could use the 4510 with RESET, but the easy way to RESET the 4029 is to set all the parallel inputs to 0V [as you have done] and use the PL pin to load zero into all the 4019's. OK.


    EDIT:
    Which type of switches are you using, are they normally open or normally closed or are they toggle change over switches, its IMPORTANT.

    EDIT2:
    Look at this clip from that datasheet, it will simplify the clocking.
     

    Attached Files:

    Last edited: Nov 21, 2010
  18. Mastahh

    Mastahh New Member

    Joined:
    Nov 19, 2010
    Messages:
    61
    Likes:
    0
    Hey,

    Sorry about this, i have really bad knowledge.
    Which one is the PL pin??
    Also, you said something about a 4019??

    I am using, for the moment, PTMs, but i will improve this circuit using opto-isolators and PTMs with PICs too. This is like the building block for my final circuit.

    This is what i have done to my circuit according to that attachment you provided.

    It does not, unfortunately, help at all.
    The displays all start at 0 but none of them work.

    I think this maybe because i may have connected to Vdd section wrong.

    Please evaluate my circuit.

    Thanks a lot

    =]


    EDIT:
    Sorry, forgot to mention.
    The top PTM should count up and the bottom down.
    I have done it "exactly" like that attachment of yours showed me.
    My concern is Vdd.
     

    Attached Files:

    Last edited: Nov 21, 2010
  19. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,178
    Likes:
    644
    Location:
    Ex Yorks' Hants UK

    hi,
    My typo error 4019 should be 4029, sorry if that caused confusion.

    The PL pin is marked 'LD' on your drawing...

    If PTM means pushed to make switches, then it means you will have to hold the UP/Down select swiitch while you push the clock switch.

    As soon as you let go of the up/down switch the clocking will change direction.!!

    Use the clock method shown in that clip I posted, its simpler.

    One switch clocks up the clocks down

    AAesp07.gif
     
    Last edited: Nov 21, 2010
  20. Mastahh

    Mastahh New Member

    Joined:
    Nov 19, 2010
    Messages:
    61
    Likes:
    0
    Due to the Push to Makes switches, that was why i had so many of those NAND gates. The arrangement i had did indeed work for the basic stuff.

    When i pushed to Count Down switch, it did count down because only the clock was high.
    When i pushed the Count Up switch, both clock and Up/Dn were high.

    Would that help reconsider what you were recently saying??
    Also, i do not understand the inputs into the clock and up/dn is the clip you posted, and the Vdd section.

    Thanks

    =]
     
  21. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,178
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    This is showing the clock circuit from the clip connected to the 4029's.
    It also shows a RESET method.

    Connect your clock up and down switches from the bottom of the 10Ks and 0V.
    So when you push the switch you connect the input pin to 0V.

    Connect the PL [LD] pin to 0V via a 10K and the RESET switch from the 10k to +V, when you press the PMT sw the PL pin will go high and RESET the counters to 0.
     

    Attached Files:

Share This Page