Skip to the content
4 layers161.6 × 100 mmNubus to ztex, the printed circuit board in 3D

Stuff to put a FPGA in a NuBus Macintosh

Size
161.6 × 100 mm
Copper layers
4
Thickness
1.6 mm
Parts
103
Nets
207
Pads
691
Tracks, vias
5,227, 164
Pours
5
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
21 Dec 2021
Updated
18 May 2024

Overview

Nubus to ztex is an open-source printed circuit board by MelkhiorVintageComputing, from the MelkhiorVintageComputing/NuBusFPGA repository on GitHub. It is a 4-layer board of 161.6 × 100 mm with 103 parts on 207 nets, routed with 5,227 tracks and 164 vias.

It is built around the SN74LVT245BPWRE4, DM3CS-SF and SRV05-4, with the TPS2051CDBV among its other parts. Its parts include 32 capacitors, 32 resistors, 13 ICs, 12 diodes and 8 connectors. It belongs with the fPGA and programmable logic boards of this library.

Main components

4

README

README.md

A FPGA on a NuBus card...

Goal

The goal of this repository is to be able to interface a modern (2021 era) FPGA with a NuBus host, specifically Apple's Macintosh II and Macintosh Quadra. NuBus was widely used by Apple and a little by others (such as NeXT), but was progressively displaced by PCI from the mid-90s onward, and is thoroughly obsolete.

So unless you're a retrocomputing enthusiast with such a machine, this is useless. If you are such an enthusiast, then maybe the ability to connect a modern LCD monitor using a digital interface to an old Macintosh might be of interest to you.

This project was 'spun off' the SBusFPGA, a similar project for the SBus used in Sun's SPARCstation.

Current status

First prototype is working in a Quadra 650, running MacOS 8.1. It implements a single-screen-resolution, windowboxed multi-resolution, depth-switchable (1/2/4/8/16/32 bits) framebuffer over DVI-in-HDMI-connector (will work with any HDMI-compliant monitor). The framebuffer can be used as secondary/primary/only framebuffer in the machine running OS8.1. Qemu tests indicate this should work with 7.1 & 7.5/7.6 as well. An alternate HDMI PHY also supports audio, enabled as a 8/16 bits, mono/stereo, 44.1 kHz output component in MacOS.

Some basic acceleration now exists for 8/16/32 bits, doing rectangle screen-to-screen blits and pattern rectangle fills. 1/2/4 bits also has some acceleration, but only for byte-aligned cases.

There's also a basic RAM Disk using the 248 MiB of SDRAM not used by the framebuffer. The driver can use either synchronous direct access to the memory by the CPU, or asynchronous using DMA (using 16-bytes blocks). Frustratingly, the direct access methode seems faster.

The hardware

Directory 'nubus-to-ztex'

The (now obsolete) V1.0 custom board is a NuBus-compliant (I hope...) board, designed to receive a ZTex USB-FPGA Module 2.13 as a daughterboard. The ZTex module contains the actual FPGA (Artix-7), some RAM, programming hardware, etc. The NuBus board contains level-shifters & drivers ICs to interface between the NuBus signals and the FPGA, a CPLD handling some level-shifting & the bus mastering arbitration, a serial header, two user Leds, 14 debug Leds tied to specific NuBus or CPLD/FPGA signals, a JTAG header, a USB micro-B connector, a VGA chip & connector, and a HDMI chip & connector. It supports every NuBus feature except the optional parity (i.e. it can do both slave and master modes). The V1.0 board is in commit 3f3371a. The CPLD solution works but is annoying as it requires older Xilinx software (ISE 14.7) and dedicated JTAG programmer to use.

The current board is V1.2. It drops the CPLD and VGA port. Bus arbitration is now done inside the FPGA. It gains a micro-sd slot, and a custom expansion connector that is based (and compatible with, with more signals) PMod. It supports the same accelerated HDMI framebuffer and RAM Disk. Optionally, The Declaration Rom can be stored in a Flash NOR chip connected ot the PMOd expansion connector (easier for working on embedded driver in the DeclRom). The ROM can alternately be stored in a sector of the config flash from the ZTex board on any *FPGA.

The new (July 2023) ZTex USB-FPGA Module 2.12 is theoretically compatible with all *FPGA, but at this stage there is some issue when using the 2.12b I own. Some further tests are planned.

The PCBs were designed with Kicad 5.1

The gateware (Migen)

Directory 'sbus-to-ztex-gateware'

The gateware is written in the Migen language, choosen because that's what Litex uses. It implements a simple CPU-less Litex SoC built around a Wishbone bus, with a custom bridge between the NuBus and the Wishbone.

A Declaration ROM, a SDRAM controller (litedram to the on-board DDR3), and the 'Goblin' multi-depth framebuffer can be connected to that bus. Other devices could be added, see the SBusFPGA or the Common directory, but the software support is missing; vintage System 7/MacOS 8 are not as welcoming to new devices as modern NetBSD. Theoretically, quite a bit of code originally written to support the SBusFPGA in NetBSD/sparc could be reused for similar devices in NetBSD/mac68k, but it has not happened yet.

The SDRAM has its own custom DMA controller, using native Litedram interface to the memory, and some FIFO to/from the NuBus. A custom MacOS driver exposes it as a volatile drive. Driver can use synchronous direct accesses from the CPU (using the NuBus's superslot area), or asynchronous (interrupt-driven) DMA transfers using NuBus 1x block transfers.

The software

The Declaration ROM is in the subdirectory VintageBusFPGA_Common/DeclROM and includes the driver needed for the unaccelerated framebuffer and the RAM Disk. It needs the Retro68 toolchain to build.

The code for the NuBusFPGAInit (which should be renamed and enables acceleration) is in NuBusFPGAInit/, and will need a CodeWarrior INIT project to build, on a real Macintosh or an emulated one using e.g. Qemu. It enables graphic acceleration.

The code for the Audio component (which enables audio support over HDMI when using the alternate PHY) is in NuBusFPGAHDMIAudio/.

FAQ

  • Can the framebuffer change resolution ? Yes and no. The gateware has a default resolution baked into it that the device will use by default, and can use one of two different physical interface (PHY): the Litex-derived one (which uses DVI signalling) or a more HDMI-like one in verilog. "windowboxed" mode is always availeble, where a smaller esolution is displayed in the middle of the larger screen, which you can select in System 7/MacOS 8 with the Monitor control panel. When using the Litex PHY, some resolution are also available as "hardware" resolution, outputing the appropriate signalling - but the Litex PHY doesn't support audio. The alternate PHY does support audio, but doesn't allow to use a different output resolution, only Full HD (1920x1080) and does support audio output.

  • Is Audio supported ? Yes and no. a 8 or 16-bits, audio or stereo, 44.1 KHz audio device is available but nly when using the alternate HDMI PHY (see previous question)

  • Is USB supported ? No. There is a USB connector, but it is currently useless. The gateware could include a USB OHCI host device, and that is supported in the SBusFPGA under NetBSD. However, no Apple OS running on a 68k Mac has any support for USB, so it would require an entire USB stack to be ported, which is a huge undertaking. Also, NuBus is quite a slow bus even by early 2000s standard, and USB OHCI does a lot of DMA all the time, which would use up most if not all (or maybe more than all!) the available bandwidth. There might be some support in NetBSD/mac68k eventually just to test feasibility, but it even there it's unlikely to be useful.

  • Is micro-sd supported ? Not yet. Hopefully at some point the micro-sd card will be usable as permanent storage in System 7/MacOS 8, but so far it's not working.

  • Where is the ROM stored ? By default the Declaration ROM is stored inside the FPGA bitstream, so the bitstream must be regenerated for every ROM change. It is possible to store it in a SPI Flash NOR chip instead, connected via the expansion connector (PMod-like) at the back of the NuBusFPGA. My own PMod featuring a SPI Flash NOR and an I2C temperature monitoris available in the VintageBusFPGA_Common repository, along with an adapter board to program the SPI FLash NOR through the SPI interface of a Raspberry Pi and flashrom.

  • Is I2C supported ? No. Like USB, I2C doesn't have support in System 7/MacOS 8. It's a lot simpler than USB though. Reading values from a lm75-compatible temperature monitor from System 7/MacOS 8 might be doable, but isn't currently planned. Support for NetBSD/mac68k should be reasonably easy to add as it's already supported in NetBSD/sparc for the SBusFPGA, and unlike USB there's no issue with bandwidth-hungry DMA.

  • How about adding Ethernet ? Software is the issue. Ethernet is supported by the gateware infrastructure, and a prototype design to add Fast Ethernet via RMII through the expansion connector is available. However, there is currently no software support for it. There's some documentation from Apple, and there's an example driver available, but the System 7/MacOS 8 driver for LiteEth is still to be written. The SEthernet project is a much more likely source of Ethernet for '030-based system.

  • Why slow NuBus, when PDS is so much faster ? NuBus is well documented, and electrically quite isolated from the rest of the machine. Safer to play with than PDS which is directly connected to the CPU. And the connector for it it still in general use and easy to get. And NuBus is available on multiple generations of machines. My primary machine for this is a Quadra 650, with a 68040 and the associated PDS. Unfortunately, the connector for that PDS is near impossible to get nowadadays (specifications are there). '030 PDS uses 120-pins DIN 41612, similar to bur larger than NuBus' 96-pins. They are also available, but less common. But there is a catch - although sharing a connector board-side, the IIsi, SE/30 and IIfx pinouts are slightly different. And the LCIII is completely different. Also - see IIsiFPGA and QuadraFPGA :-)

Parts

103
QtyValueFootprintReferences
20100nFCapacitor_SMD:C_0603_1608MetricC1, C2, C4, C11, C12, C14, C15, C17, C18, C19, C22, C23, C24, C26, C27, C30 +4
1610kResistor_SMD:R_0603_1608MetricR4, R5, R6, R7, R26, R27, R36, R37, R38, R39, R40, R41, R42, R43, R44, R45
12560Resistor_SMD:R_0603_1608MetricR1, R2, R3, R11, R12, R13, R14, R15, R16, R17, R18, R19
5YELLOW Led 0603LED_SMD:LED_0603_1608MetricD6, D7, D8, D9, D10
41uFCapacitor_SMD:C_0603_1608MetricC16, C29, C31, C32
447uF 10V 1206Capacitor_SMD:C_1206_3216MetricC3, C10, C21, C28
4GREEN Led 0603LED_SMD:LED_0603_1608MetricD11, D12, D13, D14
4SN74LVT245BPWRFor_SeeedStudio:TSSOP-20_4.4x6.5mm_P0.65mm_ForSeeedStudioU5, U6, U7, U8
327Resistor_SMD:R_0603_1608MetricR8, R22, R23
3SN74CB3T3245PWRFor_SeeedStudio:TSSOP-20_4.4x6.5mm_P0.65mm_ForSeeedStudioU13, U14, U15
3SN74LVTH125PWRPackage_SO:TSSOP-14_4.4x5mm_P0.65mmU1, U2, U3
210nFCapacitor_SMD:C_0603_1608MetricC13, C20
277313-101-64LF (2x32 M 2.54mm)For_SeeedStudio:PinHeader_2x32_P2.54mm_Vertical_For_SeeedStudioJAB1, JCD1
2RED Led 0603LED_SMD:LED_0603_1608MetricD1, D2
110029449-111RLF (HDMI A)For_SeeedStudio:HDMI_A_Amphenol_10029449-111J5
1100uF 1206 (officially 150 uF ? could be >= 100 uF or even less probably)Capacitor_SMD:C_1206_3216MetricC25
110118194-0001LF (USB micro-B)Connector_USB:USB_Micro-B_Amphenol_10118194_HorizontalJ6
110nF 1kV 0805Capacitor_SMD:C_0805_2012MetricC7
11M 500V 1206Resistor_SMD:R_1206_3216MetricR9
1640456-3 (Fan)Connector_Molex:Molex_KK-254_AE-6410-03A_1x03_P2.54mm_VerticalJ7
185003-0567 (DIN 41612C 3x32 pins)For_SeeedStudio:DIN41612_C_3x32_Male_Horizontal_THTJ4
187831-1420 (2x7 M 2mm)For_SeeedStudio:PinHeader_2x07_P2.00mm_Vertical_For_SeeedStudioJ1
1A2541HWR-2x8P (Pmod 2x8 F)For_SeeedStudio:PinSocket_2x08_P2.54mm_Horizontal_ForSeeedStudioJ8
1ASE-xxxMHzOscillator:Oscillator_SMD_Abracon_ASE-4Pin_3.2x2.5mmX1
1BLUE Led 0603LED_SMD:LED_0603_1608MetricD3
1Conn_01x06_MaleFor_SeeedStudio:PinHeader_1x06_P2.54mm_Horizontal_For_SeeedStudioJ3
1DM3CS-SFFor_SeeedStudio:HRS_DM3CS-SFP1
1Ferrite_Bead_SmallInductor_SMD:L_0805_2012MetricFB1
1LogoLitexFor_SeeedStudio:litex_logoGRAPHIC1
1MountingHole_PadMountingHole:MountingHole_2.2mm_M2_PadH1
1SRV05-4Package_TO_SOT_SMD:SOT-23-6U4
1TPD12S016PWRFor_SeeedStudio:SOP65P640X120-24NU9
1TPS2051CDBVPackage_TO_SOT_SMD:SOT-23-5U11

Similar boards

  • 4 layers99.7 × 83.8 mmSbus to ztex, the printed circuit board in 3D

    Sbus to ztex

    MelkhiorVintageComputing/SBusFPGA

    Stuff to put a FPGA in a SBus system (SPARCstation)

    64 parts54
  • 4 layers15.2 × 19 mmOpenlager, the printed circuit board in 3D

    Openlager

    d-ronin/openlager

    STM32F4 based logging dongle for HIGH RATE logging

    30 parts111
  • 8 layers42.2 × 67.2 mmOBC PCB, the printed circuit board in 3D

    OBC PCB

    timohueser/OpenBikeComputer

    Open source Bikecomputer with a focus on exploration and adventure.

    186 parts11GPL-3.0
  • 4 layers33.3 × 93.7 mmActiveImpactor Control, the printed circuit board in 3D

    ActiveImpactor Control

    harrislab-brown/CyberDiver

    Untethered cyber-physical robotic platform for water entry experiments

    124 parts2CC-BY-SA-4.0
  • 8 layers102.2 × 100 mmRfsom01, the printed circuit board in 3D

    Rfsom01

    Bonafide116/rfsom01

    336 parts
  • 2 layers93.8 × 73.5 mmSimplerFlightV2, the printed circuit board in 3D

    SimplerFlightV2

    elenajusto/SimplerFlightV2

    PCB for team rocket air brakes. (Never manufactured).

    114 parts
  • 2 layers132 × 56 mmDashboard, the printed circuit board in 3D

    Dashboard

    marcutudor79/electronic-module-for-the-dashboard-of-upbdrive-racing-car

    My Bachelor's degree that consists of the electronic module for the Formula Student race car and it's testing module

    127 partsApache-2.0
  • 4 layers102.2 × 90 mmDAQ Back Board, the printed circuit board in 3D

    DAQ Back Board

    NU-Baja-SAE/hardware

    Hardware: KiCad schematics/PCBs, wiring harness, BOM tooling

    59 parts

Questions

How big is the Nubus to ztex PCB?

It measures 161.6 × 100 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Nubus to ztex use?

103 parts, built around the SN74LVT245BPWRE4, DM3CS-SF, SRV05-4 and TPS2051CDBV. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Nubus to ztex KiCad files?

From the MelkhiorVintageComputing/NuBusFPGA repository on GitHub, at the commit this page was made from: the board is nubus-to-ztex/nubus-to-ztex.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Nubus to ztex design in my own project?

Its repository states no licence, so its author keeps all rights: ask MelkhiorVintageComputing before reusing the design.