
Opl3 sound
lgugelmann/HD6301_thing
I recently received a few samples of a Hitachi HD6301V1 in a DIP-40 package. It's a 1MHz 8bit CPU derived from the Motorola 6801 with a few extra instructions.

I recently received a few samples of a Hitachi HD6301V1 in a DIP-40 package. It's a 1MHz 8bit CPU derived from the Motorola 6801 with a few extra instructions.
HD6301V1 thing is an open-source printed circuit board by lgugelmann, from the lgugelmann/HD6301_thing repository on GitHub, published under the MIT licence. It is a 2-layer board of 99.1 × 86.4 mm with 60 parts on 88 nets, routed with 1,116 tracks and 97 vias.
It is built around the SLG46826G, 74HCS08PWJ and 74HCT573D, with the APX811-46UG, SN74LVC1G14DRL and BAT54W among its other parts. Its parts include 15 resistors, 14 capacitors, 9 ICs, 8 connectors and 3 diodes.
I recently received a few samples of a Hitachi HD6301V1 in a DIP-40
package. It's a 1MHz 8bit CPU derived from the Motorola 6801 with a few extra
instructions. It has an onboard mask-programmed 4k ROM, 128 bytes RAM, and 4 I/O
ports that can be used as some combination of data or address bus, or I/O
lines. It also comes with an onboard serial interface. Overall it's a really
neat chip!
This repository contains schematics and code to build a retro-inspired computer around this chip. The idea is to build this off of modular components and a shared bus so we can start small and build up piece by piece.
Currently I have a working device with Arduino-like ease of programmability, PS2 keyboard input, HDMI video output. It's complete enough for a working 'Snake' clone that can be played over both serial console and video out.
The architecture is quite simple and similar to other 8-bit CPUs like the 6502. There is one 16-bit address bus, one 8-bit data bus, a clock line, a read/write line, and an interrupt line.
One way in which this chip departs from e.g. a 6502 is that it has several different 'modes' that affect the memory layout and external buses. Mode selection is done at startup using the first 3 lines of port 2. After startup these lines can be reused for other purposes if desired. Mode 1 (non-multiplexed) breaks out all 16 address and 8 data lines. Mode 5 reduces the external address bus to 8 lines. Mode 0/2/4/6 multiplex the data bus: at the beginning of the cycle the 8 low address bits are presented, then an address latch signal fires, then the 8 data bits are set. This frees up one 8-bit port for I/O. Mode 7 has no external buses at all. Mode 0/5/6/7 map the internal ROM to the top of the address space. It's inaccessible in 1/2/4. Mode 0 ('test mode') has a special handling for the first read of the startup vector addresses at $FFFE/$FFFF: instead of reading them from ROM (as it would in any subsequent read) they are read over the external bus. This allows one to override the ROM-interal startup vector while still keeping it accessible otherwise.
By selecting mode 1 at startup it's easy to get this chip to work on a breadboard by just adding some external parallel RAM / ROM with a bit of address decoding to select which one to access.
The chip has an internal 4x clock-divider. To get it to run at the max 1MHz you need a 4MHz oscillator. I had no stability issues on a breadboard even at max frequency.
The chip requires a minimum 100kHz to run (400kHz oscillator). Going below makes it unstable.
This is a collection of random notes about the hardware that are either well-hidden in the datasheet or not documented at all.
APX811-46 is a great way to satisfy that requirement as it keeps
reset low after power-up for 100-200ms. Alternatively, the datasheet seems to
suggest that the reset line has a Schmitt-trigger input. That would make an RC
circuit with a long time constant also workable. Have not tried that.The samples I have come mask-programmed with some unknown code. The
internal_rom folder contains a dump of that ROM, some very preliminary
disassembly, and details on how to do such a dump using the 'test mode' of the
chip.
The ROM configures the data direction registers of all 4 I/O ports to a combination of inputs/outputs. This suggests that it was meant to work in single-chip mode. The MC6801 was popular in automotive applications - maybe this one was meant to go into a car too.
On the hardware side the repository contains
Currently in progress are:
The 'asm' folder contains software to run on the HD6301. There is a monitor program for debugging, running other programs, and to provide some basic libraries for PS2 keyboard handling and more.
There are also various test programs as well as a 'Snake' clone and a simple audio sequencer.
See the docs in the 'asm' folder for more details.
The emulator folder contains a full-system emulator for the HD6301V1 computer.
It emulates the CPU, I/O, graphics, sound, keyboard, and SD card. See
emulator/README.md for details on building and running it.
The emulator includes an extensive test suite with ~314 declarative CPU
instruction tests (in emulator/testdata/instructions/) and GoogleTest-based
peripheral tests. Run ctest from the build directory to execute all tests.
All modules communicate over the following shared bus.
| Pin number | Function | Notes |
|---|---|---|
| 1..4 | Data bits D0..D3 | Bus users need to coordinate who's driving |
| 5 | 5V | Only one device is allowed to power this |
| 6 | GND | |
| 7..10 | Data bits D4..D7 | Bus users need to coordinate who's driving |
| 11..14 | Address bits A0..A3 | Bus users need to coordinate who's driving |
| 15 | 3.3V | Only one device is allowed to power this, optional |
| 16 | GND | |
| 17..24 | A4..A11 | Bus users need to coordinate who's driving |
| 25 | GND | |
| 26 | 3.3V | Only one device is allowed to power this, optional |
| 27..30 | A12..A15 | Bus users need to coordinate who's driving |
| 31 | RX | Serial receive as seen from a device on the bus |
| 32 | TX | Serial transmit as seen from a device on the bus |
| 33 | CLK | Bus clock |
| 34 | R/WB | Read is high |
| 35 | GND | |
| 36 | 5V | Only one device is allowed to power this |
| 37 | C1 | Control line 1, up to the exact devices on the bus to decide what this does. |
| 38 | C2 | Control line 2, up to the exact devices on the bus to decide what this does. |
| 39 | RESETB | Active low reset. Open drain. Pullup on CPU board. |
| 40 | IRQB | Active low interrupt. Open drain. Pullup on CPU board. |
This is 40 pins as it's easy to find 40pin IDC connectors and ribbon cables. The power / GND pins are mirrored so that an upside-down connector has them in the same place.
There are no chip select pins. Additional boards that want to fit into specific parts of the memory map need to decode the address pins on their board and coordinate with everyone else. Programmable GreenPAKs make this easy enough.
Pins are all push-pull unless stated otherwise. Any shared use needs to be coordinated.
Logic levels are assumed 5V CMOS.
This is not how one designs for signal integrity - but it works well enough for me. The user-friendliness of getting a ribbon cable to a breadboard to prototype the next module is the overriding concern here.
| Pin number | Function | Notes |
|---|---|---|
| 38 | STBYB | Active low standby signal. For Pico Programmer to make HD6301 let go of the bus. |
This section contains possible projects and the state of the current in-progress pieces of work.
The next goal is to get faster SD card reads as described in asm/README.md.
This means emulating the schematic in io_board in the emulator.
Tasks:
Any day now! This README file is badly outdated vs the state of the project. It doesn't mention the emulator at all for example. The various hardware modules should also be listed and better documented.
Tasks:
greenpak folder. That should go with the modules.ft231x_programmer stuff. It's an early idea that's now badly
outdated.board to something better.tools folder.Tasks:
The current FAT16 code is read-only and is limited to using only one sector of FAT (so only 254 clusters). This is not an actual limitation yet. The APIs are a bit wonky, the error reporting inconsistent.
Tasks:
Right now the programmer board has the ability to read almost the entire bus (data, address, IRQ), but we're not doing anything with that. An idea would be to also plumb CLK back to the Pico and very quickly sample the bus on clock edges. Wiring-wise this should be possible on the existing board by changing the GreenPAK setup - the C1 pin is unused on the Pico side.
It's not clear that we can do this fast enough (easily), but it's worth trying out. It's probably very much possible to do the hard way as we can bit-bang at 400+MHz for the DVI out using PIO.
Some math:
If we take some upper bounds we get 200 trigger + 3 * (10 + 50) ~= 400ns. We have 500ns budget between clock edges so this sounds doable. Afterwards we have 500 more ns to do some data processing until the next interesting edge.
Assume we have ~100k of RAM free (total 264k, seems reasonable). If we store 3 bytes per clock cycle we get roughly 30ms of data in a buffer before we run over. In total we generate 3MB/s. Getting those off the Pico in a continuous fashion does not seem doable without trickery. The theoretical maximum is 12Mbit/s, or 1.5MB/sec. In practice folks seem to get somewhere between 500 and 850 KiB/sec. The minimum information needed to code the instructions would be: instruction, address (if needed), data. A 3-byte instruction typically takes 4 cycles and would have 4 bytes of data total (1 instruction, 2 address, 1 data). We'd get a factor 3 compression here if that's the average case. It might just barely be possible to stream things continuously.
Tasks:
| Qty | Value | Footprint | References |
|---|---|---|---|
| 11 | 10k | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R2, R3, R7, R8, R9, R10, R11, R12, R13, R14, R15 |
| 10 | 100n | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C1, C2, C3, C4, C5, C6, C7, C8, C9, C14 |
| 4 | 4.7u | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C10, C11, C12, C13 |
| 2 | 100k | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R4, R5 |
| 2 | 3.3k | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R1, R6 |
| 2 | LED | LED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolder | D1, D2 |
| 2 | SLG46826G | imported_footprints:SOP65P640X120-20N | U3, U5 |
| 1 | 74HCS08 | Package_SO:TSSOP-14_4.4x5mm_P0.65mm | U9 |
| 1 | 74HCT573 | Package_SO:SOIC-20W_7.5x12.8mm_P1.27mm | U6 |
| 1 | 8bit_thing_bus_connector | Connector_IDC:IDC-Header_2x20_P2.54mm_Horizontal | J5 |
| 1 | APX811-46 | Package_TO_SOT_SMD:SOT-143_Handsoldering | U1 |
| 1 | BAT54W | Package_TO_SOT_SMD:SOT-323_SC-70_Handsoldering | D3 |
| 1 | Banking | imported_footprints:SW_DS04-254-1L-02BK | SW2 |
| 1 | CXO_DIP8 | Oscillator:Oscillator_DIP-8 | X1 |
| 1 | F1_reset | own_footprints:PinHeader_1x02_P2.54mm_Vertical_minimal | JP1 |
| 1 | F2_nmi | own_footprints:PinHeader_1x02_P2.54mm_Vertical_minimal | JP2 |
| 1 | HD6301V1 | Package_DIP:DIP-40_W15.24mm_Socket | U4 |
| 1 | IS62C256AL | imported_footprints:SOIC127P1210X305-28N | U7 |
| 1 | KMDGX-6S-BS | imported_footprints:KMDGX6SBS | J1 |
| 1 | LOGO | own_footprints:smyrill_logo | G*** |
| 1 | LOGO | own_footprints:smyrill_logo_small | G*** |
| 1 | P1_connector | own_footprints:PinHeader_2x06_P2.54mm_Horizontal_no_graphics | J3 |
| 1 | Reset | Button_Switch_SMD:SW_SPST_TL3305A | SW1 |
| 1 | SN74LVC1G14DRL | Package_TO_SOT_SMD:SOT-353_SC-70-5_Handsoldering | U2 |
| 1 | SST39SF010 | Package_SO:TSOP-I-32_12.4x8mm_P0.5mm | U8 |
| 1 | USB_B_Micro | imported_footprints:AMPHENOL_10118194-0001LF_MICRO_USB_improved | J6 |
| 1 | memmap_i2c | own_footprints:PinHeader_1x02_P2.54mm_Vertical_minimal | J4 |
| 1 | prog_LED | own_footprints:PinHeader_1x02_P2.54mm_Vertical_minimal | J7 |
| 1 | ps2_i2c | own_footprints:PinHeader_1x02_P2.54mm_Vertical_minimal | J2 |
| 1 | pwr_LED | own_footprints:PinHeader_1x02_P2.54mm_Vertical_minimal | J8 |
The 56 most common of 60 parts.

lgugelmann/HD6301_thing
I recently received a few samples of a Hitachi HD6301V1 in a DIP-40 package. It's a 1MHz 8bit CPU derived from the Motorola 6801 with a few extra instructions.

lgugelmann/HD6301_thing
I recently received a few samples of a Hitachi HD6301V1 in a DIP-40 package. It's a 1MHz 8bit CPU derived from the Motorola 6801 with a few extra instructions.

lgugelmann/HD6301_thing
I recently received a few samples of a Hitachi HD6301V1 in a DIP-40 package. It's a 1MHz 8bit CPU derived from the Motorola 6801 with a few extra instructions.

lgugelmann/HD6301_thing
I recently received a few samples of a Hitachi HD6301V1 in a DIP-40 package. It's a 1MHz 8bit CPU derived from the Motorola 6801 with a few extra instructions.

lgugelmann/HD6301_thing
I recently received a few samples of a Hitachi HD6301V1 in a DIP-40 package. It's a 1MHz 8bit CPU derived from the Motorola 6801 with a few extra instructions.

lgugelmann/HD6301_thing
I recently received a few samples of a Hitachi HD6301V1 in a DIP-40 package. It's a 1MHz 8bit CPU derived from the Motorola 6801 with a few extra instructions.

cnpem-emi/qds-cv-hw
Quench detection system for a single superconducting coil working in the Vertical Cryostat.

PUT-Motorsport/PUTM_EV_IMD_SAFETY
Bender Insulation Monitoring Device Shutdown Circuit driver, based on TW & SS project

cyo-the-vile/FMT-ATX-TOWER
A modification to revive a dead FM Towns tower model




nategreco/uBike
The Universal Bike Controller is an open-source project aimed at providing a drop-in replacement for the factory console on NordicTrack® S-series exercise bikes

It measures 99.1 × 86.4 mm and has 2 copper layers, 1.6 mm thick.
60 parts, built around the SLG46826G, 74HCS08PWJ, 74HCT573D and APX811-46UG. 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.
From the lgugelmann/HD6301_thing repository on GitHub, at the commit this page was made from: the board is board/HD6301V1_thing.kicad_pcb and its schematic board/HD6301V1_thing.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).