Author Topic: Allegedly a TTL clock (build log)  (Read 3061 times)

0 Members and 1 Guest are viewing this topic.

Offline harnonTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: au
  • Is this thing on?
    • My Personal Website
Allegedly a TTL clock (build log)
« on: March 11, 2019, 01:17:54 pm »
Hi all,
I'm building a TTL clock as a gift. The basic idea is to have LEDs to represent the "hands" of the clock. One set of LEDs will show 5 minute intervals and another the hours. Aesthetics is quite important so I'm putting a lot of thought into that as well.

At this stage I'm trying to get the circuit right and would appreciate any feedback as this old school TTL stuff is fun, but a bit overwhelming for a newbie - lots of traps for young players.

The basic idea is to divide down a 32768 Hz oscillator to count out 5 minute and one hour intervals using using 74HC4040 and 74HC161 chips. Later I have 74HC238s in 3-to-8 configuration to drive the LEDs (via transistors which are on one external boards connected via J1 to J12). There are debounced momentary switches to skip forward 1 hour or 5 minutes per press.

Lots of questions, sorry...

1) I don't even know what I'm doing with the crystal, is this even a circuit? I copied the circuit from another TTL clock design I saw, but is there anywhere that explains how to properly wire one of these up?
2) I was thinking replacing some logic gates with diode logic gates (for aesthetic reasons) are there any advantages/disadvantages vs the TTL chips?
3) I was thinking battery powered, but read in a few places that these TTL chips can be quite power hungry. I'll check when I breadboard, but is this kind of thing likely to require a wall wart?
4) Do I need diodes before the momentary switches, i.e. to prevent current flowing back into U6A / U1E from SW1 when it is pressed?

The next step for me once I'm happy with the schematic is to buy some components and bread board it up. Thanks!
« Last Edit: April 25, 2019, 01:16:45 am by harnon »
 

Offline mc6800

  • Contributor
  • Posts: 11
  • Country: gb
Re: Allegedly a TTL clock (any feedback?)
« Reply #1 on: March 12, 2019, 10:16:18 am »
I'm not convinced that the clock will oscillate.  :-\

AIUI, the idea with CMOS oscillators is that you bias an inverter into its "linear" region with a feedback element such as  a resistor. The crystal + capacitors then "nudges" the circuit to oscillate at the desired clock frequency. At one point Intel had an excellent App note explaining this, but as I can't locate it, here is one from Maxim:

https://www.maximintegrated.com/en/app-notes/index.mvp/id/2154

1) It looks like the feedback from the output pin is missing.

<pedant on> 74HC isn't TTL, it is CMOS. TTL is plain old 74/74LS etc. 74HCT is also CMOS, but with I/O levels better suited to interfacing with "old" TTL<pedant off>

2) Diode gates work, but require one diode per input, plus one resistor. You need to choose a suitable output resistor for the speed of input/output, based on the capacitive loading of the output. You also lose 0.3-0.6V of noise immunity. For example say the input to a diode "or" is 2.9V, the output might only pull up to 2.3-2.6V (as the diode will have a voltage loss) - meaning that the next input is more prone to responding to "glitches".  Given that you can get single gates in ICs these days, I'm not sure if diode gates are as useful as once they were.

3) TTL is relatively power hungry (although 74LS is less so than 74 for example), CMOS isn't (except at high speeds - 32KHz isn't). The power hungry items are the displays. For example, I have a fancy wall clock with 12 x 7-segment displays for time etc. It draws about 20mA with no display, and 120mA when the displays are lit

If you haven't already, I would suggest reading a copy of "The Art of Electronics".
« Last Edit: March 12, 2019, 10:27:26 am by mc6800 »
 

Offline mc6800

  • Contributor
  • Posts: 11
  • Country: gb
Re: Allegedly a TTL clock (any feedback?)
« Reply #2 on: March 12, 2019, 10:46:26 am »
Found a link to the Intel App note on oscillators (155):

https://www.eevblog.com/forum/beginners/microcontroller-oscillator/
 

Offline harnonTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: au
  • Is this thing on?
    • My Personal Website
Re: Allegedly a TTL clock (any feedback?)
« Reply #3 on: March 12, 2019, 11:27:57 am »
Hey thanks for the reply. Funnily enough I have a copy of the Art of Electronics about 30cm from my hand. Just didn't think to look up something in a book :palm: I'll read through those app notes. Also, I did say "allegedly" a TTL clock so I think I'm covered CMOS wise :)

I'd be using the diode gates purely for the aesthetics of a bunch of them lined up in rows but as I'm planning a pretty weirdly routed board, noise immunity might be a thing. The whole clock is going to be mounted on a 300 year old oak base so I don't want to waste the timber with a shoddy looking PCB!

My display will literally be 3 LEDs at a time so hopefully power consumption will be ok. I guess I'll breadboard it and see before I commit to a power supply. Debugging it is going to be interesting as I only have a multimeter lol. Might have to re-purpose an Arduino Due to record the signals.

 

Offline klunkerbus

  • Supporter
  • ****
  • Posts: 162
  • Country: us
  • Electrical Engineer (retired early)
Re: Allegedly a TTL clock (any feedback?)
« Reply #4 on: March 12, 2019, 11:33:47 am »
I only glanced at the schematic, but I happened to notice that the output of the spare AND gate at U2B is tied to ground.  There shouldn't be any connection made to that spare output. With all the inputs tied high, that gate will be attempting to drive the output high. 
 

Offline harnonTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: au
  • Is this thing on?
    • My Personal Website
Re: Allegedly a TTL clock (any feedback?)
« Reply #5 on: March 12, 2019, 12:06:10 pm »
Oh yeah, good spotting. Thanks!
 

Offline harnonTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: au
  • Is this thing on?
    • My Personal Website
Re: Allegedly a TTL clock (any feedback?)
« Reply #6 on: March 14, 2019, 08:06:27 am »
I've ordered parts to breadboard the circuit up... (plus an extra breadboard :o). Let's see how this goes
 

Offline harnonTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: au
  • Is this thing on?
    • My Personal Website
Re: Allegedly a TTL clock (any feedback?)
« Reply #7 on: April 22, 2019, 08:05:46 am »
Well I've made a fair bit of progress on this clock, although a lot slower than I'd have liked!

I now have the minutes "hands" "working" on my breadboard, although I have some issue when running it with a fast clock for testing purposes. After about 2s (the equivalent of 1-2 hours in real time) the outputs lock up and don't change anymore, even though I can see the input clock is still running. I'm currently troubleshooting this bit before I wire up the hours LEDs. I'm now using UDN2981As to drive the outputs courtesy of digsys' garage Grand Sale.

In getting this far I've released magic smoke from a breadboard power supply, bricked an FPGA dev board (overwrote the flash config while trying to set it up as a clock signal, hopefully I can fix it later), worked out the current mode on my multimeter always measures 0.000, finally got around to building an ATX-based PSU, and built my own four channel logic analyser (see attached picture for the schematic). This custom logic analyser was in response to a $6 Salae clone being an absolute PITA, crashing, locking up, and at times giving obviously incorrect outputs.

I've just started a 3-4 hour test tonight to see how good the time keeping is and whether it locks up if I run the clock at 32kHz.
 

Offline harnonTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: au
  • Is this thing on?
    • My Personal Website
Re: Allegedly a TTL clock (build log)
« Reply #8 on: April 25, 2019, 01:27:29 am »
I've changed the title because this is now a build log!

I finished bread boarding and it all works as expected. I still need to test a few more circuit components such as the 123 monostable I'm using to debounce the buttons and the oscillator circuitry. Meanwhile I've finished routing the PCBs which were a real challenge due to the 24 LED lines.

I've also planned the final layout. My Dad is very keen on furniture making and is going to help build up the backing for the clock. We are looking at a couple of lengths of 300 year old French Oak. I'm also thinking about some brass inlay but not sure yet if that will make it into the final design.

 

Online David Hess

  • Super Contributor
  • ***
  • Posts: 17428
  • Country: us
  • DavidH
Re: Allegedly a TTL clock (build log)
« Reply #9 on: April 25, 2019, 09:57:44 pm »
1) I don't even know what I'm doing with the crystal, is this even a circuit? I copied the circuit from another TTL clock design I saw, but is there anywhere that explains how to properly wire one of these up?

It is missing the connection from the gate output to the two resistors.  32kHz crystals have special drive requirements which may not be suitable for TTL.

Quote
2) I was thinking replacing some logic gates with diode logic gates (for aesthetic reasons) are there any advantages/disadvantages vs the TTL chips?

TTL would usually use wired-or logic with multiple open collector outputs tied together instead of diodes.

Quote
I was thinking battery powered, but read in a few places that these TTL chips can be quite power hungry. I'll check when I breadboard, but is this kind of thing likely to require a wall wart?

LEDs draw a lot of power also so forget battery power if you use them.

If I wanted to make a cool clock and limit the power, I would use injection logic using discrete transistors.
 

Offline Cliff Matthews

  • Supporter
  • ****
  • Posts: 1911
  • Country: ca
    • General Repair and Support
Re: Allegedly a TTL clock (build log)
« Reply #10 on: April 26, 2019, 12:16:53 am »
I'd add granularity with a 9-bit R2R off U7 and a LM3914 in dot-mode. Adjust input trimmer so the dot moves each ~36 sec (some may protest, but IMO it's permissible to toss-in another vintage era chip).
« Last Edit: April 26, 2019, 12:31:31 am by Cliff Matthews »
 

Offline harnonTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: au
  • Is this thing on?
    • My Personal Website
Re: Allegedly a TTL clock (build log)
« Reply #11 on: April 26, 2019, 01:35:57 am »
Thanks for the replies! The schematic in the first post is a bit out of date, I haven't uploaded a new one yet.

It is missing the connection from the gate output to the two resistors.  32kHz crystals have special drive requirements which may not be suitable for TTL.

Yes, I'm still a bit nervous about the clock signal and its one of the things I need to test. The circuit changed a little from the schematic above following the earlier feedback. As a fallback I'm thinking about just throwing on an RTC with a 32kHz output pin (i.e. DS3231?) if things don't go well, although I haven't read any datasheets yet so I don't know how workable this is. I've seen another post on here talking about PCB considerations so it might need some adjustments to the PCB if I go this route.

battery power / diodes

I've given up on the idea of running from battery but my feeling is (as I'm not using particularly high power LEDs) that the 74HCs will draw far more current than the LEDs. I can't do any current measurements at the minute due to a faulty multimeter - I'm waiting on a new one to ship. Similarly I decided not to use diodes and most of these type logic gates I'm using 74HC chips. I did breadboard up some diode AND gates but found it wasn't very reliable.

If I wanted to make a cool clock and limit the power, I would use injection logic using discrete transistors.

I'd try some granularity with R2R and a LM3914 in dot mode (some may protest, but IMO it's OK to add-in another vintage chip)

Interesting ideas and some new things to read up on :) I'm fairly set on the TTL approach for this project but I'll definitely add these to the list of things to try in future projects :)
 

Online David Hess

  • Super Contributor
  • ***
  • Posts: 17428
  • Country: us
  • DavidH
Re: Allegedly a TTL clock (build log)
« Reply #12 on: April 26, 2019, 03:33:53 am »
It is missing the connection from the gate output to the two resistors.  32kHz crystals have special drive requirements which may not be suitable for TTL.

Yes, I'm still a bit nervous about the clock signal and its one of the things I need to test. The circuit changed a little from the schematic above following the earlier feedback. As a fallback I'm thinking about just throwing on an RTC with a 32kHz output pin (i.e. DS3231?) if things don't go well, although I haven't read any datasheets yet so I don't know how workable this is. I've seen another post on here talking about PCB considerations so it might need some adjustments to the PCB if I go this route.

74L (low power) gates were commonly used for crystal oscillators but 32 kHz is a different matter.  A single transistor oscillator is feasible.  HC logic can be used although HCU (unbuffered) may be necessary or more reliable.  32 kHz crystals are kind of weird.

Quote
I've given up on the idea of running from battery but my feeling is (as I'm not using particularly high power LEDs) that the 74HCs will draw far more current than the LEDs.

HC (HCMOS) will draw very little power because of the low operating frequencies involved.  HCMOS or CMOS would be suitable for a battery powered design.

Note that HCMOS (HC) does not have TTL compatible inputs.  There is a variation with asymmetrical gate voltages called HCT or HCMOS TTL compatible.  It is only required when interfacing to TTL levels but otherwise performs identically to HC.


 

Offline harnonTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: au
  • Is this thing on?
    • My Personal Website
Re: Allegedly a TTL clock (build log)
« Reply #13 on: April 27, 2019, 02:02:14 am »
Thanks again. Yeah I got corrected earlier on re HC not being TTL, hence why its "allegedly" a TTL clock  ;D I'm learning (slowly).

Here is an early layout of the timber base that my Dad is building up for me. (EDIT: Its upside down)

 

Offline Sapper

  • Newbie
  • Posts: 4
  • Country: gb
Re: Allegedly a TTL clock (build log)
« Reply #14 on: April 27, 2019, 08:17:14 am »
Maybe I'm missing something or my observation has been rectified in the latest schematic but on the second 4040 producing the 5min output the text states bits 2,3,5 & 8 but the schematic shows Q1,Q2,Q5 & Q8 outputs going to the 74LS21 and gate. To me this lloks like you are feeding bits 1 & 2 rather than 2 & 3.
 

Offline harnonTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: au
  • Is this thing on?
    • My Personal Website
Re: Allegedly a TTL clock (build log)
« Reply #15 on: April 27, 2019, 09:36:45 am »
Oh wow I think you might be right. I must have looked at that 20 times and not noticed.
 

Offline harnonTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: au
  • Is this thing on?
    • My Personal Website
Re: Allegedly a TTL clock (build log)
« Reply #16 on: May 06, 2019, 01:10:32 pm »
I finished the breadboarding about a week ago and the oscillator circuit and debouncing worked fine. I was using a 74HC123 to debounce but in the end I found a relatively large capacitor to ground did just as good a job.

I managed to steal a DMM to measure current from work (my old DMM only ever measures 0 current), and the breadboard circuit uses about 23mA - much lower than I'd thought but in line with what Mr. Hess said previously :)

I ordered the PCBs and received them today. There is a large main board and twelve "digits" of the clock dial. I reflowed a test digit and it worked absolutely perfectly. The LEDs are quite visible even under the lights. They're going to be facing towards the timber back so I got Mrs Harnon to hold our daughter's toy hammer for the right ambience. This is the "hour hand" lit up.

I then tried reflowing the main board. There were some immediate issues. I've reflowed boards up to about 5x10cm just using a cheap $30 electrical skillet. So far I've done it by feel but I also happened to get a new :-DMM in the mail today which has temperature measurement. The larger board really struggled to get up to temperature and reflowed inconsistently. Some parts were not reflowed while others on the edge were reflowed. Looking at it a bit closer showed that the centre of the board wasn't touching the skillet. I haven't had a whole lot of luck using sand on the skillet in the past but I gave it a go. Unfortunately the board (after a long period of time) only got up to 220C. If I had a hot air rework gun I think it would only take a gentle wave, but unfortunately I don't.

When I took the board out of the skillet with some needle nose pliers it also chipped the solder mask, enough that the board is a write off for this project. So a few issues to work out, but making progress.

I'm going to take some blank boards over to "my carpenter" to help mock up the timber base and check it looks like we think it will when the bits are physically laid out.
 

Offline harnonTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: au
  • Is this thing on?
    • My Personal Website
Re: Allegedly a TTL clock (build log)
« Reply #17 on: March 28, 2020, 09:34:33 am »
Raising this build log from the dead!! I'm stuck at home at the minute with more free time than I'm used to, so I've been able to finally pick up this project.

Since I last posted (months ago!) I managed to build the main board using my cheapo reflow technique and a dodgy hot air gun from eBay. It took a couple of goes because there were solder bridges on the SC74 surface mount components that were a little difficult to fix.

The next big issue was then cleaning the board, because it has a nice black matt finish that really shows up the flux. I was able to use the fume hood at work and tried some cleaning techniques on a board with solder bridges. It was very difficult to remove the marks left by acetone, but a copious mix of ethanol / IPA / deionised water, scrubbing with a toothbrush and dabbing dry with kim wipes seemed to do the trick.

My Dad finished the carpentry and you can see the built up clock in the images below.

I wasn't game to plug the board in until I had a power supply with current limit built in as I was too scared I'd blow the board up. I received one just the other day and now the clock is sitting beside me disassembled and ticking slowly away.

I'm not 100% happy with the way the digits are connected to the main board. I've built a bunch of dupont connectors and have cables running from the main board to the digits, but the connections aren't very good and might need some hot glue to stay there. It works, but I think might be really flaky. I think I'll also get some clear perspex laser cut for the back so that the cables can't be pulled by little hands.
 
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: Allegedly a TTL clock (build log)
« Reply #18 on: March 29, 2020, 01:57:32 pm »
It's pretty late to mention this, but...
U5 is not necessary.
Just shift everything on U7 down 3 taps.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf