• ### 7404/14 - Not all inverters are the same.

10/28/2023 at 04:21 0 comments

The Problem:

While debugging the HB6309 PCB REV1 I wanted to build a very stable oscillator I could drive the CPU and the Arduino with, I knocked together my standby: 1/2 of a 74HC00 and a 1K resistor and crystal with fairly mediocre results:

This is actually a very popular oscillator with hobbyists, and if were totally honest it works 90% of the time with no issues for the kinds of  projects that we tend to gravitate towards.  Even Grant Searle himself, uses the design in at least one of his Z80 builds.  The biggest problem with this design (as you will see), is the inverter, a buffered NAND Gate, while its logical output is the same - its switching characteristics and internal circuitry are VERY different.

Before we get started, a gentle reminder to readers not familiar with my content.  I am a hobbyist, and not a EE.  I do have a very strong background in Civil Engineering in the telecommunications field, so if some of my examples or explanations are wrong - feel free to correct me! (we are all here to learn)

The issue:

The internals of the 74HC00, we see the buffered inputs, while insuring proper logical signal triggering, actually dampen the analog properties of the circuit.   Additionally clamping diodes on the input (and output) of the inverter may play a roll as well, though certainly not nearly as much as introducing buffers to the circuit:

Just looking at the expanded circuit, you can see this is not even approaching a proper Pierce Oscillator.  The root cause of the ringing are almost certain due to The first stage -  to understand this better, lets look at a few different buffered inverters hooked up with a much better circuit recommended by Olin Lathrop on stack exchange

This circuit is considerably more suited to producing a very defined square wave.  The first two buffers trigger the initial oscillation using a 1M Ohm resistor hooked in parallel.  We see a sine wave (more or less, more on that in a second) on the input of 1A. A second inverter (1B) takes the trapezoidal output and cleans it up further.   The second stage is a Schmidt Trigger, which introduces Hysteresis into the circuit, the first gate acts as sort of an amp to the second gate which drives the triangle wave produced by the first into a serviceable Square wave.  Why not use just Schmidt triggers then?

Essentially, the first inverter is a linear amplifier - we know this because the 1M Ohm resistor from the input to the output acts as a bias to the input of the gate. This amplifier takes the relatively low sine wave output of the crystal, and turns it into a 5v PtP ish square wave.  A Schmidt trigger is highly non linear (the whole point is to make the signals snap to the rails as happens in the second stage of the circuit),  this is wonderful for generating a cleaner square wave than produced by 1B, but not so good as a linear amp.

I got curious so I built the circuit with a 74HC14:

This is the input of the first gate, see how the signal here is very non-linear, also note the fringing around the edges; on a digital scope this would be rolling like crazy as the time base changes, additionally the amplitude fluctuates as well -- this would be a wonderful circuit to analyze on a spectrum analyzer (unfortunately for me I only have access to that at work, and certainly not in a format I can probe a simple circuit I built at home)

The output IS technically a VERY defined square wave, but the time base is severely effected by the multiple triggers, interfering as the time base shifts:

Then I tried the 74HC04:

I kind of knew the results would be fairly similar to the simple 1/2 NAND solution:

Basically - this is the same though the multiple inverters pronounce the ringing on the High level base instead of the low level base.  (this is also with a small value approx 33 Ohm dampening resistor on the output...

• ### ZX-81 Restoration news:

03/13/2023 at 17:00 0 comments

I moved development of the ZX-81 off the pages updates and to it's own Hack-a-Day project here : https://hackaday.io/project/189795-hbkd-81 if any body was following this space for updates on the restoration they are there :)

• ### HBSound Block diagrams from my lab notebook

01/30/2023 at 04:13 0 comments

Here's some block diagrams for the HBSound project I pulled from my notebook:

I'll link the next ZX-81 blog here if you are wanting to skip to the next segment when that comes, right now waiting on a replacement modern ULA to be delivered from New Zealand.   Hope to have more updates on that soon but for now enjoy my sloppy handwriting