View this project on CADLAB.io.
A Neotron system powered by the Raspberry Pi Pico, in a micro-ATX form-factor.
The Neotron Pico is based around the idea of the Neotron-32, but using a low-cost Raspberry Pi Pico instead of a Texas Instuments Tiva-C Launchpad. It also stretches out to full micro-ATX size, and adds more expansion slots so that you can easily design and add your own peripherals.
The Raspberry Pi Pico is the core of the Neotron Pico. It uses PIO statemachines to generate 12-bit Super VGA video, and digital 16 bit 48 kHz stereo audio. It also has both I²C and SPI buses. SPI chipselects and IRQs are handled by an SPI-to-GPIO expander. This provides eight chip-selects and eight IRQs, to support up to eight expansion slots or peripherals. The eight chip-selects can be globally disabled, allowing the Pico to talk to either the I/O exander, or the selected expansion slot. The board has an SD Card fitted in the 'Slot 1' position, and the Board Management Controller in the 'Slot 0' position, leaving 'Slot 2' through to 'Slot 7' available for expansion. Each expansion slot has both I²C and SPI, along with unique chip-select and IRQ signals.
The Neotron Pico is designed to run the Neotron OS - a CP/M or MS-DOS alike OS written in Rust. But, being open-hardware, you can program your Neotron Pico to do pretty much anything.
The main processor module is the Raspberry Pi Pico, which features:
The limited I/O on the Pico (we are using half the available pins just for the video output) is supplemented using a Microchip MCP23S17 SPI to GPIO expander, and an octal buffer. See the I/O Expanders section for more details.
Pin | Name | Signal | Function |
---|---|---|---|
01 | GP0 | VGA_HSYNC | VGA Horizontal Sync (31.5 kHz) |
02 | GP1 | VGA_VSYNC | VGA Vertical Sync (60 Hz/70 Hz) |
04 | GP2 | VGA_RED0 | Digital VGA signal, Red channel LSB |
05 | GP3 | VGA_RED1 | Digital VGA signal, Red channel |
06 | GP4 | VGA_RED2 | Digital VGA signal, Red channel |
07 | GP5 | VGA_RED3 | Digital VGA signal, Red channel MSB |
09 | GP6 | VGA_GREEN0 | Digital VGA signal, Green channel LSB |
10 | GP7 | VGA_GREEN1 | Digital VGA signal, Green channel |
11 | GP8 | VGA_GREEN2 | Digital VGA signal, Green channel |
12 | GP9 | VGA_GREEN3 | Digital VGA signal, Green channel MSB |
14 | GP10 | VGA_BLUE0 | Digital VGA signal, Blue channel LSB |
15 | GP11 | VGA_BLUE1 | Digital VGA signal, Blue channel |
16 | GP12 | VGA_BLUE2 | Digital VGA signal, Blue channel |
17 | GP13 | VGA_BLUE3 | Digital VGA signal, Blue channel MSB |
19 | GP14 | I2C_SDA | I²C Data |
20 | GP15 | I2C_SCL | I²C Clock |
21 | GP16 | SPI_CIPO | SPI Data In |
22 | GP17 | nSPI_CS_IO | Low selects MCP23S17, High selects Peripherals |
24 | GP18 | SPI_CLK | SPI Clock |
25 | GP19 | SPI_COPI | SPI Data Out |
26 | GP20 | nIRQ_IO | Interrupt Request Input from MCP23S17 |
27 | GP21 | nOUTPUT_EN | Enable buffered CS outputs from MCP23S17 |
29 | GP22 | I2S_ADC_DATA | Digital Audio Input |
31 | GP26 | I2S_DAC_DATA | Digital Audio Output |
32 | GP27 | I2S_BIT_CLOCK | Digital Audio Bit Clock (1.536MHz) |
34 | GP28 | I2S_LR_CLOCK | Digital Audio Sync (96kHz) |
The Raspberry Pi Silicon RP2040 generates 12-bit VGA video at a range of standard resolutions (including 640x480 @ 60 Hz).
The design could easily be adapted to remove the TPF133A/THS7316 video buffer and the TPD7S019 level shifter/filter, and instead use the 1BitSquared DVI PMOD board if you prefer a DVI output (using an HDMI connector).
The audio subsystem offers 16-bit 48 kHz stereo audio in and out through a classic blue/green/pink triple 3.5mm TRS jack. Input and Output volume can be software controlled.
Power-on Reset sequencing, soft shutdown, voltage monitoring and PS/2 interfacing is handled by a separate STM32F0 SoC.
Pin | Name | Signal | Function |
---|---|---|---|
02 | PF0 | BUTTON_nPWR | Power Button Input (active low) |
03 | PF1 | BUTTON_nRST | Reset Button Input (active low) |
06 | PA0 | MON_3V3 | 3.3V rail monitor Input (1.65V nominal) |
07 | PA1 | MON_5V | 5.0V rail monitor Input (1.65V nominal) |
08 | PA2 | SYS_nRESET | System Reset Output (active low) |
09 | PA3 | DC_ON | Enable 5.0V PSU Output (active high) |
10 | PA4 | SPI1_nCS | SPI Chip Select Input (active low) |
11 | PA5 | SPI1_SCK | SPI Clock Input |
12 | PA6 | SPI1_CIPO | SPI Data Output |
13 | PA7 | SPI1_COPI | SPI Data Input |
14 | PB0 | LED0 | PWM output for first Status LED |
15 | PB1 | LED1 | PWM output for second Status LED |
18 | PA8 | IRQ_nHOST | Interrupt Output to the Host (active low) |
19 | PA9 | I2C1_SCL | I²C Clock |
20 | PA10 | I2C1_SDA | I²C Data |
21 | PA11 | USART1_CTS | UART Clear-to-Send Output |
22 | PA12 | USART1_RTS | UART Ready-to-Receive Input |
23 | PA13 | SWDIO | SWD Progamming Data Input |
24 | PA14 | SWCLK | SWD Programming Clock Input |
25 | PA15 | PS2_CLK0 | Keyboard Clock Input |
26 | PB3 | PS2_CLK1 | Mouse Clock Input |
27 | PB4 | PS2_DAT0 | Keyboard Data Input |
28 | PB5 | PS2_DAT1 | Mouse Data Input |
29 | PB6 | USART1_TX | UART Transmit Output |
30 | PB7 | USART1_RX | UART Receive Input |
Note that in the above table, the UART signals are wired as Data Terminal Equipment (DTE).
This design should also be pin-compatible with the following SoCs (although the software may need recompiling):
Note that not all STM32 pins are 5V-tolerant, and the PS/2 protocol is a 5V open-collector system, so ensure that whichever part you pick has 5V-tolerant pins (marked FT
or FTt
in the datasheet) for the PS/2 signals. All of the parts above should be OK, but they haven't been tested. Let us know if you try one!
The Neotron Pico can retain time/date settings when fully powered off, using a Real Time Clock chip and a CR2032 lithium coin cell. This also retains system settings in a very low-power SRAM built into the Real Time Clock chip.
Because we used so many pins on the Pico for Audio and Video, we don't have enough pins to use for Chip Select lines. Each device we wish to communicate with on the SPI bus must have a unique chip select line and so have limited lines means we could only have a limited number of SPI devices.
However, in this design, we cheat and use a Microchip MCP23S17 I/O expander. This is an SPI peripheral with 16 GPIO pins that can be controlled by sending it commands over SPI. It also has an IRQ output which be programmed to fire when the input pins match a certain state. The MCP23S18 (with open-drain outputs) will not work - it has a different pinout.
The problem would come when the Pico has finished talking to our select SPI device - how does it tell the MCP23S17 to release the current chip select, without the SPI bus traffic also going to the currently selected expansion slot? We resolve this by using a simple 8-bit decoder/buffer with an enable pin. This allows the Pico to disconnect all of the chip select signals at once, regardless of the output of the MCP23S17. Once this is disabled, we know we are talking to only the MCP23S17 and the Pico can command it to select the next chip select of interest to us.
Interrupts are also processed through the MCP23S17. We configure the device to provide an IRQ (edge, active low) whenever any of the eight IRQ inputs are active (programmable for edge or level, active high/rising or low/falling). When the Pico receives an IRQ from the MCP23S17, it must do a read of the pins (using SPI) to find out which device actually raised the interrupt. This model is similar to that used in the IBM PC - where the Intel 8088 must talk to an Intel 8259A programmable interrupt controller over the ISA bus to find out which interrupt was raised - except that in our case, our CPU is very fast and our bus is pretty slow, so our interrupt latency isn't very good. Worse, if there is a big SPI transaction happening (such as transferring a 512 byte block from an SD card) when an interrupt fires, the Pico will have to wait for that to complete before it can talk to the MCP23S17 to handle the IRQ. That or it could just drop the SPI transaction mid-way through and re-try it later (if your expansion device can tolerate such rudeness).
+------+ +-----+
| |----------/OUTPUT_EN------------->| |
| | | |
| | +----------+ | |
| | | | | |
| | | |--CS_SEL0->| |----/CS0---------------------------------+
| | | | | | |
| | | |--CS_SEL1->| D |----/CS1-----------------------------+ |
| | | | | E | | |
| | | |--CS_SEL2->| C |----/CS2-------------------------+ | |
| | | | | O | | | |
| | | | | D |----/CS3---------------------+ | | |
| | | | | E | | | | |
| | | | | R |----/CS4-----------------+ | | | |
| | | | | | | | | | |
| | | | | |----/CS5-------------+ | | | | |
| | | | | | | | | | | |
| | | | | |----/CS6---------+ | | | | | |
| Pico | | MCP23S17 | | | | | | | | | |
| | | | | |----/CS7-----+ | | | | | | |
| | | | +-----+ v v v v v v v v
| | | | +---+---+---+---+---+---+---+---+
| |--/IOCS--->| | | S | S | S | S | S | S | S | S |
| |<---IRQ----| | | l | l | l | l | l | l | l | l |
| |<===SPI===>| |<============SPI============>| o | o | o | o | o | o | o | o |
| | | | | t | t | t | t | t | t | t | t |
| | | | | | | | | | | | |
| | | | | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| | | | +---+---+---+---+---+---+---+---+
| | | |<---IRQ7-----------------------+ | | | | | | |
| | | | | | | | | | |
| | | |<---IRQ6---------------------------+ | | | | | |
| | | | | | | | | |
| | | |<---IRQ5-------------------------------+ | | | | |
| | | | | | | | |
| | | |<---IRQ4-----------------------------------+ | | | |
| | | | | | | |
| | | |<---IRQ3---------------------------------------+ | | |
| | | | | | |
| | | |<---IRQ2-------------------------------------------+ | |
| | | | | |
| | | |<---IRQ1-----------------------------------------------+ |
| | | | |
| | | |<---IRQ0---------------------------------------------------+
+------+ +----------+
The seven expansion sockets allow you to add on I²C or SPI based devices at a later date. Each provides a single chip-select and a single IRQ line - the motherboard design should ensure each socket gets a unique signal for each of these. Each expansion device should also contain a AT24C256 or similar EEPROM device. To allow these EEPROM devices to be scanned, each slot also contains three EEPROM_ADDRESS
pins, tied to Vcc or GND in a unique combination. These should be connected through to the EEPROM address lines on your AT24C256, thus ensuring that each expansion card has its EEPROM at a unique address - 0x50 on Slot 0 through to a maximum possible 0x57 for Slot 7. Where your board has on-board devices, you should fit an AT24C256 EEPROM for each device so that the on-board devices can be discovered, exactly as if they were on an expansion card.
The expansion slot is a simple 2x10 header. We suggest the use of a TE card-edge connector, but you could equally use two 1x10 pin-headers if desired.
The expansion connector pinout is:
+--------+
SPI_COPI -| 1 2 |- GND
SPI_CIPO -| 3 4 |- GND
SPI_CLK -| 5 6 |- GND
~SPI_CS -| 7 8 |- ~IRQ
I2C_SDA -| 9 10 |- I2C_SCL
EEPROM_ADDR0 -| 11 12 |- EEPROM_ADDR1
EEPROM_ADDR2 -| 13 14 |- ~RESET
5V -| 15 16 |- 5V
3V3 -| 17 18 |- 3V3
GND -| 19 20 |- GND
+--------+
Four expansion slots line up with the ATX case expansion brackets, allowing you to use cards with external connectors. Note that these are aligned the "PCI way around" with components facing away from the board's I/O area, rather than the "ISA way around" which would have the components facing the I/O area. A further three of the expansion slots are available for internal use only.
The signals for Slot 0 are connected to the Board Management Controller. Both CS and IRQ are connected.
The signals for Slot 1 are connected to the on-board SD Card Slot. CS 1 is connected to the card's DAT3
pin, and IRQ 1 is connected to the Card Detect
pin on the card slot.
Slot 2 is the right-most Expansion Slot.
Slot 3 is the right-most-but-one Expansion Slot.
Slot 4 is the left-most-but-one Expansion Slot.
Slot 5 is the left-most Expansion Slot.
Slot 6 is not fitted. SPI Chip Select 6 and IRQ 6 are only available on the test headers.
Slot 7 is not fitted. SPI Chip Select 7 and IRQ 7 are only available on the test headers.
All I²C device address given below are 7-bit values. Note that with I²C, the first byte in a message is the control byte; this is comprised of the device address in the top seven bits, and an extra bit at the bottom to indicate read (1) or write (0).
The memory addresses given are 8-bit values used to access the contents of an I²C device, and are usually supplied as the second byte in a message.
There is a second I²C bus, driven by the Board Management Controller. This is connected to the Display Data Connection (DDC) pins on the VGA interface, allowing the reading of the VGA monitor's EDID block. This is typically at device address 0x50
Why not design and build your own expansion card? You could try designing:
This project treats a PCB like embedded firmware:
./Kicad
)We do not check build outputs into this repository - ever. Instead, we run a Github Action which uses KiBot to generate our outputs. On a regular Pull Request, the build outputs are stored as artefacts against the particular Github Action run. When a new version is tagged, the build outputs are stored as files against a Github Release.
You can build locally using the KiBot docker container:
~/Neotron-Pico $ docker run --rm -ti -v $(pwd):/work setsoft/kicad_auto:dev_k6
root@12345678:/# cd /work/Kicad
root@12345678:/work/Kicad# kibot -c docs.kibot.yml -e neotron-pico.kicad_sch -b neotron-pico.kicad_pcb -d docs
This will build everything and put it in the ./Kicad/docs
directory.
See CHANGELOG.md for a list of detailed changes.
These documents, schematics and PCB designs are Copyright (c) The Neotron Developers, 2022.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
That means you are free to:
Please note that the models provided in the Kicad/Models directory are from various manufacturers. Terms and conditions for the use of the models are as specified by the original manufacturer/author.
NOTE: Releases are provided free-of-charge, and without any kind of warranty - explicit or implied. It is imperative you validate the design for yourself before placing an order or using/adapting/copying any of the designs herein. The Neotron Developers cannot be held responsible if you build or remix our designs and it doesn't turn out how you expected. This is a work-in-progress and you will most likely need to fix something, somewhere.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.
See ASSEMBLY.md for instructions on how to assemble the board.
Typically, I get the boards from JLCPCB with most of the surface-mount components already fitted. This includes all the LEDS, small inductors, resistors and small capacitors (all 0805 size), the transistors (all SOT-23), and whichever of the larger ICs they happen to have in stock. All that's left is the larger ICs, and the through-hole connectors.
In the release area, you will see a JLCPCB specific bill-of-materials (BoM), which includes only the parts with a Cxxxx
format LCSC/JLCPCB part number. You upload this, along with the CPL position file for those parts, when placing your order.
If you want to order bare boards, it is designed to be hand-solderable. That's why there are no SMD parts smaller than 0805.
Part | Footprint | Size (mm) | Pitch (mm) |
---|---|---|---|
MCP23S17 | SOIC-28 | 18x7.5 | 1.27 |
Jellybeans | 0805 | 2.0x1.2 | N/A |
Transistors | SOT-23 | 3.1x1.4 | 1.80 |
74HC138 | SOIC-16 | 3.9x9.9 | 1.27 |
THS7316 | SOIC-8 | 3.9x4.9 | 1.27 |
DS1307Z | SOIC-8 | 3.9x4.9 | 1.27 |
STM32F031K6T6 | LQFP-32 | 7.0x7.0 | 0.80 |
TLV320AIC23BPW | TSSOP-28 | 4.4x9.7 | 0.65 |
TPD7S019 | SSOP-16 | 3.9x4.9 | 0.635 |
Feel free to click these (unaffiliated) links and see for yourself!
Component | Manufacturer | Part Number | Octopart | LCSC | JLCPCB | Digikey | Mouser | RS | Farnell |
---|---|---|---|---|---|---|---|---|---|
Main CPU | Raspberry Pi | Pico (SC0915) | Link | N/A | N/A | N/A | Link | ||
BMC | ST Micro | STM32F030K6T6 | Link | C46830 | C46830 | Tray | Link | Link | Link |
BMC (alt) | ST Micro | STM32F031K6T6 | Link | C526904 | C526904 | Tray | Link | Link | Link |
Video Amplifier | Texas Instruments | THS7316 | Link | C544774 | C544774 | Tape | N/A | N/A | N/A |
Video Amplifier (alt 1) | 3Peak | TPF133A | Link | C155446 | C155446 | N/A | N/A | N/A | N/A |
Video Amplifier (alt 2) | DIOO | DIO2663 | Link | C444605 | C444605 | N/A | N/A | N/A | N/A |
Video ESD Filter | Texas Instruments | TPD7S019-15DBQR | Link | C337499 | C337499 | Tape | Link | N/A | Link |
GPIO Expander | Microchip | MCP23S17/SO | Link | C145413 | C145413 | Tube | Link | Link | Link |
Audio CODEC | Texas Instruments | TLV320AIC23BPW | Link | C9915 | C9915 | Tape | Link | Link | Link |
Real Time Clock | Microchip | MCP7940N-I/P | Link | C153264 | C153264 | Tube | Link | Link | Link |
Real Time Clock (alt) | Dallas | DS1307Z+ | Link | C9868 | C9868 | Tube | Link | Link | Link |
Power Supply | Mornsun | K7805-3AR3 | Link | C2684867 | C2684867 | Tube | N/A | N/A | N/A |