aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 7603fca7e7d3d401b595f7958c96f940a4867400 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# numini

A small CPU and a computer built around it.

## Overview

Currently, the planned hardware is based around an [iCEBreaker] and an [Inkplate 6].
The [original Inkplate 6 case]'s top is used (since the Inkplate came glued to it), but the bottom is replaced by a 3D-printed custom case that leaves room for the remainder of the components and ports on the bottom.
The Inkplate provides power via a lithium battery, and access to its display, its microSD card, and its Wi-Fi and Bluetooth connectivity.
The iCEBreaker is connected to the Inkplate over UART.
The iCEBreaker is augmented with a [quad HyperRAM PMOD] module, which it uses for main memory.
A [CH559] is used to provide support for USB keyboards.
It connects to the iCEBreaker over UART, essentially acting as a PS/2 keyboard would.
Finally, a variety of devices connect to the iCEBreaker over I²C, including several [MCP23017]

[iCEBreaker]: https://docs.icebreaker-fpga.org/
[Inkplate 6]: https://soldered.com/product/soldered-inkplate-6-6-e-paper-board/
[original Inkplate 6 case]: https://github.com/SolderedElectronics/Inkplate-6-hardware/blob/master/3D%20printable%20case/Original%20case
[quad HyperRAM PMOD]: https://1bitsquared.com/products/pmod-hyperram
[CH559]: https://www.wch-ic.com/products/CH559.html
[MCP23017]: https://www.microchip.com/en-us/product/mcp23017

The different components are in the following subdirectories:

- `case/` contains the [OpenSCAD] code for the case design.
- `ch559/` contains the source code to the Forth implementation that runs on the CH559.
- `fpga/` contains the [Bluespec] code that runs on the iCEBreaker.
- `inkplate/` contains the code that runs on the Inkplate.
- `simhost/` contains Rust code that implements simulated peripherals for bluesim.

[Bluespec]: https://github.com/B-Lang-org/bsc
[OpenSCAD]: https://openscad.org/

## CH559 Code

The CH559 is a microcontroller based on an enhanced [8051].
It has two USB ports that can operate in device or host mode, which we will use to access USB keyboards.
Programming the board is somewhat annoying -- it has [ICSP] support, but entering the programming mode requires unplugging the board's power.
To circumvent this, and for general ease of development, the software for the board will be written in a custom Forth.
The Forth implementation itself is in the `ch559/` directory.
To reduce reliance on external tools, an assembly toolchain is implemented in Python, and the Forth is implemented in that.

[8051]: https://en.wikipedia.org/wiki/8051
[ICSP]: https://en.wikipedia.org/wiki/In-system_programming

## Inkplate

The Inkplate 6 provides 800x600 pixels with 3 bits of greyscale color depth.
It quotes a 1.26s update time; in order to update at faster than the refresh rate, we need to run the UART at 2MHz, which gives a 900ms access time to send the whole framebuffer, or 1.2s if we send 4 bits per pixel.