• HB63C09 Mezzanine Connection

    01/21/2024 at 02:31 0 comments

    The mezzanine, your gateway to off board IO

    Going over the memory map from the REV3 board, the astute will notice the entire IO range selects the AVR request grant logic. This poses an issue for off board requests from the mezzanine connection. To resolve this, the XSIN (transceiver inhibit) signal is utilized. XSIN is a active high signal (for now) that cuts off the bus transceiver output enable pin. This in effect leaves the bus available to the mezzanine connection:

    When the loop starts inside the firmware the AVR (an ATMEGA32E micro controller)  is just poling for IO requests. When it catches one, the MRDY state is already asserted on the CPU and the buses and the E and Q pulses stop in the state that they were in. This includes the data bus, r//w line and the address bus (along with all the other control signals as well). Immediately following this, it reads the XSIN line and determines if it is high. If so the IOGNT_ signal is immediately sent to the request/grant circuit and the read / write cycle can continue. This does have the disadvantage of added delay and a momentary clock stretch on every IO request, however it is very short, only a few cycles of the system clock. This was a needed trade of to keep the selection logic as simple as possible without expanding to a higher chip count.

    In order to use the mezzanine expansion connector, the IO request logic must be replicated on the expansion. The IO request must also be assigned to an unused address in the IO range (for example, any address in A010-AFFF). The selection signal must be active high and linked to the XSIN line, which means that a standard address decoder must either have active high outputs or be inverted before using the signal. The XSIN pin is an input on the AVR, and it is pulled low by a 10k resistor. Only one output on the expansion should select this pin, because the logic on this line is push pull and multiple signals driving the pin high could cause a short circuit. During reset the AVR pulls this line high to zero the bank register. Currently I can not test the mezzanine until I resolve the potential short circuit. This is likely to change to simply having the reset pin for the register driven by RES (inverted RES_, which is generated by the reset circuit) but it was not high on the list of things to work out in this board revision, and so it was omitted. I am also considering changing the functionality of the pin XSIN to active low, by building out logic. Since the actual scope of the signal is for only one device it makes better sense to not make this a priority over other things which could potentially take more board space. The advantage to this is all of the signals going into XSIN could be open collector outputs and this would drastically increase the usefulness of the signal in a multi-slot expansion set up, if for instance somebody were to build a breakout with multiple slots.

    If you'd like to learn more about the HB63C09M follow this link to the main project page.

  • 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...

    Read more »

  • 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 :)