wiki:Lichee Pi Baseboard

What it is

This is a project I had for a long time, but the technology became available (again?) only recently.

The goal is to make a reasonably simple computer that would be reasonably "fully" understood by a single person. This does not mean anything, as everyone has and wants a different level of understanding. The general idea is I had great fun programming some 8bit microcomputers from the 1980s, but they are not manufactured anymore, and the old architecture makes them strange an quirky by today standards, and also some of the chips used in them are not manufactured anymore.

There are more modern offers trying to replicate that general idea, but they are usually "cheating" in a way, by including an FPGA or a more powerful CPU used as a coprocessor. If you're going to have a powerful CPU, why not allow the user to run code directly on it? Why make your system more complicated (and thus more costly, larger and needing more electricity)?

So, I was looking for some sort of solution based on a microcontroller. The Bitbox console from Makapuf came quite close, but the software was quite complicated (with things like generating a VGA signal by tricky use of DMA channels and timers) and the hardware just a bit too limited. I wanted more RAM and less Flash, to make this more "computer" in the modern sense (a thing where you can easily load and run different programs). On the Bitbox, there is a lot of Flash (relatively, I think it's 512K) and not so much RAM (196K or so).

The problem is, there were not many microcontrollers that would allow this combination:

  • Have "a lot" of RAM (512K or so at least)
  • Be generally self-contained, with peripherals like a display controller
  • Be reasonably easy to solder

The ESP32 family has some variations with RAM in that range, but usually no display controller (it is possible using the DMA thing like on the Bitbox). The STM32 family has some devices with an LCD controller, but none of them have sufficient RAM, and code running from RAM is slowed down since it's not designed for that.

Recently, I came accross the Allwinner V3S. It is almost perfect, having 64MB of DDR RAM (that's more than I planned initially, but why not), it has an LCD controller that can be convinced to output VGA signals, and it is in a QFP package (all pins on the side, none under the device). The on-board RAM means it can have a low pin count, and also that the CPU and RAM can run at a high frequency (1.2GHz in this case!) while not having to do any complex printed circuit routing for high frequency things. The pins are a bit too small and close together for me to solder them with a soldering iron, but it would be doable with solder paste and a hot air gun. I don't know if I will bother to do that, it is also possible to order the boards preassembled. Still, it allows to do a 2 layer PCB, which is simpler and cheaper.

For the first version, I used the Lichee Pi system on module. It has a strange form factor (solderpads on the edges, but components on both sides so it can't be stacked on another PCB) but I found a way to make it work (inspired by some other designs using it, such as the COBURA game console).

My board includes:

  • Lichee Zero system on module with Allwinner V3s CPU (1.2GHz single core ARM, 64MB RAM) and MicroSD slot
  • Ethernet port (100MB)
  • USB-A host port
  • VGA port (up to 1024x1024)
  • Audio output
  • On board USB to UART and USB-A port for both power supply and serial debug
  • "keyADC" buttons (4 buttons connected to an ADC, allowing a single-pin keyboard)
  • Extension port exposing the other pins from the V3s CPU (SPI, I2C, ...)

Software

I have an OpenEmbedded minimal build now, using mainline U-Boot and Linux. Some small patches were needed that people previously doing support for the board didn't manage to upstream.

Clone the git repository: git clone ssh://pulkomandy.tk:29418/lichee-openembedded

Or browse it online: https://pulkomandy.tk/gerrit/plugins/gitiles/lichee-openembedded/+/refs/heads/main

Notes

The VGA resolution is configured in the device tree. Good enough for U-Boot console, but it would be nice to be able to change it at runtime.

For doing SCART video output, the hsync/vsync needs to be turned into a composite sync (that's just a XOR of the two signals). I put a +5V line on the VGA output so I can power a chip doing the XOR in the SCART adapter (and also power DDC lines on VGA displays). I have to check if the LCD driver accepts doing such lowres things.

Future plans

... maybe someday ...

If I was to do a new version of this hardware:

  • Switch to the Allwinner V3x. Twice the RAM, twice the fun, but still single CPU core (keeping things simple here). Also it has a simpler power supply layout with less pins.
  • Include an USB hub on-board. It is annoying to have only one USB port that is used by the keyboard
  • It is also possible to rewire the keyboard over an I2C or SPI IO expander and wire the keyboard matrix directly to that (or directly to the GPIOs, but I would prefer to keep some of them for later uses).
  • Add an on/off switch and maybe a RESET button

For now there's a lot of fun to be had with the existing hardware.

If you want one

I have 9 PCBs left and components to preassemble some of them (I can solder the SMD resistors/capacitors) and send you the board and connectors as a kit. You'll have to provide your own Lichee Zero.

The unit cost is about 9€for the PCB and all components and you have to add about 25-30€ for the Lichee Zero module, depending on where you get it.

Various links

Other interesting CPUs

In QFP packages:

  • Allwinner V3lp: new pin compatible (?) version with low voltage RAM
  • Allwinner V3x: new version of the V3s with more RAM (not pin compatible)
  • Allwinner T113: dual core CPU, also has embedded RAM

In BGA:

  • Allwinner D1 for RISC-V fun (sipeed has a system on module for it already)

Thanks and greetings

  • The Linux-sunxi community for their efforts in mainlining Allwinner SoCs support in U-Boot and Linux,
  • Icenowy Zheng in particular for the Lichee Zero and V3s support,
  • Jookia for the incredibly efficient support hotline on getting the USB to work in Linux,
  • Makapuf for creating the Bitbox, certainly a bit of an inspiration for this project,
  • All the people on the whycan forums who share their PCB designs.
Last modified 11 months ago Last modified on Aug 4, 2023, 8:53:09 PM
Note: See TracWiki for help on using the wiki.