Skip to the content
2 layers52 × 90 mmEmu brd, the printed circuit board in 3D

A RP2040 based DECstation emulator

Size
52 × 90 mm
Copper layers
2
Thickness
1.6 mm
Parts
86
Nets
114
Pads
417
Tracks, vias
888, 117
Pours
6
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
1 Jul 2024
Updated
20 Jul 2024

Overview

Emu brd is an open-source printed circuit board by rscott2049, from the rscott2049/DECstation2040 repository on GitHub, published under the BSD-3-Clause licence. It is a 2-layer board of 52 × 90 mm with 86 parts on 114 nets, routed with 888 tracks and 117 vias.

It is built around the RP2040, LAN8742A-CZ and TLV751180330PDSQR, with the TXS0108ERGYR, TXV0106BQBR and ECS-120-20-23B-TR among its other parts. Its parts include 30 resistors, 28 capacitors, 11 connectors, 7 ICs and 1 crystal. It belongs with the RP2040 boards of this library.

Main components

7

README

README.md

DECstation 2040

1.0 Introduction

This document outlines the DECstation 2040, a RP2040 based DECstation 3000 emulator that can run DECWindows. A summary of features:

Hardware:

  • RP2040, running at 1.8v/300 MHz
  • 32 MB of PSRAM
  • 8 MB SPI flash
  • uSD card socket
  • Monochrome VGA at 1024 x 864
  • Ethernet RMII PHY support (socket on rev 1.5, integrated in rev 2.1)

Software:

  • 4 port PSRAM PIO engine
  • PIO driven VGA, with seperate 16x16 cursor plane overlay
  • USB HID to DECWindows keyboard and mouse

1.1 Software

PIO:

The PSRAM/HyperRAM PIO engine provides 42/32 MB/s (write/read) of memory bandwidth. Further, four PIO engines are used to provide four seperate read/write memory ports. This allows independent memory access for the emulated CPU, video DMA, and receive/send Ethernet traffic. Note that all 32 instruction slots are used.

The video PIO engine can support up to a sysclk/2 pixel rate. Thus, for the 300 MHz sysclk typically used, it is possible to run 1080p60 at a pixel rate of 148.5 MHz. The default video rate is 1024 x 768 @ 70Hz, as this matches the screen used for development and the pixel rate is an integral divisor from sysclk. Only five PIO instruction slots are used.

DMA:

To drive the video PIO engine, five DMA channels are used. They are allocated as follows:

  • ctrl_dma_chan - points to DMA channel command packets
  • data_dma_chan - executes DMA command packets
  • ps_read_chan - points to PSRAM read data buffer
  • inc_dma_chan - used to generate loop counter indices
  • cur_inc_dma_chan - used as cursor loop counter

This project uses the RP2040 DMA sniffer to dynamically generate PSRAM addresses, which eliminates the need to have a per-line PSRAM command packet. Further, it uses the inc_dma_chan to enable DMA command loops, eliminating per-line DMA commands needed to send commands to the PIO pixel and PSRAM PIO engines. This makes the amount of memory needed to drive video independent of the display format. Currently, 86 DMA command packets are used vs. approximately 2250 required for 1080p if a per-line DMA structure was used.

In order to eliminate the latency from when the PSRAM PIO engine FIFO has read data, and its delivery to SRAM, we use the ps_read_chan. This channel is chained to after a PSRAM DMA command is executed. Without this channel, the PSRAM PIO engine FIFO would be not be emptied until the next DMA command is executed. This impacts the non-video PSRAM channels, as they must wait unitl the video PSRAM command is complete.

USB:

The USB HID code supports (at least) two keyboard/mouse combo types: Rii mini X1 (model: RT-MWK01), purchased at MicroCenter, and Logitech K830.

Emulator:

Dmitry's code at http://dmitry.gr/?r=05.Projects&proj=33.%20LinuxCard was modified to support the RP2040, as well as adding support for video and USB mouse/keyboard input. With overclocking and running the assembly language version of the CPU emulator, Dmitry's Linux image reports a BOGOMIPS rating of 13.44.

2.0) Getting started

2.1) Hardware

Build either rev 1.5 or 2.1, using the appropriate emu_brd directory. Please note that rev 2.1 is still undergoing Ethernet debug, and has exhibited significant packet drops. I use JLCPCB for board fabrication, and there are Digikey BOM spreadsheets in doc/bom. Recommend building two boards: one to use as a 1.8v CMSIS debugger, and the other as the target. Feel free to only populate the RP2040 related components on the CMSIS debugger.

The surface mount parts aren't too troublesome - I find the PSRAM BGA to be much easier to solder than the RP2040 QFN. My technique is to use a hot-air SMT rework tool. Recommended assembly steps:

  1. Solder the voltage regulator, check for 1.8v and 3.3v when done.
  2. Solder all of the passives, the RP2040, flash, and the USB connectors if building rev 2.1. (Note that two bodge wires are needed to connect J5 and J11 D+/D- as my assumption that USB-A could serve as non-host connector was incorrect). When done, use blink_bringup (below) to check connections. (Edit blink.c to enable the pins to check).
  3. Solder the HyperRAM chip, run mem_test to check connections.
  4. Solder the voltage translator chips, edit blink.c and run to check connections.
  5. Solder the connectors.

For rev 1.5: Needs modified waveshare LAN8722 board. In addition to the modifications outlined at: https://github.com/maximeborges/pico-rmii-ethernet, pin 13 of the 7 x 2 connector (originally NC) is used as VDDIO for the LAN8722 chip. To make this modification, cut the existing connection between LAN8722 pin 9 to 3.3v, and route pin 9 to pin 13 of the connector. This allows the use of 1.8v I/O from the DECstation 2040 board. Also needed is a 6 pin header to VGA connector. See rev 2.1 schematic for VGA pins needed.

2.2) Software

Start with: http://dmitry.gr/?r=05.Projects&proj=33.%20LinuxCard Download the images, particularly the ultrix.gui image. This should be placed on a FAT32 for uMIPS. Edit uc_main.c to select which image to run.

Next, go to where this README.md is stored. Then set current directory to sw. Edit the "source_this" file to reflect the location of the Pico SDK, and source this file to set the PICO_SDK environment variable for the current session.

A good place to start is with the blink_bringup directory. CD to this, and do:

cmake -B build -S .

Build software via

./build.sh

This will generate an .elf file in build/src. Use picotool to load this onto the target board. After rebooting, should get "hello, world" on USB serial, as well as on the hardware serial port. A 500 Hz square wave should be present on GPIO21 (ret_clk). This can be changed via editing the src/blink.c file. I use this tool incrementally while soldering the board, to verify connectivity.

Next, build the CMSIS debugger. CD to the picoprobe directory and build with:

cmake -B build -DCUSTOMPROBE=1 make -C build

Program with

sudo picotool load build/customprobe.elf

Now go to the psram directory and do:

cmake -B build -S .

Build software via

./build.sh

This will generate most of the available packages. Of interest are:

  • mem_test - a simple memory tester
  • fb_test - test program for the frame buffer library
  • fb_mem_test - memory test with frame buffer enabled
  • pico-rv32ima - RISC-V linux emulation
  • uMIPS - DECstation emulation
  • pico_rmii_ethernet_httpd - test program for RMII.

There are shell scripts to load the above:

  • cl_sram.sh - sd command line
  • eth_sram.sh - ethernet test
  • fb_flash.sh - framebuffer library test, run from flash
  • fb_sram.sh - framebuffer library test, run from SRAM
  • fbm_flash.sh - memory test with framebuffer enabled, run from flash
  • fbm_sram.sh - memory test with framebuffer enabled, run from SRAM
  • mt_sram.sh - memory test, run from SRAM
  • mt_flash.sh - memory test, run from flash
  • um_flash.sh - uMIPS emulator, run from flash
  • um_sram.sh - uMIPS emulator, run from SRAM

Running the code: Connect the debugger board to the SWD port on the target. Start the CMSIS debugger via sw/start_cmsis.sh. Execute one of the scripts above. This will load the program into RP2040 SRAM and start it.

If you wish to run from flash, comment out the no_flash line in the source CMakeLists.txt. Note that the uMIPS emulator requires "copy_to_ram" to be enabled when running from flash.

3.0) Commentary

This project has been a voyage of discovery. The first doc/build_log.txt entry was on 23-mar-2023, but I'd been thinking of building a business card ever since I'd read Dmitry's LinuxCard web page. I've learned how to use the RP2040 PIO engines and the DMA subsystem to push pixels. I'm amazed at how flexible and capable the RP2040 has turned out to be. Hats off to the RP2040 designers!

Most enjoyable moments:

  • When the PSRAM PIO engine finally ran the memory test overnight.
  • When the second solution to the problem of how to get the DMA subsytem to do a counted loop actually worked without killing SD card access.
  • When the DMA cursor read data during blanking worked, giving smooth cursor movement.

Less than enjoyable moments:

  • Realizing the "optimization" of reordering data on the PSRAM to improve layout was wrong, after submitting the design to JLCPCB.
  • Realizing that the first flash part chosen didn't support "Continuous Read Mode". On the other hand, this did force me to learn how to do SRAM builds, speeding up development.
  • Having the wrong footprint for the level translator on rev 1.3.
  • Finding out that Digikey no longer stocked the Ethernet connector on rev 2.0, after submitting PCB. Related - the PSRAM was out of stock, so clicked on the recommended alternative. Was disappointed when the box showed up, and it was the waferscale part. Tiny, but unsolderable.

4.0) Next steps

5.0) Acknowledgements

This project would not exist without Dmitry's excellent LinuxCard project, at: http://dmitry.gr/?r=05.Projects&proj=33.%20LinuxCard

Inspiration and software framework: https://github.com/Wren6991/PicoDVI.git

DEC mouse and keyboard support used code from: https://hackaday.io/project/19576-dec-mouse-adapter and https://github.com/pkoning2/lk201emu.git

Ethernet: https://github.com/maximeborges/pico-rmii-ethernet

Also, Hackaday.com for articles on SMT soldering, USB-C, etc., giving me confidence that I could actually do this project!

Pictures/video

A selection of pictures from doc/photos follows. See doc/photos for pictures of previous versions and how the emulated video output progressed from first pixel to current.

Video showing Xmaze/worms running

Rev 1.5

Rev 1.5

Rev 1.5

Rev 1.5 running

Rev 2.1

Rev 2.1

Rev 2.1

Rev 2.1 running with Logitech keyboard

Helper cat in the parts box

Helper cat in the parts box

Parts

86
QtyValueFootprintReferences
16100nCapacitor_SMD:C_0603_1608MetricC6, C7, C8, C9, C11, C12, C13, C14, C15, C16, C20, C21, C23, C24, C25, C27
710kResistor_SMD:R_0603_1608MetricR21, R22, R24, R25, R26, R27, R28
510uCapacitor_SMD:C_0805_2012MetricC1, C2, C3, C17, C19
449.9Resistor_SMD:R_0603_1608MetricR29, R31, R34, R35
4Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ3, J6, J7, J10
4MountingHoleMountingHole:MountingHole_2.7mm_M2.5H1, H2, H3, H4
310Resistor_SMD:R_0603_1608MetricR18, R19, R20
310KResistor_SMD:R_0603_1608MetricR6, R8, R12
3280Resistor_SMD:R_0603_1608MetricR9, R10, R11
21kCapacitor_SMD:C_0603_1608MetricR2, R5
21uCapacitor_SMD:C_0603_1608MetricC10, C18
227Capacitor_SMD:C_0603_1608MetricR3, R4
227pCapacitor_SMD:C_0603_1608MetricC4, C5
2330Resistor_SMD:R_0603_1608MetricR32, R33
2Conn_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ2, J8
2SolderJumper_2_BridgedJumper:SolderJumper-2_P1.3mm_Bridged_Pad1.0x1.5mmJP3, JP4
10.022u/1KVCapacitor_SMD:C_0603_1608MetricC28
110ufCapacitor_SMD:C_0805_2012MetricC22
112.1kResistor_SMD:R_0603_1608MetricR30
133Resistor_SMD:R_0603_1608MetricR23
1470pfCapacitor_SMD:C_0603_1608MetricC26
1D+_TPTestPoint:TestPoint_THTPad_D1.0mm_Drill0.5mmTP1
1D-_TPTestPoint:TestPoint_THTPad_D1.0mm_Drill0.5mmTP2
1DE15_Receptacle_HighDensity_MountingHolesemu_brd:CONN_L77HDE15SD1CH4FVGA_AMPJ1
1DNFCapacitor_SMD:C_0603_1608MetricR1
1DNPResistor_SMD:R_0603_1608MetricR7
1ECS-120-20-23B-TRemu_brd:XTAL_ECS-120-20-23B-TRY1
1FerriteBeadInductor_SMD:L_0603_1608MetricFB1
1LAN8742APackage_DFN_QFN:VQFN-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mm_ThermalViasU6
1Micro_SD_Card_Det_Hirose_DM3ATConnector_Card:microSD_HC_Hirose_DM3D-SFJ4
1PSRAM_32Memu_brd:BGA25C100P5X5_800X600X120NU4
1RB1-125BAG1Aemu_brd:WIZNET_RB1-125BAG1AJ9
1RP2040RP2040_minimal:RP2040-QFN-56U3
1TLV751180330PDSQRemu_brd:SON40P200X200X80-11NU1
1TXS0108ERGYRemu_brd:RGY20_3P05X2P05U5
1TXV0106BQBRPackage_DFN_QFN:DHVQFN-16-1EP_2.5x3.5mm_P0.5mm_EP1x2mmU7
1USB_AConnector_USB:USB_A_Molex_67643_HorizontalJ5
1USB_B_MicroRP2040_minimal:USB_Micro-B_Amphenol_10103594-0001LF_Horizontal_modifiedJ11
1W25LQ64Eemu_brd:WIN_ZP-8_WINU2

More from rscott2049/DECstation2040

1
  • 2 layers52 × 90 mmEmu brd, the printed circuit board in 3D

    Emu brd

    rscott2049/DECstation2040

    A RP2040 based DECstation emulator

    60 parts212BSD-3-Clause

Similar boards

  • 4 layers57.7 × 27 mmSYZYGY PHY, the printed circuit board in 3D

    SYZYGY PHY

    rustbox/router

    Use ARJM11C7-502-KB-EW2 on mouser Tab up, so would have to be placed on the reverse side of the PCB $3.09 @ 10

    49 parts
  • 6 layers86.4 × 54.6 mmBeagleBone Black.unrouted, the printed circuit board in 3D

    BeagleBone Black.unrouted

    The-OpenROAD-Project-Attic/SA-PCB

    Annealing-based PCB placement tool

    275 parts44BSD-3-Clause
  • 2 layers63.5 × 45.7 mmFathom x, the printed circuit board in 3D

    Fathom x

    bluerobotics/fathom-x

    Ethernet capable tether interface board for the Fathom tether.

    25 parts5MIT
  • 6 layers89.4 × 69 mmPi hat, the printed circuit board in 3D

    Pi hat

    ApotheoTech/APT-V01-FMC

    GPIO FMC card, Schematics and PCB

    132 parts4
  • 2 layersGenesis, the printed circuit board in 3D

    Genesis

    iffycodes/Genesis

    Genesis Board design

    98 parts2
  • 2 layers102.8 × 40.5 mmStm32-led controller, the printed circuit board in 3D

    Stm32-led controller

    Joseph-Ladino/stm32-led-controller

    Custom STM32 based led strip controller targeting WS2815. Features include Ethernet, WiFi, USB-C (USB 2.0) and a load switch for disconnecting the strip's power

    67 parts2
  • 6 layers42.2 × 61.4 mmDap proto board full, the printed circuit board in 3D

    Dap proto board full

    tsar-boomba/dap-proto-board-full

    The culmination of all of my learning during the Spring '26 semester. All the way from making a simple dev board for the TAD5212 DAC, to making a RP2350 board, and now this. Everything combined on one 6-layer board.

    102 parts1
  • 4 layers49 × 40 mmBlackmagic, the printed circuit board in 3D

    Blackmagic

    aeremin/firefly_zephyr

    Firmware (Zephyr RTOS / nRF Connect SDK, with Pigweed libraries), custom boards and KiCad hardware projects for a few small nRF52-based devices.

    63 parts

Questions

How big is the Emu brd PCB?

It measures 52 × 90 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Emu brd use?

86 parts, built around the RP2040, LAN8742A-CZ, TLV751180330PDSQR and TXS0108ERGYR. 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 Emu brd KiCad files?

From the rscott2049/DECstation2040 repository on GitHub, at the commit this page was made from: the board is emu_brd_rev_2.1/emu_brd.kicad_pcb and its schematic emu_brd_rev_1.5/emu_brd.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Emu brd design in my own project?

Its repository publishes it under the BSD-3-Clause licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).