Go to file
alexis b78ff40405 Implement onchip ADC 2023-05-18 23:04:28 -06:00
src Implement onchip ADC 2023-05-18 23:04:28 -06:00
src_boot Build is now working to enumerate 2023-05-07 18:24:19 -06:00
subprojects Implement onchip ADC 2023-05-18 23:04:28 -06:00
.gitignore Directly embed bitstream 2023-05-17 23:07:56 -06:00
.gitmodules Bring up the DACs 2023-05-13 00:14:55 -06:00
Makefile Makefile: remove zig cache on clean 2023-05-12 19:10:31 -06:00
README.md Yeet Docker 2023-05-12 13:42:13 -06:00
build.zig Remove explicit code model 2023-05-15 11:41:54 -06:00
compile_commands.json Set up application mb server 2023-04-24 19:46:39 -06:00
meson.build Implement NAU7802 2023-05-17 23:08:10 -06:00
meson_cross_riscv.txt Yeet Docker 2023-05-12 13:42:13 -06:00
meson_options.txt Bootloader is working 2023-04-17 17:53:18 -06:00
version.h.in Bootloader is working 2023-04-17 17:53:18 -06:00
wch-riscv.cfg Initial commit 2022-11-25 18:20:14 -07:00


PD2530 regulator firmware

This is the firmware for the microcontroller on the PD2530 regulator board.

Build dependencies

Both riscv64-unknown-elf-gcc and Zig must be available and on the path.

(Note that riscv32-unknown-elf-gcc is generally less available and riscv64- supports both, hence this requirement. It is used instead of clang because of the lack of some riscv32 runtime components in most distro packages of clang. I typically do development on macOS, where riscv-gnu-toolchain is available from Homebrew and Zig should be manually downloaded from their binary releases and extracted into the PATH.)


The bootloader is built using:

make MESON_TARGET=boot

It can be installed using a WCH-Link via:

make MESON_TARGET=boot flash

It is an implementation of MBBL, a bootloader working over Modbus (which is the only interface directly connected between the PDP1 controller µC and the PD2530 regulator µC). The bootloader is entered by booting the system with the modbus interface held in break.

Application firmware

The application firmware is built using:


It must be flashed through the bootloader using the mbbl Python tools. To access the modbus interface on a PD2530, the front panel must first be placed into bootloader mode, then the regulators can be accessed at addresses 2 and 3.