Inputting a 4-bit binary # to a counter

Discussion in 'General Electronics Chat' started by antseezee, Mar 14, 2007.

  1. antseezee

    Thread Starter Active Member

    Sep 16, 2006
    45
    0
    I'm going to keep things fairly simple. If I wanted to start the count at 0000 on a 4-bit Synchronous counter, and the counter was correctly set to count up based off the data sheet parameters, would I just ground all 4 inputs to represent lows (0000)?

    Same thing if I wanted to count down. If I wanted to start at 15 (1111), would I just set all 4 inputs high (1111), and set the counter to count down?

    I'm pretty sure I don't want to use the LOAD function since that just puts the # at the inputs directly at the output without counting.

    I'm asking this because I just finished designing and building a 4-bit Counting Digital-to-Analog Converter for a lab. It works fine in Pspice with a beautiful "step cycle" graph. But in Pspice, you hit a "Digital Setup" box and must label the inputs - all 0, all 1, or all X (unknown). It's been 2 years since I've actually done something like this in lab - so I want to make sure I'm doing it right physically. Thanks.
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    If there is no reset pin(be nice to know what counter you're going to use), then the only way to set the internals of the counter to a known state is by the parallel load function. Have the inputs at the necessary level before enabling PE, or whatever the function pin is named.

    Shorting the outputs to ground will not change the state of the internal logic. If the oututs are short-circuit protected it may do no harm, but it could destroy the ic.

    As a reminder, the inputs to the ic (actually, any logic chip) have to be pulled up to tied to ground if they are unused. Old TTL has to be pulled up through a resistance - about 4.7K per pin. Any CMOS chip can have its inputs tied driectly to Vcc.
     
  3. antseezee

    Thread Starter Active Member

    Sep 16, 2006
    45
    0
    Maybe I made the question too complicated (or maybe not, heh).

    Here's a picture of the schematic:
    [​IMG]

    I'm using the 74LS193 4-Bit Synchronous Counter. I have it setup to count up with a clock set at 10 kHz.

    What do I do with the inputs? Do I set them to lows (to represent a 0000)? Do I set them to highs (to represent 0000)? I'm just trying to figure out how I could get the counter to start at 0000.

    There is a CLEAR function on it. Should I just clear the chip once by tapping a high on it, then do what with the inputs? Do I leave the inputs open? Usually for counters you input something into the A,B,C,D pins. In Pspice, you do it from a Digital Setup window, but I'm just trying to figure out what I'd do physically in the lab. Hope this clears it up a bit. Thanks.
     
  4. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    The LS193 has a clear input on pin 12 - just use that. The chip will be happier if you tie the parallel inputs all low. Don't forget to tie the load pin (11) high. Since it's LS, use a 10K resistor.
     
  5. antseezee

    Thread Starter Active Member

    Sep 16, 2006
    45
    0
    Thanks, appreciate it, will do in the lab! One last question - What if I want to count down? Should I let the chip count up till 15, then just switch the connections to count down? I probably wouldn't want to clear it since that would erase the contents in the counter.
     
  6. Gorgon

    Senior Member

    Aug 14, 2005
    113
    0
    The up and down clock inputs work exactly the same. Keep the other high and clock the input. The up clock will increase and the down clock wil decrease the count. If you take a look in the datasheet you'll see the relationship between the different inputs, in the 'mode select table'.

    TOK ;)
     
Loading...