WANTED: Apple-1 owners with a frequency counter !

22 posts / 0 new
Last post
Offline
Last seen: 1 day 10 hours ago
Joined: Apr 1 2020 - 16:46
Posts: 826
WANTED: Apple-1 owners with a frequency counter !

Purpose of this thread is to investigate amother nasty quirk of the Apple-1:

 

Its 14.31818 MHz crystal oscillator is a lousy design and does not run at the specified frequency.

 

(No intention to slam Woz here, he probably copied the lousy circuit from some TTL application note or some other source, back in the early 1970s almost no 'digital' designer understood crystal oscillators well enough to be able to tell which circuit is cr@p and which one is not. Needless to say, the cr@ppy circuits reigned supreme, hardly an OK one could be found.)

 

The frequency of the Apple-1 master oscillator being off from the specified frequency greatly has delayed another interesting project of mine, I had to shelve it, and can only continue with the work when I have answers to these questions:

 

1) How much off are the oscillators in the Apple-1 population ?

2) How far would you go to fix the problem. Cut traces and add components on the motherboard solder side ?

3) Or would you prefer to piggyback a DIL-14 oscillator onto the 74xx04 IC in location D-12 ?

4) Or, would you never do such surgery on your Apple-1 (of course, I don't expect owners of originals to chime in, don't modify those)

 

To answer the first question, I need volunteers who have an Apple-1 (especially those who did not use one of my famous IC kits) and a resonably precise frequency counter. Just probe the DOT RATE signal at pin #2 of the 74161 at location D11. Ideally, it should be 7.1590909 MHz, but due to the lousy oscillator circuit, it can be off by several 100 Hz (or even more than 1 kHz . . . don't need a crystal for such a miserable frequency accuracy). This is what I got:

 

 

This is already bad, too far off from target, but wait, it gets worse:

 

 

If you do some frequency measurements, please post the results here and state a) frequency b) type of the 7404 (i.e. 7404, 74H04, 74LS04 ...), and c) what is printed on the crystal ... the manufacturer is of the most interest.

 

For all the other questions, feel free to chime in and post your opinions here in this thread. Don't ask why the oscillator should be fixed - it's for fully Apple II compatible color graphics on the Apple-1. When the oscillation frequency is wrong, the TV will refuse to produce color. And there is no way to fix it within resonable expenditure other than to fix the oscillator on the motherboard. A local oscillator on the graphics card will NOT fix it but would cause a multitude of other evils, which is due to the way the Apple II screen memory DMA is interleaved with the CPU cycles. This is a powerful concept but it must stay isochronous. Adding a 2nd oscillator would cause failure.

 

Footnote:

 

Oh, just to prevent the impression that my Hewlett Packard 5325B Universal Counter made in the year 1969 (the year of the Apollo 11 moon landing) is giving wrong results, no. Despite it now is 54 years old, after I replaced some electrolytic capacitors, it was only 0.2 ppm off from my Agilent 33120A function generator which has the 'high accuracy' time base option (Option 001) and was calibrated against a reference that traces back to the NIST atomic time standard from Fort Collins, Colorado. This is a testimony to the quality of these fine instruments they made half a century ago. It was sitting in my basement for 25+ years unused and still its timebase did not deteriorate. Try to find that in a modern frequency counter: after less than 20 years, its rubber keys will have deteriorated to a point where you can't use it anymore anyways, and the 'lead free' solder joints will have developed lots of micro cracks and shorts due to growing tin whiskers. 21st Century electronics are cr@p that won't last (don't buy them, hint, hint, unless you can live with disposable, short lived junk destined to the landfill).

 

Comments invited !

CVT
CVT's picture
Offline
Last seen: 6 hours 46 min ago
Joined: Aug 9 2022 - 00:48
Posts: 971
UncleBernie wrote:...This is
UncleBernie wrote:

...

This is already bad, too far off from target, but wait, it gets worse...

...

 

Yes, more than 2 kHz is pretty bad and most NTSC TVs will lose color at that point. As part of this project for one of the supported resolutions I run the clock at 14.318187 MHz (4 times the NTSC color frequency). Both my 14" JCV CRT TV and my 46" Sony Bravia LCD TV lose color if I lower the frequency down to 14.315 MHz, while they are still fine at 14.316 MHz. This is equivalent to 1.5 kHz and 1 kHz in your case.

 

The real question is what can you really do about it? If you have already decided to run off the Apple I’s generator, I think the best solution is to ask the users of your video card to add a 50 pF trimmer capacitor in series with the crystal and adjust it to get color. This method has been used extensively to get NTSC color out of the handicapped Apple II Europlus machines.

 

The only NTSC monitor I own that can display color as far down as 14.313 MHz (2.5 kHz in your case) is this one, but I don't think a lot of self-respecting Apple I owners could be persuaded to use it. :)

Offline
Last seen: 1 day 10 hours ago
Joined: Apr 1 2020 - 16:46
Posts: 826
I think Apple-1 crystal oscillator can be fixed, but not easily.

In post #2, CVT wrote:

 

"The real question is what can you really do about it ? "

"I think the best solution is to ask the users of your video card to add a 50 pF trimmer capacitor in series with the crystal  ..."

 

Uncle Bernie answers:

 

The current idea I have is to fix the oscillator on the motherboard, which of course requires some trace cuts and some added components, which can be invisible, on the solder side, such as with my video fix.

 

Another option is to piggyback a DIL-14 oscilllator in a metal can onto the 7404, and wire that one such that it replaces the on-board oscillator. This involves no trace cuts and is fully reversible. But it looks ugly.

 

The whole issue with crystals is that they are manufactured for a specific electronic environment where they then have the resonance frequency stamped on them, and only then. If the oscillator circuit deviates from these specs, all bets are off. People have seen this all the time when they replace the crystal in Apple II (i.e. to turn an Euroapple into a NTSC machine), some of those "14.31818 Mhz" crystals they found in their local electronics store did work at the desired frequency, most didn't, and some refused to oscillate. Most likely, Apple (the corporation) had those cystals custom made to work with the wonky two transistor oscillator of the Apple II. So if you try a random crystal from a random seller, good luck. The actual workings of crystal oscillators are poorly understood even today, 100 years after they have been invented, and I've even seen papers were an elaborate analysis is done for their circuit with fancy formulas but it's wrong. These dubious foundations are the reason why so many designers got burned when trying to size components for their own crystal oscillator circuits and then, after the time and money budget has been wasted for naught, the remedy is to buy those ready-made oscillators in the TO-14 and TO-8 metal cans.

 

I think I understand some of the crystal oscillator circuits better than most, and might be able to cure the on-board oscillator of the Apple-1, but it most likely can only be done optimally only for one specific type of crystal from one manufacturing lot. And adding components, of course. Adding the small trimmer capacitor alone won't do with all crystals. I measured a few crystals yesterday and although those of the same type all are very consistent, as you would expect from crystals, the difference between manufacturers / lots is profound. Ironically, the NYMPH crystals I had in my early kits are closest to the desired oscillaton frequency when put into the Apple-1, but I am out of those, except for a few samples I kept as spares.

 

But in general, if a given crystal oscillates close to the 14.31818 MHz in the Apple-1, then adding just that series capacitor (as you suggested) may be enough to get it on target.

 

This is why I did ask Apple-1 owners who have frequency counters to take measurements and report them. I want to know the magnitude of the problem that is lurking out there, before I expend too much of my RQLT to develop an oscillator upgrade.

 

There is another issue - the oscillator on the Apple-1 overloads the crystal badly. So it will fail sooner or later. I can't put numbers on it how long it will last. Maybe this point is moot as the typical Apple-1 does not run 24/7, but when I fix the oscillator then I want that issue addressed, too. Alas, there are only 2 inverters with a gain of ~ 10 each. If this would allow to run the crystal at a low enough amplitude to stay within the maximum operating power limit of the typical crystal of that frequency is still an open question. I'm not yet there, I'm still measuring crystal parameters and parameters of various gates when used as linear amplifiers. Alas, logic gates make very lousy amplifiers. It would be easier to design a crystal oscillator using discrete transistors. So one complication is stacked on another complication. It seems to me that design and development of Apple-1 add-on cards goes like that: start with a quirky / wonky foundation (the Apple-1 with all its quirks) and then erect the electronic equivalence of a Jenga tower on it. It might  almost  work. Until it collapses . . . try to build a cathedral in a swamp.

 

- Uncle Bernie

CVT
CVT's picture
Offline
Last seen: 6 hours 46 min ago
Joined: Aug 9 2022 - 00:48
Posts: 971
UncleBernie wrote:...The
UncleBernie wrote:

...

The whole issue with crystals is that they are manufactured for a specific electronic environment where they then have the resonance frequency stamped on them, and only then. If the oscillator circuit deviates from these specs, all bets are off. People have seen this all the time when they replace the crystal in Apple II (i.e. to turn an Euroapple into a NTSC machine), some of those "14.31818 Mhz" crystals they found in their local electronics store did work at the desired frequency, most didn't, and some refused to oscillate.

...

 

Actually this happens because the oscillator in the Apple II requires a 14.31818 MHz series resonant crystal and most crystals sold these days are parallel. DigiKey goes out of its ways to describe how to tell them apart, but most people seem to ignore it.

 

When you put a parallel resonant crystal in a circuit designed for a series resonant crystal (like the Apple II), it will resonate at a slightly lower frequency than the one printed on the can. This is exactly why a ~22 pF capacitor needs to be connected in series with the crystal if a parallel 14.31818 MHz crystal is used when converting an Apple II Europlus to NTSC. This capacitor bumps its resonating frequency to match that of a series 14.31818 MHz crystal.

 

Now that I look at the schematics of the Apple 1, I can see that it also requires a series resonant crystal. Are you sure that you have not simply put a parallel one by mistake? Can you provide a link to the crystal’s datasheet?

Offline
Last seen: 1 day 10 hours ago
Joined: Apr 1 2020 - 16:46
Posts: 826
The problem with "magical mystery crystals" from surplus shops

In post #4, CVT wrote:

 

"Are you sure that you have not simply put a parallel one by mistake? Can you provide a link to the crystal’s datasheet ?"

 

Uncle Bernie answers:

 

Oh, I am well aware about the differences in crystals meant for series or parallel resonant circuits.

Alas, I don't have datasheets for the particular cystals I use in my kits - I got them from surplus dealers for cheap, and those don't even know where they came from and what they are meant for. Same situation for anyone who procured the parts by himself. When I tested the crystals in the Apple-1 I did look for good start up and not for frequency being exactly on spot, as at that point in time I never have foreseen to make a color graphics card for the Apple-1.

 

So let's call them "mystery crystals".

 

I'm currently measuring their parameters and indeed, some obviously were meant for parallel resonant circuits and others were meant for series resonant circuits. What a mess !

 

But this is not a big problem. Any crystal can be made to run at the specified frequency when the oscillator circuit is the right type with properly sized components to get the right phase shift around the loop.

 

The real problem is that TTL gates bludgeoned into service as  linear amplifiers do not make a good oscillator of either type at that relatively high frequency. Not only do they have poor gain, they also have unfortunate input and output impedances which vary significantly over the oscillation cycle. Their delay (= phase shift) contribution to total loop phase at this frequency also is significant, unsymetrical, and varies over process, temperature, and supply voltage. We all know that crystals control the oscillator frequency by their phase shift (over frequency) and with all the input and output impedances and the gate delays varying all over the place, it is tricky, or may be impossible, to find a "cure all" solution to make all of the "mystery crystals" out there oscillate at the proper frequency. Seems like another deep, and labyrinthian engineering rathole.

 

Maybe the best solution would be the piggyback DIL-14 oscillator. But I don't like it as it ruins the authentic looks of the machine. I still have hopes to find relatively simple mods to the basic Apple-1 oscillator to get the two types of crystals in my kits on target frequency. The open question is if anybody would want to do the mod. Assume there are half a dozen people out there in the world who would want one of my graphics cards (maybe there are less). A lot of "mod" research for so few. Sigh.

 

This is what the industry would do when they have a lousy oscillator designed into a product: they would select a crystal which comes close, and then ask its manufacturer to make a slightly different custom batch where the crystal is just ground a little bit different to offset the problems with the circuit, and, for nominal process (of the TTL), nominal temperature, and nominal supply voltage, would produce the desired frequency. This "solution" would never be great and the accuracy and stability of the crystal time base would never get anywhere near where a competent oscillator design could be, but if that "band aid" solution works for their application, it works !

 

I think that Apple went that route with the two transistor crystal oscillator in the Apple II. A custom crystal, and it's all OK. This is the most probable cause why it's so hard to find a "14.31818 Mhz" crystal which works in an Apple II at the frequency it should.

 

But for 3-6 people I can't order a batch of custom ground crystals.

 

So the only remedy is to mod the oscillator. Maybe a change of the crystal to the specific crystal the mod was developed with also is necessary, but this is not a big deal.

 

There is a reason why they sell these DIL-14 or DIL-8 oscillators (which also start do die out, now they make smaller ones in SMD packages, which need reflow soldering, yet another stumbling stone for hobbyists). Oh, and I have lots of them, too. And guess what - when I measured their oscillation frequency I found NONE which was spot on, they vary all over the place, although only by a few 100 Hz at most. So even the crystal manufacturers (who make these ready made oscillators) seem to struggle to get it right. Ironically, I have found a bag with 10 MHz DIL-14 oscillators which have a user accessible trimmer capacitor and guess what - all these were spot on, despite they were tossed around and handled over the 30+ years they lived in their bag in that surplus store where I rescued them from, out of pity. I never needed one of those, as I have plenty of double ovenized 10 MHz OCXOs around, which are much more accurate than I ever need. Actually, this project is the first time in 40+ years in electronics where I needed a frequency counter with more than 4 significant digits, which most oscilloscopes with digital readout had since the 1980s. Same misery why Logic Analyzers are rarely used and nobody wants them (on Ebay). What you really need in a typical electronics lab (other than being a ham radio operator or time nut) are accurate and calibrated function generators. But frequency counters, meh. They use to sit on lab shelves and gather dust.  Like the Logic Analyzers. After 20 years the company tosses them out and you can get them for a song (some require you to pay the $1 residual value in their books, for legal reasons). Don't try to sell them on Ebay. You will get nothing. Or maybe the $1 back plus the (often exorbitant) shipping costs. Giving them away for free at a ham fest probably the better way to get rid of them. But I digress. Just wanted to express the reasons why I don't think there are many Apple-1 users with frequency counters out there who could heed my call for measurements.

 

- Uncle Bernie

 

 

CVT
CVT's picture
Offline
Last seen: 6 hours 46 min ago
Joined: Aug 9 2022 - 00:48
Posts: 971
UncleBernie wrote:I think
UncleBernie wrote:

I think that Apple went that route with the two transistor crystal oscillator in the Apple II. A custom crystal, and it's all OK. This is the most probable cause why it's so hard to find a "14.31818 Mhz" crystal which works in an Apple II at the frequency it should.

 

A custom crystal for a standard frequency from Woz, who is famous for being able to squeeze the most out of cheap regular standard components? Give me a break!  :)

 

No, the crystal in the Apple II is not custom. It’s just a regular series crystal with an ESR of around 25 ohms that they were able to get large quantities for cheap at the time. If they tuned anything, it's just the values of the passive components around it.

Macintosh_nik's picture
Online
Last seen: 1 hour 20 min ago
Joined: Jan 8 2021 - 05:18
Posts: 417
Hi Uncle Bernie!

Unfortunately I don't have such a device, I tried to measure with an oscilloscope, but it must be very inaccurate, it shows 7,15-7,20 MHz with both crystals. The first one in the high case I bought at Unicorn, the second one is cheap at aliexpress. They work in Apple-1, tried them also in Apple II Rev. 0, maybe that's the reason for my failures, I haven't been able to get any image so far. They don't work for the Apple II? I have another one, does it make sense to try it in the Apple II?

CVT
CVT's picture
Offline
Last seen: 6 hours 46 min ago
Joined: Aug 9 2022 - 00:48
Posts: 971
The Raltron 14.31818-18 is a

The Raltron 14.31818-18 is a parallel crystal with 18pF load capacitance. In an Apple I it would also resonate at a slightly lower frequency than 14.31818 MHz, and in order to work in an Apple II it might need a trim capacitor in series.

 

 According to Raltron if it was a series crystal, its designation would be 14.31818-S. See Part Numbering System on page 2 here.

Offline
Last seen: 4 hours 22 min ago
Joined: Jul 31 2021 - 08:38
Posts: 19
Moin!Here are my (quick)

Moin!

Here are my (quick) results...Have a nice Sunday!

- Pete

 

 

 

CVT
CVT's picture
Offline
Last seen: 6 hours 46 min ago
Joined: Aug 9 2022 - 00:48
Posts: 971
peo2000 wrote:Moin!Here are
peo2000 wrote:

Moin!

Here are my (quick) results...Have a nice Sunday!

- Pete

 

This is the 100% correct crystal to use, but why did you use caps with the Z5U rating for C3 and C4? Their tolerance is -20/+80% and they vary quite a bit with temperature. I would have gone for X7R.

 

Did you happen to measure how close they are to 10nF?

Offline
Last seen: 4 hours 22 min ago
Joined: Jul 31 2021 - 08:38
Posts: 19
... yes I know, it wasn't the

... yes I know, it wasn't the best choice.

They just lay around and looked kind of cool. Don't think I really need 1kV either. However, they are all pretty close to 10nF, a little over...at room temperature.

Let's see, maybe I'll swap them at some point when I have something suitable on hand.

Offline
Last seen: 1 day 10 hours ago
Joined: Apr 1 2020 - 16:46
Posts: 826
Some progress was made ! And about the 10nF capacitors.

First to clarify what the capacitors in the Apple-1 crystal oscillator do.

This is because CVT wrote this in post #10:

 

"Why did you use caps with the Z5U rating for C3 and C4? Their tolerance is -20/+80% and they vary quite a bit with temperature. I would have gone for X7R."

 

Which seems to have spooked peo2000 (see his post #11).

However, there is no reason to worry about the two 10nF capacitors in the Apple-1 oscillator circuit. These have no significant effect on the oscillation frequency. C3 (between the inverters) is just a DC blocking capacitor between the two amplifier stages made from the inverters. This allows both inverters to have an independent operating point set for each one individually by the 390 Ohm resistors across them. C3 can't influence the oscillation frequency in any way.

This leaves C4. Again, C4 has no significant effect on the oscillation frequency, despite it is in series with the crystal. The internal motional capacitor of crystals at this frequency (14.31818 Mhz) is very low, in the 10's of femtofarads. The specimen I measured has 11 fF motional capacitance. This is 11e-15 Farads. If you put a 10nF capacitor in series (10e-9 Farads) , which is 6 orders of magnitude higher, then you still have the same 11fF (if you want to be nit-picking, 1.1ppm less of that, totally irrelevant for this application). If you don't believe me do the math:

Cseries = 1/(1/C1 + 1/C2).

If you still don't believe me, replace C4 with half the value (4.7nF) and measure the difference in oscillation frequency between the 10nF and 4.7nF case.

Actually, C4 is superflous. It can be removed from the circuit and replaced with a short. There will be a very slight change of the oscillation frequency, in the single digits ppm (parts per million). "These are not the dirt effects we are looking for".

Still, CVT is right that Z5U is a lousy ceramic material you want to avoid. But if you want the orange color of the capacitors you have in your build, peo2000, don't worry about them. Orange perfectly fits to the crazy early to mid 1970s where this was the color your couch had to have. And the bell bottom pants of the young women had to be orange, or yellow, too.

 

Now to the progress I have made with the work on the topic of the Apple-1 crystal oscillator. After I finished the measurement of the crystal parameters I used the results to find the datasheets of the crystals, and I was successful for the Abracon crystal which is in most of my kits. They are "parallel mode" crystals needing a 18 pF load, so it's no wonder they run at a wrong frequency in the Apple-1. About half of my kits (the earlier ones) were shipped with "Nymph" brand crystals with a grey plastic sleeve. Which also are "parallel mode" crystals, or so it looks, they even have a code "NMP" printed on them. The Apple-1 oscillator however is of the "series mode" type. Ouch. None of these "parallel mode" crystals can be expected to run at the 14.31818 Mhz stamped onto them, if they are put into the Apple-1, because: wrong circuit !

 

But there is no reason to worry. The physical construction of "series mode" and "parallel mode" crystals for the same frequency and from the same manufacturer is exactly the same, except that "parallel mode" crystals are ground to resonate at a slightly lower frequency when used in "series resonant" mode. As CVT has pointed out in his post #4, putting a small capacitor of some 10's of pF in series with a "parallel mode" crystal will shift its frequency in "series resonant" oscillators to a point where they will resonate at the 14.31818 Mhz we want (and which is stamped on them).

 

What you can do is to replace the C4 capacitor with a small ceramic trimmer of 4...50pF and then tune it until the frequency counter reads "14.31818 MHz" (or close enough to it). For the "NYMPH" crystal I needed 36 pF to make it run at the desired frequency:

 

 

Note that this capacitor is small enough to have an effect on the oscillation frequency of the crystal. Unlike the much larger 10nF which C4 had before. Consequently, the ceramic material of this small capacitor must have a low tempco, something like NPO or COG is probably the best choice.

 

However, don't even think that this fix will really cure all problems with this lousy oscillator circuit. The delay of the inverters varies over process, supply voltage, and temperature, and this is equivalent to a variable phase shift around the loop, which the crystal tries to compensate by adjusting the total phase back to 360 degrees. This causes the crystal to move along its phase-over-frequency function, and this causes an observable frequency shift while the 7404 is warming up. So you will never exactly get the 14.3181818 MHz. But the frequency error is in the order of ~100 Hz and this does not cause the typical color TV to puke ("puke" meaning: reject the color signal and show B&W only).

 

And so I finally got color from my Apple-1 graphics card:

 

 

 

Sorry for the overexposed picture above, my camera obviously is not able to handle the bright TV screen in a dimly lit room.

Here is a closeup where the camera can handle it:

 

 

Note that the camera again does a bad job in color reproduction (it's one of the first, from 1998). The actual colors on the TV screen are much more vivid.

 

So we are getting close to a solution and my graphics card project is back on track. I'm still interested in Apple-1 users with frequency counters to measure their oscillators and then, perhaps, apply the series capacitor fix. And then tell us which crystal and which series capacitor was needed to get the frequency on target (14.31818 MHz, or 7.15909 Mhz after the first divider stage).

 

If I see enough evidence that the Apple-1 oscillator can be brought to target frequency needed for NTSC color, then I will feel much better for my graphics card project. You see, if it would not be possible to guarantee that every Apple-1 owner could bring the oscillator to target frequency, the graphics card project is dead in the water. Because with no color, it's useless.

 

- Uncle Bernie

 

P.S.: of course this little mod with the series capacitor does not cure the other problem of that lousy oscillator, overloading the crystal. Massive overload. Abracon datasheet says 100 uW driving power. Very conservative. Most crystals in that frequency range can take 1 mW. But this lousy oscillator exceeds that by more than two orders of magnitude. Like most of these primitive circuits with no amplitude regulation (or at least amplitude limiting). Fixing this may be the next step. But let's fix the frequency issue first !

CVT
CVT's picture
Offline
Last seen: 6 hours 46 min ago
Joined: Aug 9 2022 - 00:48
Posts: 971
UncleBernie wrote:...If I see
UncleBernie wrote:

...

If I see enough evidence that the Apple-1 oscillator can be brought to target frequency needed for NTSC color, then I will feel much better for my graphics card project. You see, if it would not be possible to guarantee that every Apple-1 owner could bring the oscillator to target frequency, the graphics card project is dead in the water. Because with no color, it's useless.

...

 

This is pretty impressive and it would be a shame to put a stop to it just because you cannot guarantee that. Also consider that different color TVs/monitors will have different deviation tolerance from the 14.31818 MHz frequency. Maybe it would be useful to also be able to recommend some easily obtainable displays that have a wider tolerance.

 

Here are the frequency ranges in which the 4 NTSC displays that I own fully retain color and display it correctly:

 

46" LCD Sony Bravia KDL-46XBR4: ....... 14.314473 - 14.321391 MHz

14" CRT Sony Trinitron KV-14T1R: ........ 14.316686 - 14.319890 MHz

14" CRT JVC C-F14EE: ........................ 14.314677 - 14.320577 MHz

 4" LCD car monitor from AliExpress: .... 14.312184 - 14.325282 MHz

 

The method that I used to determine the range can be seen in this video.

Offline
Last seen: 1 day 10 hours ago
Joined: Apr 1 2020 - 16:46
Posts: 826
In post #13, CVT wrote:

" This is pretty impressive and it would be a shame to put a stop to it just because you cannot guarantee that."

 

Uncle Bernie comments:

 

Oh, I never give up on my projects. But if I run into obstacles which can't be overcome in a reasonable amount of RQLT, I shelf the project, until new ideas to overcome the obstacle pop up, or when I have nothing else to do.

Some of my projects drag on for decades. The Apple II graphics card project was started in Y1986, just after Lattice Semiconductor Corp released the GAL16V8 and GAL20V8 "Generic Array Logic" devices. The idea was to implement an Apple II - including Disk II controller - with GALs. So I aptly called the project "GALAPPLE". Around Y1987 I already had the system partitioning and synthesizable RTL designs for various GALs, but then my small business ramped up and took my full attention (something like 120% :-)

 

I think I already told the story how a young man I flew with as a safety pilot for IFR practice mentioned the insane prices for Apple-1 which sent me on a long and winding road in the Apple-1 world, but this journey inevitably had to have the ultimate consequence that I could not resist to "recycle" circuit designs from my GALAPPLE project (which I had restarted 32 years after it was shelved, this restart  happend after my retirement).

 

The floppy disk controller I presented in May  2021 (1 1/2 years ago !)  was the first outcome of this "recycling", see here:

 

https://www.applefritter.com/content/uncle-bernies-woz-machine-based-apple-1-floppy-disk-controller

 

. . . and this color graphics card would be the next.

 

Since all these projects came out of my GALAPPLE parent project which sought to re-implement the Apple II / Disk II with Lattice GALs, they are of course fully software and hardware compatible with the Apple II world.

 

It was quite a headache to modify them for the Apple-1 "quirks", such as the non-transparent DRAM refresh, which also does only refresh 64 rows, and not 256 rows as needed by the 64k x 4 DRAMs, and all the other flaws / quirks, such as the ringing signals and the bus timing issues etc.

 

The crystal oscillator issue worried me, hence this thread asking owners of Apple-1 to investigate and take measurements. I want to be confident that all Apple-1 out there can be brought to the proper clock frequency despite most of the crystals that were used are of the "wrong" type. (We have to be pragmatic and take the "old-fashioned" parts we still can get nowadays).

 

I think that use of the "wrong" crystals ("parallel mode") actually is a blessing because these can be tweaked more easily to the proper frequency. With "series mode" crystals this may not be always possible, at least not that easily. Note that "peo2000", in his post #9, used a "series mode" crystal which - theoretically - should oscillate at the 14.31818 MHz it is stamped with, but he measured 7.157032 MHz after the first divider stage (well advised to measure there), which means it oscillates at 14.314 MHz, 4 kHz off target. This is as bad as the "parallel mode" NYMPH crystal which I measured to run at 14.31385 MHz in an Apple-1 with a 74H04. No real difference to be seen in this example. So where are the benefits of buying the "right" (series mode) crystal when the outcome is as bad as with the "wrong" (parallel mode) crystal ?

 

It would be interesting to see if peo2000 can make his oscillator run at 14.31818 MHz by adding a small series capacitor between the crystal and C4 (or isolate C4 and bypass it with the small series capacitor).

 

Maybe I'm a bit too cautious with releasing my projects to the world, but in the end, better safe than sorry. Unlike the original Apple-1, my stuff must work out of the box and be trouble free. I do not want to have a "buyback campaign" to get the troublemakers back to destroy them. Hence, I do a lot of due diligence and beta testing and incremental improvements.

 

 

This takes time, so be patient. When everything is found fit for service, all my designs will published in great detail, and anyone will be able to build them.

CVT
CVT's picture
Offline
Last seen: 6 hours 46 min ago
Joined: Aug 9 2022 - 00:48
Posts: 971
UncleBernie wrote:I think
UncleBernie wrote:

I think that use of the "wrong" crystals ("parallel mode") actually is a blessing because these can be tweaked more easily to the proper frequency. With "series mode" crystals this may not be always possible, at least not that easily. Note that "peo2000", in his post #9, used a "series mode" crystal which - theoretically - should oscillate at the 14.31818 MHz it is stamped with, but he measured 7.157032 MHz after the first divider stage...

 

No, it should be possible with the series crystals just as easily. Every crystal has a series resonance frequency and just above it a parallel resonance frequency. The only difference between the series and parallel crystals is which one of the two frequencies is printed on the can. Other than that, they are physically the same.

 

Regarding peo2000's results: my guess would be that the 7404 chip is also a determining factor. When people put together Apple I machines, some of the crystals they get will be serial, some will be parallel, some will be real and some will be fake. The same applies to the 7404 chips. Hell, some of them might not even be TTL! This is why if I were you I would buy a whole bunch of 14.3181 MHz crystals and 7404 chips from a whole bunch of different places and do this test myself. There aren’t that many people that have frequency counters at home and I don’t think you’ll be able to get 10 people in this thread, which is the absolute minimum in order to make a good determination of the situation.

 

One more thing about the trimmer capacitor in series with the crystal: I can tell you from my experience that you are going to want it there no matter what, for a second and slightly different reason. As you get very close to the 14.31818 MHz frequency and the difference between the two frequencies goes down to just a few hertz, it starts to produce “beating” slow enough to be seen on some displays as slight waves moving in a particular direction. These waves usually appear on one or more colors. On your picture I can clearly see that you have them on all three blue bars and on the magenta bar. This is why if you cannot hit the exact frequency, you should stay away from it and find a frequency where these waves move too fast to be noticeable. This is also the reason I added the ability to fine-tune the color frequency of my ESP32 SoftCard shown in the video of my previous post, which allowed me to successfully get rid of them.

Offline
Last seen: 1 day 10 hours ago
Joined: Apr 1 2020 - 16:46
Posts: 826
Some comments on CVT's post #15

In post #15, CVT wrote:

 

"When people put together Apple I machines, some of the crystals they get will be serial, some will be parallel, some will be real and some will be fake. The same applies to the 7404 chips. Hell, some of them might not even be TTL !"

 

Uncle Bernie comments:

 

Avoid Chinese sellers of electronic components to avoid fake parts. See this thread:

https://www.applefritter.com/content/warning-counterfeit-ds0025-china-oh-no-surprise

This is not 100% safe because distributors may also import fake parts from China, but at least for ICs, most have implemented protocols to screen for fakes.

This is not paranoia - it's really that bad. I get a lot of email from desperate builders who whine about having been defrauded by Chinese selling fake ICs. And with one sole exception, every lot of ICs I have bought from Chinese sellers myself, turned out to be fakes. They went back and I always got my money back, but the loss of RQLT to properly document the fraud and then claw the money back, sometimes via the credit card company, probably was worth 20-30 x the price of the ICs in question.

 

In post #15, CVT wrote:

 

"No, it should be possible with the series crystals just as easily. Every crystal has a series resonance frequency and just above it a parallel resonance frequency. The only difference between the series and parallel crystals is which one of the two frequencies is printed on the can. Other than that, they are physically the same."

 

Uncle Bernie disagrees with that statement. I only agree with the part "physically the same" - I have already mentioned (in my post #12) that the physical construction of "series mode" or "parallel mode" crystals are the same. They are just ground differently to have a slightly different series resonance frequency, which is a property of the crystal alone, describing its motional parameters, which can be measured (the RLC equivalent circuit without the parallel Czero). Alas, "series resonance" in the strict theoretical sense does not exist in any real world oscillator circuit, as no real world circuit  is "ideal" with no parasitic reactances, no delays, and infinite bandwidth. So if you want a on-target frequency for a real  world oscillator, the crystal must be ground to a lower frequency, to allow the circuit to absorb some of the parasitic effects. By intentionally adding well defined reactances in the loop, which must be dominant to the parasitic ones, the oscillation frequency then can be  increased to the desired target frequency. This is why the crystal manufacturers "help" the oscillator designers by making slower crystals and then they specify which "load capacitance" is needed to make it run at the frequency which is stamped on it. These slower crystals are sold as "parallel mode" ones.

 

Back in the 1960s there used to be a type of very expensive crystal called a "calibration crystal" (IIRC) where the series resonance frequency was stamped on the case. You had to put that crystal  in an oscillator with a very high bandwidth  amplifier and only negligible parasitic reactances (the elusive ideal case of "no reactive components in the oscillator feedback loop"). They even went so far to prescribe (and sell) a specific (and expensive) crystal holder for that purpose and for that crystal (see the mind trick ?). So if you were lucky you could build an oscillator which would run, i.e. spot-on at 1 MHz, without any tweaking or tuning and no need for a frequency counter (see the chicken-and-egg problem that has been - partially - solved by that approach ?). Alas, in the end, this was wishful thinking, as you never got exactly the frequency stamped on the can (one specimen I had in ~1972 was stamped "1.00000 Mhz" - LOL, this implies 10ppm accuracy, which you won't get that way). But despite of all this wishful thinking, the oscillator I built with it was much more accurate than using the cheaper crystal I had before by maybe two orders of magnitude. Who would not pay 10 x the price for the crystal and the holder to get 100 x better accuracy ?

 

BEWARE OF THE SERIES RESONANCE TRAP:

 

If you try to run any crystal very close to, or at,  its series resonant frequency, it essentially becomes a resistor with the Czero capacitor in parallel to it (this one is not its motional capacitance, it's just the electrode and can capacitance). In many simple oscillator circuits this leads to weird effects (fluctuations, instability) you better want to avoid by running the oscillator a tad below or above the crystal's intrinsic series resonance frequency (the latter - above - is the normal use case). There must be hundreds of patents and papers on improved oscillator circuits to mitigate these ill effects. Some try to neutralize Czero by using a complicated bridge circuit. Whole books have been written on the topic of crystal oscillators. This is a very tricky subject. But I digress.

 

FOOLPROOF RECIPE

 

In the end it boils down to that  foolproof recipe: get a parallel mode crystal which would run somewhat slower than target frequency and tweak it with a series capacitor (start with a trim capacitor whose maximum is 2 x of the load capacitance specified by the crystal manufacturer) to the target frequency. This is good enough for stable colors in both the Apple II and the Apple-1. As for the Apple II, its two transistor oscillator is the "series mode" type with no obvious reactances, but some of them are lurking within the transistors, the resistors, and the PCB. These are considered "parasitics", and these are not well controlled, as everybody wants to avoid the topic of parasites. This is why it is so hard to find a crystal which runs at the right frequency in an Apple II without adding the series capacitor. (Maybe it was a trick by Apple to thwart the Taiwanese copycats - but those also were smart and had added one or two places for added trim capacitors on their motherboards, so they knew what they were doing).

 

In post #15, CVT wrote:

 

"As you get very close to the 14.31818 MHz frequency and the difference between the two frequencies goes down to just a few hertz, it starts to produce “beating” slow enough to be seen on some displays as slight waves moving in a particular direction. These waves usually appear on one or more colors. On your picture I can clearly see that you have them on all three blue bars and on the magenta bar."

 

Uncle Bernie agrees with the existence of the frequency beat effect between the video signal source and the color subcarrier regeneration oscillator in the TV causing wandering color stripes. So you want to be off from the "ideal" frequency by 100 Hz or so, just tune the trim capacitor until the effect disappears. Not every TV's crystal oscillator is spot on, so a different setting may be needed for each TV to avoid the ill effect.

I think, however, that in case of my Apple-1 video card this is coming from an LDO that is marginally stable. I had no other choice as I could not find any TL431 anymore in my lab, and my original design of the video mixer supply voltage regulator called for that. Alas, the only LDO I could find was SMD and very, very temperamental without the exact capacitor ESR the manufacturer specified. Which I also didn't have. There is more development work to do until the picture quality is where I want it.

 

In post #15, CVT wrote:

 

"There aren’t that many people that have frequency counters at home and I don’t think you’ll be able to get 10 people in this thread, which is the absolute minimum in order to make a good determination of the situation."

 

Uncle Bernie comments:

 

Agree. But it's not only hobbyists who have no frequency counters, they are rare in the electronics industry, too. They threw them out when digitally programmable function generators with calibrated timebases became available. Punch in the frequency you want, and - voila - there it is. This is how you measure your circuits. Back in the 1960s and 1970s the function generators were analog affairs and they had no digital trickery to bring them on target. So you had to pair your analog function generator on the lab bench with a digital frequency counter  having a calibrated time base and then you had to twist the function generator to the desired frequency, and then readjust as it drifted away from what you wanted. Very error prone, tedious, and timewise inefficient lab work. This is why both analog function generators and digital frequency counters went the way of the dinosaur once fully synthesized, digitally programmable function generators with a high precision, calibrated timebase became available. The "dinosaurs" went into the company's electronic junk bin, or they were adopted by hobbyists, mostly ham radio operators who still saw some usefulness in them. When digital readout analog oscilloscopes became widely available in the 1980s, most had frequency counters built in - very easy once you have a microcomputer on board. The modern fully digital oscilloscopes almost all a have frequency counter function built in  - it's software only, so it's as cheap as it can be - and many hobbyists can afford those, and have them. They just might not know that there is a frequency counter hidden somewhere in some sub-menu. Read the manual ! Although, if the scope was Made in China, you better should check it against a known calibrated frequency source. Even the Chinese electronics industry is plagued and victimized by the Chinese counterfeiters. Unless their government cracks down on the counterfeiters, every electronic product from China may not be what it pretends to be, and all bets are off. I could tell you stories - but this post is far too long already.

 

- Uncle Bernie

CVT
CVT's picture
Offline
Last seen: 6 hours 46 min ago
Joined: Aug 9 2022 - 00:48
Posts: 971
UncleBernie wrote:...When
UncleBernie wrote:

...

When digital readout analog oscilloscopes became widely available in the 1980s, most had frequency counters built in - very easy once you have a microcomputer on board. The modern fully digital oscilloscopes almost all a have frequency counter function built in  - it's software only, so it's as cheap as it can be - and many hobbyists can afford those, and have them. They just might not know that there is a frequency counter hidden somewhere in some sub-menu.

...

 

Mine has it too, but according to the manual it's hardware based. I measured the 7M bus pin on my Apple II+, which is modified to NTSC with a parallel crystal and a trim capacitor set to 22pF. I know it to be parallel, because I took it from the chroma processor of a Sony TV (X301 in the TV schematic bellow):

 

 

The frequency I got is 7.15863 MHz, which means the oscillator is running at 14.317260 MHz ±20 Hz. I have a small VNA up to 3GHz that has an accurate generator and the frequency counter of the oscilloscope is showing 7.00001 when I give it exactly 7.000000 MHz, so I am assuming that it's accurate to within 10 Hz.

 

Offline
Last seen: 1 day 10 hours ago
Joined: Apr 1 2020 - 16:46
Posts: 826
Which "small vector analyzer" did you mean ?

In post #17, CVT wrote:

 

"I have a small vector analyzer up to 3GHz that has an accurate generator and the oscilloscope is showing 7.00001 when I give it exactly 7.000000 MHz, so am assuming that it's accurate to within 10 Hz. "

 

Uncle Bernie gets curious:

 

Did you mean "vector network analyzer" ? Which one is it ? The "nanoVNA" ?  - - - since being retired I have no access to the company lab anymore, and tried to find an affordable vector network analyzer but all the big boxes from reputable manufacturers like HP or R&S cost 1000's of USD even if they are 20+ years old. And I don't want to buy a boat anchor, I have enough such boat anchors already. The nanoVNA piqued my interest as it is only $80 new, but again, it comes from China so I can't trust its specs. Just a few weeks ago I had to send back a GPS disciplined 10 MHz timebase which never acquired lock to any GPS satellites. I wasted way too much time trying to find out why. I even placed it in my driveway where my car gets 5+ GPS satellites. Got my ~$120 back but I will never get the time I wasted on it back. They should pay me $600 per hour for my irreplacable RQLT lost on their contraption. So you can see why I'm reluctant to give that $80 VNA a try (fear of more RQLT wasted).

 

Oh, with "software based" frequency counter I did not mean it's software alone. What they typically do is to have a prescaler which can be started / stopped by the time gate, and it can be read out by the microprocessor. Prescaler overflow causes an interrupt and counts up a software counter. So they can have many, many counter bits with only a few real ones in hardware. It's quite amazing to see this kind of precision in such a cheap scope.

 

This is where technical progress works for the hobbyist. At the same time, SMD, BGA, and all the other fine pitch packages for components work against the hobbyist. Sigh. Once the stock of "human fingers friendly" components runs out, it's over.

 

- Uncle Bernie

 

 

CVT
CVT's picture
Offline
Last seen: 6 hours 46 min ago
Joined: Aug 9 2022 - 00:48
Posts: 971
It's this one: http:/

The oscilloscope I got 10 years ago and it was one of those 70 MHz Rigols that are actually 200 MHz, but software locked to 70 MHz. Of course there was an easy hack, which I learned about from David Jones (EEVBlog) that unlocked it to 200 MHz and also unlocked all its protocol decoding capabilities.

 

The VNA is this one: http://miniradiosolutions.com/54-2/

It was 470 euros when I bought it 5 years ago and it was the most affordable small VNA at the time. I think nanoVNA was not out yet.

Offline
Last seen: 3 weeks 2 days ago
Joined: Jun 9 2022 - 01:20
Posts: 19
Here is my results

Hi Uncle Barnie

Tested the frequency using few DM74S04. The most I got was ~7.155.700 Hz from SN7404 ( first pic ).  I replaced with other brands of 7404's and most of them with ~7.154.xxx Hz. The one I got from you was a 74H04...which gave me a ~7.155.200 Hz. is it time to change the Xtal ? 

 

I used an Agilent 53181A Freq Counter ( 225Mhz ). 
CVT
CVT's picture
Offline
Last seen: 6 hours 46 min ago
Joined: Aug 9 2022 - 00:48
Posts: 971
kalustian wrote:... is it
kalustian wrote:

... is it time to change the Xtal ? 

 

Don't bother, there is nothing wrong with the crystal. It's just a crappy oscillator circuit. I built it on an experimental board so I can try all the 7404 chips in my spares. I have two serial 14.250.450 MHz crystals that came from european Apple IIs and give me exactly the same results with the various chips. One of them is on the board, the other is the topmost NYMPH 197-0002. Here are the results:

(For this test the trim capacitor was shorted with a jumper and the potentiometers were set to exactly 390 Ohms.)

 

ChipFreq. when cold (MHz)Freq. when warm (MHz)
SN 740414.244.30014.244.200
Tesla MH740414.243.80014.243.700
SN 54LS0414.241.80014.241.700
К531ЛН1 (74S04)14.247.20014.246.200
К155ЛН1 (7404) (1081)14.239.80014.238.300
К155ЛН1 (7404) (1183)14.240.70014.240.600

 

I also tried a whole bunch of crystals in the 14 - 16 MHz range with the SN7404 and the frequency I get is always about 6 kHz under what is written on the can. Of course this can be mitigated using the trim capacitors or to some degree using the 1k potentiometers, which I put in place of the two 390 Ohm resistors.

 

Of course for the normal operation of an Apple I with a monochome display this is not important.

 

Offline
Last seen: 3 weeks 2 days ago
Joined: Jun 9 2022 - 01:20
Posts: 19
My new apple-1 with variable cap

 

Here is my apple -1 with the varible cap from Uncle Bernie's kit.

 

 

 

Log in or register to post comments