Manual UP/DOWN counter help

Discussion in 'General Electronics Chat' started by Aras, Dec 7, 2014.

  1. Aras

    Thread Starter New Member

    Dec 7, 2014
    10
    0
    Hey guys, i need some help. Im trying to create manual UP/DOWN counter using 74ls48(or 47 ir only for simulation in multisim) BCD to seven segment decoder, 74ls192 counter. I want when im pressing for example S1 switch this system would count up and by toggling S2 switch to count down. I have done the count up mechanism, but i dont know how to set all things up to count down. Im really newbie in this, and any of your help would help me a lot :)
    In the scheme i attached im using 74ls90 decade counter to stop when counter get up to 9 and resets it.
    P.S. sorry for my bad english and esthetic of scheme.
     
  2. Retiredguy

    Member

    Feb 24, 2007
    28
    5
    Aras,
    First of all, from what I understand from your post you wish to do, you do not need the 74LS90 at all in your circuit. The 192 will count up and down using the "UP DOWN" inputs of the chip. Tie your switches to those inputs and if you want to count up use the switch tied to the "UP" input and vice versa. And if you want it to only count to 9, you can set up some logic on the outputs to reset or CLR the chip.
     
  3. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,574
    2,550
    I suggest you download Digital Works and simulate what you want to do, I even think there's an up-down counter circuit already included in the examples. This software helped me a lot in the past to learn basic digital electronics, before getting into MCUs.
     
  4. Aras

    Thread Starter New Member

    Dec 7, 2014
    10
    0
    Thank you Retiredguy :)
     
  5. Aras

    Thread Starter New Member

    Dec 7, 2014
    10
    0
    I will try this, thank you for advise :)
     
  6. Aras

    Thread Starter New Member

    Dec 7, 2014
    10
    0
    I have creater manual UP/DOWN counter, one of them shows 1, other 9, 2 and 8, 4 and 6. And so on. I cant figure out, how to make that one of 7 segment indicator would show me 10 and other 0. "Tower" of AND elements is for indicator to show 1, when other side of indicator shows 0.
    Im attaching picture of sheme.
     
  7. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    You have two basic errors, the one is that you left the input floating, the second is that you don't have a key debounce.

    Google : ttl key debounce
     
  8. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,574
    2,550
    What software did you use for your circuit?
     
  9. Aras

    Thread Starter New Member

    Dec 7, 2014
    10
    0
    Thank you for your comments, ill take a look at what you have said :)
     
  10. Aras

    Thread Starter New Member

    Dec 7, 2014
    10
    0
    NI Multisim
     
  11. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,574
    2,550
    Although Scott's comment is perfectly true, I don't think that's where the issue lies, since I doubt that your software analyzes those conditions in detail. I haven't examined your circuit in detail (I use Digital Works) but I'm sure it has to do with the way you connected the overflow/carry signals cascading the counters. Can you post a list of what happens vs what's supposed to happen every time you presse the push buttons?
     
  12. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,815
    834
    Another error…

    It looks like you have the output of the AND gate on the left, tied directly to Ground!
    [​IMG]
    Never connect the output of a gate to either Vcc or Gnd

    UPDATE: In your latest schematic, I don't see this problem. I was referring to your first post.
     
  13. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,574
    2,550
    Ok... there seems to be a number of issues with your circuit.
    Let's start with basic chip definitions:
    • 7432N: Or gate
    • 74LS192: BCD up-down counter
    • 74LS48: 7 segment decoder
    • 74LS06: Not gate
    • I am assuming that parts U23 and U24 are 2-digit 7 segment LED displays
    Let's begin with this tip: first, erase everything you have on the left, and keep only the side of the circuit leading up to U23. Now, if U3 is a 2-digit 7 segment display, and you need to count from 0 to 99, then you need two 74LS192 chips, and not just one, since each 74LS192 can only count from 0 to 9 before overflowing. The first step is to get rid of the network with all those Or gates and its ending Not gate , and place another 74LS192 connected to the previous 74LS192 in such way that one up-count or down-count will take place if the latter overflows or underflows. Got it?
     
    absf likes this.
  14. Aras

    Thread Starter New Member

    Dec 7, 2014
    10
    0
    Thank you, and one more question. How can i set "Green" 7 segment indicator to show 10(Just like in picture) at the beggining of simulation. I have done the shifting(i dont know how u say, Transfers from younger to an older column. Younger - 9 next 0 and older gets 1)
     
  15. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,574
    2,550
    Digit on the right would be the Least Significant Digit (or LSD) and the one on the left would be the Most Significant Digit (MSD)
    There are two ways of pre-setting your counter so that it would start at 10:
    • The hard way: design a startup circuit that would feed the MSD counter a 1 at its pre-set inuputs... which I think would be too complicated for what you want to accomplish
    • The easy way: add a button that will pulse the MSD counter independently of the LSD one, so that when you start your simulation you can manually set MSD to 1. You will have to run this button through an 0r gate in which its other input would be the LSD counter's overflow signal, and the output of this or gate would go into the up-count input of the MSD counter.
     
  16. MrChips

    Moderator

    Oct 2, 2009
    12,451
    3,370
    7406 has open-collector outputs. Use 7404 inverters instead.
     
    absf likes this.
  17. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,574
    2,550
    Good point ...
     
  18. Aras

    Thread Starter New Member

    Dec 7, 2014
    10
    0
    I figured this out, and it was quite simple, i kinda even laugh from it. U5 counter Output CO contact connected with U2 counter Up and A inputs. BO Output connected with Down Input. And B, C, D inputs to ground.
    And about range of number avalible. I want to make, that minimum number would be 00 and maximum 10. How can i prevent LSD from counting to 11?
    Would be great if you just could tell me how can i search this in google. "Counter number ranges"?
     
  19. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,574
    2,550
    Excelent... what you just did is called cascading the counters. And I'm glad you've got some initiative and are willing to look this up on your own... As to preventing counting beyond 10, here's an idea:
    The 74LS192 has 4 outputs (Q0 to Q3) representing the binary form of the actual counted number, So for the number 1, the outputs would be Q0=1, Q1=0, Q2=0, Q3=0, What I would do, is connect the Q0 output of the MSD counter to one input of an XOR gate, and the other input of the XOR gate to the pushbutton. And finally, I'd connect the output of the XOR gate to the upcount input of your LSD counter... If you follow this logic, with the correct set of gates you'd be able to preset any number limit that you wanted.
     
  20. Aras

    Thread Starter New Member

    Dec 7, 2014
    10
    0
    Thank you, its working.. Kind of... The signal of counter is too long comparing with push button.. When push button comes back to its original possition in this case open, signal of counter is still active and XOR creates double signal.. Instead of 9 (when counting down from 10) im getting 8.
     
Loading...