Posts

Dead ends on emulator performance

My Z80 emulator now runs on the CH32V006 and achieves better than real time, so I’ve been looking at ways of improving the performance. So far most have been dead ends.

Z80 emulation

I’m experimenting with writing yet another Z80 CPU emulator. So far it can take the instruction set definition from deeptoaster/opcode-table, convert it to a computed goto form, and boot the ZX81 ROM.

A simple ZX81 emulator on the CH32V006

It’s a toy, but I can now emulate a 1980’s ZX81 on the CH32V006. The performance is equivalent to about a 3 MHz Z80 which, due to how the ZX81 spends most of the time drawing the display rather than running the code, means the overall system is faster than the original.

Heewing F01 balance

I’m building a Heewing F01 using a Holybro Kakute F405-Wing Mini and some spare parts. It’s an interesting build as the baseline has moved on since I first brought my RC equipment and, for example, the autopilot does not support PPM but only serial based protocols such as SBUS.

Pixhawk GPS pinout

Writing this down for future me. I’m assembling a drone using some old parts and could not find the pinout to this GPS / compass combo: For reference, with the antenna pointing up and looking at the connector, then the pins from left to right are:

Stiebel Eltron LWZ 130 and Home Assistant: blinking

So far so good. Home Assistant can send commands to the ESP32, which sends Modbus coil writes to the CH32V006, which turns the LEDs on and off. Next is the I2C side.

Stiebel Eltron LWZ 130 and Home Assistant

I have a LWZ 130 ventilator that I’d like to hook up to Home Assistant to control the fan speed and to get other metrics like the inlet and inside temperature.

Linux on a CH32V006 based emulator: Assembled

I’ve assembled the first three boards. I ordered the PCBs from AISLER, components from LCSC, and a new soldering iron and reflow plate from Aliexpress. The reflow plate has been great - not for the soldering aspect as I don’t have any solder paste yet, but for rework.

Linux on a CH32V006 based emulator: PCB

The schematic and PCB are done. I’ve gone for a compact SMD design with the CH32V006FxPx, 8 MiB of PSRAM, and 16 MiB of NOR flash. The CH32V006 does not support QSPI mode, but I’ve wired the memory to port C so I can efficiently implement it in software.

Linux on a CH32V006 based emulator: starting out

It’s been done before both on the RP2040 and CH32V003, but I’d like to develop a CH32V006 based emulator that can run RISC-V Linux. The goals are: Run RV32 Linux with a console, RAM, and SPI storage Make it as fast as possible.