Sunday, April 10, 2022

CHAPTER 6 - - - The CLOCK !!!

Welcome back

 To understand how this magic all happens, let's take a look at a Block Diagram of a digital Clock.

Let's make it easier:
We already have our one second pulse, so now let's put it to work.

The 1 HZ pulse feeds a BCD Counter that will count 0-9. Then at "10", a pulse will feed the 10's of Seconds counter. Now your display reads 10. It will now count from 10-19. When the display goes from 19-20, a pulse will again trigger the 10's of seconds counter to increase to 2. Now the display reads 20. It will continue to count this way increasing the 10's of seconds digit, once every ten seconds. 

When it reaches "60", the 10's seconds counter will send a pulse to the next section. (It works exactly the same) in order to count the minutes. When the minute section hits 59:59, it will send the hours sections a pulse and re-set.

But wait !!! How do you get these counts to display properly ??

Now that the BCD timer knows what time it is, we need to convert that BCD code into something we can see !!

Anyone who watches The Big Bang Theory knows the world only sees ones and zeros. It is the building block of ANYTHING digital.

So, if it is JUST ones and zeros, it should be simple, right??

Yes, it is simple. IF you use the ones and zeros correctly. Remember, this clock will do whatever YOU tell it. If it doesn't work, you are telling it incorrectly.

Back to work.

The BCD timer chip exports the count as a four digit code.

Each number has a different code.

For example the "0" digit expresses itself as 
0 0 0 0.
The "1" digit is  0 0 0 1.

If you look at the third line, you will see the 0 0 0 0 signifying the digit 0.

Remember the A,B,C,&D lines are the 4 outputs of the BCD Counter chip. On some schematic draw programs the ABCD shows up as Q1,Q2,Q3, & Q4.

The BCD to 7 segment decoder will see the 0 0 0 0 and light up the digits for the number 0.
 So we are going to light up LED 'a,b,c,d,e, and f'. Leaving the 'G' turned OFF.

And when it moves to number 1 (0 0 0 1 in BCD language) it will light up segment b & c.

And that's how we get a count. (0-59)

Now lets take a look at the circuit.


Looks like the block diagram, doesn't it ???? The one second pulse enters the CD4518 on pin 10 and the chips starts counting the seconds . When it goes from 9 to 0, Pin 14 goes high, sending a pulse to pin # 2, causing the 10's to count up by one. Now it will count from 0-99.

But Hoss, we want it to count from 0-59.

OK, let's get it to re-set from :59 to :00.

If you look at the BCD chart, look at the code for "6"

 0 1 1 0

Yep, when the tens digit hits "6" we will see a 'High' on BCD lines "c" and "b".

In our chip that is pins 4 & 5. Using an 'and' gate we can insert those two "highs" and get a pulse at :60 to reset the Counter. (AND feed a pulse to the next section.

But doesn't line 'c' and 'b' also go high on the number 7??

Very true my friend, But the tens digit will never reach 7 since it will reset when it reaches 6. Brilliant, isn't it??

A quick word about AND gates.

One of the easiest multiple-input gates to understand is the AND gate, so-called because the output of this gate will be “high” (1) if and only if all inputs (first input and the second input and . . .) are “high” (1). If any input(s) is “low” (0), the output is guaranteed to be in a “low” state as well.

 The most common AND gates are the 2 input and 3 input. There are AND gates made with more than three inputs, but this is less common than the simple two-input variety. 

A two-input AND gate’s truth table looks like this:

So if you place a 'LOW' on any of the two inputs, you will see a 'LOW" at the output. BUT, if you place a "HIGH" on each input you will see a 'HIGH' on the output.

Remember we said that the number 6 gives you a 'HIGH' on two pins, we feed those 'HIGH's' to the AND gate. We only get a 'HIGH on the output when the digit reaches # 6. We use that "HIGH' to reset the timer to '0' And the process repeats itself.

Let's go ahead and bread board this circuit and play with it.

When you get this up and running, you can build a duplicate circuit as well... This will be for the minutes.

Now comes the hour. This one is a bit 'trickier' than the Seconds and minute because we want it to go from 12 to 1 NOT 12 to 00.

I found many circuits on line but they would only go from 12 to 0. That's fine for a 12 hour TIMER but not for a clock. Designing the 24 hour clock was easier.

Let's take a look at that schematic for the hours section.

As with the MOD 60 Counter, the input pulse (count) come into Pin 10 (4518), and the unit starts to count. When it reaches '0', PIN 14 goes High and sends a pulse to Pin 7 That causes the Tens of second digit to increase by 1 and the cycle continues. When the count reaches 24, the AND Gate goes into action. Pin 8 and 9 of the AND Gate goes High thus causing a High to appear at Pin 10. That pin sends a re-set pulse to Pins 7 and 15 causing the hours digits to RESET to '00' And the cycle starts over.

Now comes the hard part. Getting a 12 hour clock to work.

(Spoiler Alert) I will tell you at the end how to accomplish this the EASY way. But I wanted you to understand the circuit.

Since I could not find a circuit that worked, I studied up on how these chips function. As we learned earlier, each number has its own unique code 0,0,0,0 for the number zero. 0,0,0,1 for the number 1. 

Resetting our clock to :00 is easy, but we need to build on that and get that :00 to move to :01.

So let's get a 12 hour circuit that resets to :00


(Pull down resistors omitted for clarity.)

In order to reset from '12' to '00' we need to see a '1' in the tens place and '2' in the sec place.

Looking at our chart, we see that when it displays a '1' pin 6 on the tens unit goes high.

SO WE HAVE A '1'

Now we see that when a '13' is displayed PINS 11 & 12 goes HIGH.

WE NOW HAVE OUR '2'.

SO let's feed the 11 & 12 pins into an AND gate.


The output of that gate goes to an input on another gate.


The other input of that gate is connected to PIN 6 on the tens unit.

So when the unit displays a '3', we get a High on the output of the AND gate. Feeding that into another AND gate along with the HIGH from Pin 6, we get a HIGH on the output of the second AND gate. We can use that HIGH to reset BOTH counters to '00'.


So we reset the unit to '00', we can work with that.

We can feed  each digit into to 4 input AND GATE.



In order to go from '0' to '1' we need to see ZERO on both displays. Feed each of the 4 lines into a NAND gate (U-6A and U-6B) and we get 2 high's out.

 We then feed each of the HIGH's into another AND gate (U5D) to get a HIGH out.

Since we need a PULSE (rising and lowering) this HIGH will NOT work to count the hour digit.


BUT


If we take that HIGH and feed it to another AND gate (U-5B), we can just use the 1 or 2 HZ pulses to feed the other input of that AND gate. This will give us a PULSE that we can use.

That output will be sent to the count pin (Pin 10 of the 4518) We then go from 00 to 01.

But I don't want to see the zeroes.

You won't for very long because of the speed at which these chips work. The '00' shows up only long enough for the Gates to do their magic and increase the count. When that happens the '00' disappears. Using the One HZ counter on that AND Gate means the '00' may show up for ONE SECOND. If you use a TWO HZ pulse the '00' may show for as long a 1/2 sec.

But remember, this only happens 2 times a day for maybe a second or two. I think it's a fair trade off. Don't you?, Course you do.


Now the SURPRISE: Check out this diagram.

(This is not a complete diagram)

In this case the clock pulse comes in to pin 15, (not 10). and, this chip is DIFFERENT. The 4510 does the same job as the 4518 EXCEPT you can get it to always go to the number '1'. (Thus avoiding MORE IC's.)

I tried this one out, and it works !!!!!!!! So, we can use 2 of the 4510's in our hour circuit.


That's all the time we have for today. We now have a working schematic for a nice 24 or 12 hour clock.

But Hoss, how do we set the timer ????

We need a control panel. And we will get to that soon. 

Next time we will finish up the proto types and discuss building the clock and getting it running.

See you then.


YOU CAN NOW MOVE ONTO CHAPTER 7 - - - BUILD THE CLOCK


God Speed, Mother Nature.


.

.
.
.

The information presented here in this web site is for personal use only and may not be
 used commercially
We make no claim as to the accuracy of the information with-in. 

        

    







No comments:

Post a Comment

ANALOG VU METER BOARD

Let's talk about the Analog VU Meter Bridge. I decided to make the Meter Bridge separate from the mixer, because of limited space inside...