Confused over SN74LS04 and HD74LS04. They are not compatible. - Page 1
Forum section: electronics / projects

author: gmc
author_rank: Regular Contributor
timestamp: March 12, 2022, 09:21:19 am
content: I've been pulling my hair out over this one for a while now.I've been repairing some old retro computers that use a 74LS04 which has gone faulty. I've replaced it with a SN74LS04 which has not fixed the problem (The chip tests fine and I have 10 of them - all done work in this specific computer)However if I replace it with a HD74LS04 it works. I though that was just a oddity of the computer. But now I've come across another retro computer (Oric) with exactly the same issue.Works with a HD74LS04 but not the SN74LS04.I've been looking through the datasheets but for the life of my I can't find any differences. Same pinout, both hex inverters.The only difference is the schematic of the chip and a small difference in the switching characteristics. Would this be enough to cause these issues?Datasheets:https://www.ti.com/product/SN74LS04#tech-docshttps://www.electronicoscaldas.com/datasheet/HD74LS04-HD74LS05_Renesas.pdfOn the one computer the inverter is used to generate a 12MHZ clock for the CPU.HD74LS04 - pin 2 (Working)SN74LS04 - pin 2 (Doesn't work - Looks like a run away oscillator)Has anyone come across a issue like this before, or can explain this?

author: DavidAlfa
author_rank: Super Contributor
timestamp: March 12, 2022, 10:02:21 am
content: The propagation time might be the issue here.The HD74LS04 has 15+15ns, but the SN74LS04 has 9+10ns, it's faster.Since there're 2 gates in series, the HD had a propagation time of about 60ns, while the SN has 38ns.Try adding 22pF capacitors between the crystal pins and gnd, does it change anything?

author: Ian.M
author_rank: Super Contributor
timestamp: March 12, 2022, 10:07:09 am
content: TTL crystal oscillators are vanishingly rare nowadays and much of the common knowledge about them has been largely lost.What you've got there is a variant of the capacitor coupled two inverter series resonant oscillator circuit as the low input impedance and relatively low gain of TTL inverters made Pierce oscillators rather difficult to implement reliably.I'm not at all surprised that it's sensitive to the brand of inverter used as using a TTL inverter as a linear amplifier isn't specified in their datasheets, so yes even the tiny differences you have noted are important. Although the circuit could be improved to ensure reliable operation with most brands of 74LS04, as long as you can 'select on test' to find working ICs for it, loosing originality by modifying vintage computers is generally undesirable. Maybe build a test jiq to aid selecting inverters that work?You should read Chapter 11 of "Crystal Oscillator Circuits" by Robert J. Matthys, Revised edition: Krieger Publishing Company, 1992, ISBN 0894645528. It was originally published in 1983 by Wiley, and is out of print in both editions, but PDFs of it are easily Googlable.Here are a few select quotes:QuoteQuoteIt then goes on to explain the correct biasing and operation of this type of dual inverter series resonant oscillator in some detail, for different series of TTL logic. See: Figure 11.3(c). TTL Two-Inverters (74LS04) circuit, which has very different biasing to your circuit.

author: gmc
author_rank: Regular Contributor
timestamp: March 12, 2022, 10:16:33 am
content: Thanks for the information. Very interesting to hear about the TTL oscillator. At least that would explain why some brand's don't work and some do.I'll take a read through the PDF documents and experiment with building/tweaking the circuit.As you said its probably not a good idea to modify the computer. I'll just buy a few extra HD74LS04 chips to have as spares.I have 3 of these chips, and all work 100% in the oscillator circuit. So for sure, it's the small change in specs between brands.

author: tooki
author_rank: Super Contributor
timestamp: March 12, 2022, 10:37:11 am
content: Quote from: DavidAlfa on March 12, 2022, 10:02:21 amIncorrect, you must have misread the datasheets.1. You’re comparing the “typ” value from one datasheet to the “max” value of the other.2. Both datasheets list 9ns/10ns typical, 15ns/15ns max. (The TI datasheet covers multiple logic families, so you have to make sure you’re looking at the tables for the SN74LS04.)

author: tooki
author_rank: Super Contributor
timestamp: March 12, 2022, 10:56:13 am
content: Quote from: Ian.M on March 12, 2022, 10:07:09 amOh man… that book looks fascinating, but what a pity the PDF is so terrible: somebody applied OCR to itwhichreplacesthe original bitmap with text, so wherever the OCR got it wrong, the original content is gone. And it did that outside of body text, too, resulting in schematics where traces have been substituted with letters (!), and many areas where images, schematics, or parts of them are simply missing.

author: gmc
author_rank: Regular Contributor
timestamp: March 12, 2022, 11:02:08 am
content: A very interesting read on IC oscillators, especially the 2 stage 7404 oscillator.

author: Ian.M
author_rank: Super Contributor
timestamp: March 12, 2022, 11:18:35 am
content: The original 1983 Wiley edition isn't unreasonably expensive second hand, so if anyone seriously into 'classic' TTL logic or '80's retrocomputing is interested, they could buy a copy, then do the community a massive favor by scanning it properly. Regrettably, I'm only a dabbler in those fields and generally avoid increasing my 'dead tree' book collection.

author: CaptDon
author_rank: Super Contributor
timestamp: March 12, 2022, 02:26:21 pm
content: The values in your computer circuit look a bit 'heavy' for 12mhz duty. The coupling cap is a bit large and the 1K resistors a bit low. Even the circuit itself is slightly different than what is typically used. That circuit looks more proper for the older 4Mhz oscillators.

author: gmc
author_rank: Regular Contributor
timestamp: March 12, 2022, 02:28:31 pm
content: This is from the schematic from the Oric Computer from the 80's. Not my design

author: CaptDon
author_rank: Super Contributor
timestamp: March 12, 2022, 02:57:41 pm
content: Yes, understood. Looks like they copied and pasted the oscillator from the old 4.77Mhz circuit and plugged in a 12Mhz crystal and were lucky enough to find it was working. I ran into an opposite problem as a bench technician at a Contract Manufacturer. They had an intelligent LED bargraph display to show power and battery status. Out of the first run of a hundred or so about 30% didn't work. Looking at the device with a scope showed it was oscillating on the 5th overtone at 20Mhz!! Here was the killer....When you touched the scope to the oscillator circuit it would go to the fundamental AND stay there until you cycled power!!! We had to solder an extra 22pf capacitor under the board on one leg of the I.C. to a local ground plane to kill the overtone.

author: edavid
author_rank: Super Contributor
timestamp: March 12, 2022, 03:47:30 pm
content: I made a more readable scan of the Matthys book, but it's 13MB, so I can't easily post it here.Here's a Google Drive link, don't know how long it will last:https://drive.google.com/file/d/1crclVpDjRq-62Hw4QPWsx8QIsKtrsZA3/view?usp=sharingWhoops, sorry it's missing chapter 1. I'm not sure when I'll be able to correct that. It just gives some historical background.

author: tooki
author_rank: Super Contributor
timestamp: March 12, 2022, 05:17:25 pm
content: Thank you! FYI, though, it’s missing chapter 1.

author: TheHungry
author_rank: Newbie
timestamp: March 12, 2022, 10:35:28 pm
content: In all ORIC computers that i have ( include the "ПРАВЕЦ 8Д" clone ) on 12Mhz generator IC is a 74S04 or 74F04 ! If you use 74ls04 this may cause unstable work of computer .

author: gmc
author_rank: Regular Contributor
timestamp: March 12, 2022, 11:26:54 pm
content: Thanks for the info. This is good to know. I've just ordered a few 74S04 chips as well and will try some experiments.

author: edavid
author_rank: Super Contributor
timestamp: March 13, 2022, 03:06:00 pm
content: Quote from: gmc on March 12, 2022, 11:26:54 pmYou would have to use lower value biasing resistors - 74ALS04 would be a better drop-in upgrade.Why not try 74HCU04 while you're at it?

author: Bassman59
author_rank: Super Contributor
timestamp: March 13, 2022, 04:58:02 pm
content: I thought the usual ICs used to make TTL-output oscillator from a standard crystal were the unbuffered variants like 74HCU04.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 13, 2022, 06:20:28 pm
content: It's hardly a matter of propagation delays here, as already said above. More to do with the fact the inverters are basically working in their linear region, and the whole circuit is not very tolerant of variations in individual ICs. I bet the manufacturer also had issues back then with some batches of LS04. You could always tweak the values of the resistors and capacitor, but unless you want to keep the circuit 100% original, your best bet would likely be to use a less finicky oscillator circuit. I'd preferably use a single-inverter topology, with a second inverter to buffer the output.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 13, 2022, 08:54:05 pm
content: The usual oscillators have a capacitance to ground at the input gate facing the crystal. The impedance seen at that input is a very important part of the ciruit. The input capacity can vary and is usually not specified very well. The resistor from the feedback in usually not that attracktive, as is dampens oscillation.

author: Ian.M
author_rank: Super Contributor
timestamp: March 13, 2022, 09:24:21 pm
content: There's no easy way to mod the circuit on the mainboard without significant hackery, so perhaps the best option is to design a daughterboard to fit the 74LS04 socket, carrying a SMD 74LS04 if any of its other gates are used and a SMD crystal oscillator module of the correct frequency. If the other gates aren't used, it will probably need a single gate buffer as well for the clock output pin, or if they are, simply use a spare gate of the SMD '04. That will leave the original crystal, the feedback resistors and the coupling cap connected in a loop, still connected to the output pin, but as there are no other connections to them, that shouldn't be an issue. No mainboard mods would be required, and it could be reverted by simply refitting a compatible 'LS04 in the socket

author: BrianHG
author_rank: Super Contributor
timestamp: March 13, 2022, 09:38:28 pm
content: Something to try:Try changing the 1k's to 100k and the 74LS04 to 74HC14.This should allow for a far greater range of tolerance with regards different vendors versions of 74HC14's. Even 74HC04 should also work, though you may need to add a loading capacitor at the first gate's input.Moving the crystal from the output of the second inverter to the output of the first inverter may also improve stability at the cost of having a slightly higher output frequency in a few 10s of hertz unless you add loading capacitors.

author: Ian.M
author_rank: Super Contributor
timestamp: March 13, 2022, 10:02:47 pm
content: That modification would need loading caps to work reliably as you would be converting it to a Pierce oscillator. Also if any of the other four gates are in use and driven by TTL levels, it may cause worse problems unless you add pullups for threshold compatibility.

author: jimmc
author_rank: Frequent Contributor
timestamp: March 13, 2022, 10:42:55 pm
content: There's a copy of the ORIC service manual herehttp://www.48katmos.freeuk.com/servman.pdf.The parts list gives the oscillator chip (IC21) as a SN74LS04 with the note 'IC21 must be National'Maybe the 74S04 or 74F04 were a later mod. Mine are in storage at the moment so I can't check what they have.Jim

author: edavid
author_rank: Super Contributor
timestamp: March 13, 2022, 10:52:01 pm
content: Quote from: BrianHG on March 13, 2022, 09:38:28 pmDid you mean 74HCU04? 74HC14 should never be used as a crystal oscillator.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 14, 2022, 03:35:13 am
content: Quote from: jimmc on March 13, 2022, 10:42:55 pmThanks for that. Those service manuals are always interesting.Now after reading some of it, I must say though that this particular one is like one of the worst of the kind I've ever read. Even the english in it is relatively poor. But the technical description is not all that great either. Dunno if others share the same opinion.But back to the topic, it does mention using "National" for IC21 as you pointed out, so as I suspected, they already knew their design was very tolerance-dependant. I think they also mention a modification around that IC, but I didn't bother looking at it too closely. The OP could have a closer look.

author: IanJ
author_rank: Unknown
timestamp: March 14, 2022, 06:56:46 am
content: If its any consolation, back in the 80's we had the odd trouble with this exact circuit on new boards whereby some 74LS04 brands would double oscillate the xtal freq. Well, we called it double oscillate at the time but not to say it was actually double.......probable more like your issue.The answer in our case back then was to change out the 04 for a different brand.Ian.