Counting 0-9 and vice versa

Thread Starter

toeykq

Joined Apr 17, 2014
10
I've been stuck on this and don't know what to do.


I'm trying to make a counter chip (74193) cycle either up or down from 0 - 9, showing the output with a 7 segment display.


This counter chip has 4 outputs, so it will count from 0 -15.
When counting up, I can make it work properly. When it gets to 10 AKA 1010, I have it set up so that the outputs go into an AND gate, and the output of the AND gate goes into the clear pin on the counter.


So when it gets to 9, the counter clears back to zero.


However, counting down, I can't make it work properly, I know I'm supposed to use the "load" pin, but I don't know in what manner. I took the number 15 AKA 1111 and AND'd those together and ran the output to the load pin, but it doesn't work.


Can anyone please help me with this?
 

Thread Starter

toeykq

Joined Apr 17, 2014
10
All I have is 74193.
This is a school project and that is what they gave us to work with, so it should be possible.

I can make it count up and cycle back to 0 properly, I just don't know how to make it count down and load 9.
 

Thread Starter

toeykq

Joined Apr 17, 2014
10
I don't have a diagram, but I'll try to explain what I did.

In the case of counting down (doesn't work) -

Pins 2, 3, 6, and 7 (outputs A, B, C, D) are running to a 7-segment driver's corresponding inputs.

Pin 4 (count-down) is connected to the clock.
Pin 5 (count-up) is high.

Pin 14 (clear) is low.
Pin 11 (load) is the recipient of some logic.

In this case, I took the binary number for 15 (1111), and used all 4 bits A, B, C, D, AND'd them all together, and ran the output of the AND function into the load pin.

My thinking was that, when the counter is counting down and reaches 0 and then 15, it will load back to 9.
Unfortunately this doesn't work.



In the case of counting up (works) -

The output pins are still running to the 7-segment driver.

Pin 4 (count-down) is high
Pin 5 (count-up) is connected to the clock.

Pin 11 (load) is high.
Pin 14 (clear) is the recipient of some logic.

In this case, I took the binary number for 10, (1010), and used the bits D and B (1 and 1), AND'd them, and connected that output to the clear pin.

So when the counter gets to 10, the AND function becomes true, and the clear function is enabled and the 7-segment display starts back at 0.
 

ericgibbs

Joined Jan 29, 2010
18,766
OK,
When you detect '10' on the UP count , use the detect '10' [A] circuit output to Parallel load '9' into the 74193.

Connect the Parallel input pins for 1001 ie '9', so when the UP count reaches 9>10 it will reload '9' and not count any higher.

Is this what you are asking.
 

Thread Starter

toeykq

Joined Apr 17, 2014
10
OK,
When you detect '10' on the UP count , use the detect '10' [A] circuit output to Parallel load '9' into the 74193.

Connect the Parallel input pins for 1001 ie '9', so when the UP count reaches 9>10 it will reload '9' and not count any higher.

Is this what you are asking.
Oh wow.

I had nothing connected to the input pins.
For some reason I was assuming that the chip was just going to magically know that I wanted it to load 9.

I wasn't telling it which number to load.

It works now, thank you.
 

ericgibbs

Joined Jan 29, 2010
18,766
Pleased to hear its now working.

I would advise that you always create a drawing of the circuit, a simple sketch will help us to help you.:)

E
 
Last edited:

AnalogKid

Joined Aug 1, 2013
10,986
First of all, is this a good summary of your requirements:

In counting up, when the counter reaches 9 and then increments from 9 to 10 (A), you want to detect this, reset the counter to zero, and then have it continue to count up, emulating a 7490.

In counting down, when the counter reaches 0 and then decrements from 0 to 15 (F), you want to load a 9 and then have it continue to count down to 8, 7, 6...

If that is it, then just like you have an AND gate detecting 10 to force a reset to 0, you need an OR gate to detect 0 and force a load of 9. Now that you have two state detectors on the same outputs, you will need to enable them. Fortunately for you, this ship has Terminal Count outputs. You can't use the TCU because it detects a 15 and you want to terminate your upcounting at 9. But TCD is right there for you, detecting zero and gating it with the down clock. Connect that to the parallel load input and see if it works for you.

If that doesn't work because the load function is asynchrnous, then use an AND gate to detect 15 when the counter rolls uncer, and it's output drives the load pin.

ak
 
Top