Multi-Protocol Programmer
Users must load specific firmware according to their needs.
This programmer requires you to load the corresponding firmware for the protocol you want to use:
- AVR Firmware for ATmega/ATtiny devices
- CMSIS-DAP Firmware for ARM Cortex-M microcontrollers
- CPLD Firmware for Intel/Altera MAX II devices
Without the appropriate firmware, the device will not work correctly.
Overview
The Multi-Protocol Programmer is a versatile USB device based on the CH552 microcontroller that supports multiple programming and debugging protocols. Compatible with AVR, ARM Cortex-M, and Intel/Altera MAX II CPLD devices.
Key Features
- 🔌 USB Full-Speed Interface (CDC/HID depending on firmware)
- ⚡ Voltage selector: 3.3V / 5V with switch
- 🔄 Interchangeable firmware for different protocols
- 🛠️ Compatible with industry-standard tools
Resources and Documentation
Resource | Description | Link |
---|---|---|
📚 Complete Documentation | Detailed programmer guide | View Documentation |
🚀 Getting Started | Initial setup tutorial | Start Here |
📋 Schematic | Electronic circuit design | View Schematic |
🔧 PCB Design | Board design files | View Design |
💻 Firmware | Source code and binaries | View Code |
🧪 Development SDK | CH55x development tools | View SDK |
📦 Main Repository | Complete source code | GitHub |
Technical Specifications
Base Hardware
- Microcontroller: CH552G / CH552E / CH552P
- USB Interface: Full-Speed (12 Mbps)
- Power Supply: USB Bus (5V) with internal regulator
- Output Voltage: Selectable 3.3V / 5V via switch
- Connectors: Standard pin headers for programming connections
Supported Protocols
- 🔌 AVR: USBasp, Serial UPDI
- 🛡️ ARM: SWD (CMSIS-DAP)
- ⚙️ CPLD: JTAG (USB-Blaster compatible)
Available Firmware Profiles
Each firmware is optimized for a specific type of device. You must load the correct firmware before using the programmer.
1. 🔧 AVR Programmer Firmware
For AVR microcontrollers (ATmega, ATtiny, etc.)
Features:
- Protocols: USBasp
- Target devices: Complete Microchip AVR family
- USB Interface: HID (USBasp) / CDC (Serial UPDI)
- Voltage: Selectable 3.3V or 5V
Compatible tools:
- ✅
avrdude
- ✅ Arduino IDE
Compilation:
# Compile with SDCC
make all
# Or flash precompiled binary
python3 ./tools/chprog.py build/main.bin
Example of flashing precompiled binary:
Python3 is native in most Linux distributions, but you can install it on Windows or macOS with limited support.
make flash
Compilando main.c ...
Compilando src/delay.c ...
Compilando src/isp.c ...
Compilando src/tpi.c ...
Compilando src/updi.c ...
Compilando src/usb_asp.c ...
Compilando src/usb_cdc.c ...
Compilando src/usb_descr.c ...
Compilando src/usb_handler.c ...
Enlazando IHX...
Generando BIN...
------------------
FLASH: 5341 bytes
IRAM: 36 bytes
XRAM: 480 bytes
------------------
Eliminando temporales...
Flasheando a CH55x...
Connecting to device ...
FOUND: CH552 with bootloader v2.5.0.
Erasing chip ...
Flashing build/main.bin to CH552 ...
SUCCESS: 5341 bytes written.
Verifying ...
SUCCESS: 5341 bytes verified.
DONE.
USBasp mode enumerates as HID device, while Serial UPDI uses virtual CDC port.
2. 🛡️ ARM Debugger Firmware (CMSIS-DAP)
For ARM Cortex-M microcontrollers
Features:
- Protocols: SWD and JTAG (CMSIS-DAP standard)
- Target devices: STM32, PY32, RP2040, etc.
- USB Interface: HID + optional CDC
Compatible tools:
- ✅ OpenOCD
- ✅ PyOCD
- ✅ Visual Studio Code (PlatformIO Extension)
- ✅ Visual Studio Code (Raspberry Pi Pico Extension)
Drivers:
- Linux/macOS: Native support (no additional drivers)
- Windows: Automatic drivers via WinUSB
Some IDEs may require specific configuration to recognize the device as CMSIS-DAP.
3. ⚙️ CPLD Programmer Firmware
For Intel/Altera MAX II devices
Features:
- Target devices: EPM240, etc.
- Protocol: JTAG via USB-Blaster emulation
- Compatibility: Intel Quartus Prime (lite version)
- Speed: USB-Blaster specification compliant
Configuration options:
- Safe mode (default): VID:
0x16C0
PID:0x05DC
- Compatibility mode: VID:
0x09FB
PID:0x6001
Compatibility mode uses Intel VID/PID. Use only for personal development and comply with corresponding licenses.
Installation and Setup
System Requirements
Required software:
# Ubuntu/Debian
sudo apt install build-essential sdcc python3 python3-pip git
# Install Python dependencies
pip3 install pyusb
# Verify installation
sdcc --version
python3 --version
For Windows:
CH55x Docker SDK
Firmware Flashing Process
1. Enter Bootloader Mode
- Disconnect the programmer from USB completely
- Hold down the
BOOT
button on the board - Connect the USB cable while keeping
BOOT
pressed - Release the button - device enters bootloader mode
- The LED should change state indicating bootloader mode
2. Flash the Firmware
# Method 1: Using chprog.py (Recommended)
python3 ./tools/chprog.py build/main.bin
# Method 2: Using WCHISPTool (Windows)
# Open WCHISPTool and select the .bin file
3. Verify Installation
# Verify device is recognized
lsusb | grep -i "ch55"
# For Windows, check in Device Manager
Permission Setup (Linux)
# Create udev rules for unprivileged access
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="4348", ATTR{idProduct}=="55e0", MODE="666"' | sudo tee /etc/udev/rules.d/99-ch55x.rules
# Reload rules
sudo udevadm control --reload
sudo udevadm trigger
# Add user to dialout group (for serial ports)
sudo usermod -a -G dialout $USER
Firmware Compatibility Table
Firmware | Protocols | Target Devices | USB Mode | Main Tools |
---|---|---|---|---|
AVR | USBasp | ATmega, ATtiny, AVR-DA/DB | CDC/HID | avrdude, PlatformIO |
CMSIS-DAP | SWD | STM32, RP2040, PY32 | HID+CDC | OpenOCD, PyOCD |
CPLD | JTAG (USB-Blaster) | EPM240, EPM570, MAX II | HID | Quartus Prime |
Common Troubleshooting
❌ Device not recognized
Possible causes and solutions:
-
Wrong firmware loaded
- Verify firmware corresponds to intended use
- Re-flash the correct firmware
-
Driver issues (Windows)
# Install Zadig for libusb drivers
# Select device and install WinUSB driver -
Insufficient permissions (Linux)
# Check udev rules
sudo udevadm test /sys/bus/usb/devices/[device_path]
❌ Programming error
- Verify cable connections
- Check target voltage (3.3V vs 5V)
- Verify target device is powered
- Check protocol compatibility
❌ Slow programming speed
- Reduce JTAG/SWD frequency
- Verify connection quality
- Use shorter cables
Licenses and Attributions
This project is distributed under multiple licenses depending on the component:
- Hardware: Creative Commons Attribution-ShareAlike 4.0
- Base firmware: MIT License
- Derived components: Specific licenses from each base project
Consult the LICENSE
file in each firmware directory for specific licensing details.