MHP50 mini hot plate: inside
The MHP50 is a 50 × 50 mm heating plate on a small controller. The plate itself is a replaceable head; the controller takes power from a DC jack or from USB-C with USB PD. This page is what the openware-mhp50 firmware knows about the hardware it drives.
Nobody on this project has traced the board. Everything below comes from what the stock firmware does, from dumps of the flash, from measurements on the author's plate, and from what others found in the IronOS discussion of the MHP50. So read it as how the plate works by the behaviour of its firmware, not as a schematic. Each fact says where it comes from:
Photos of the board
Miniware has no FCC filing for the MHP50, so there are no lab photos of its insides. The photos that exist are in the first post of the IronOS discussion by SimGas: the opened controller and both sides of its board, revision V0.7A. In the same thread danielkurek traced most of the microcontroller's pins.
Block diagram
Pins and buses as the firmware drives them. The heater, its thermocouple, a thermistor and an identification chip all sit in the replaceable head.
Microcontroller
A WCH CH32F208WBU6: a Cortex-M3 with a Bluetooth LE radio on the same chip, in a QFN68 package, with 480 KB of flash and 64 KB of RAM stock code IronOS thread. A 32 MHz crystal and the PLL run the core at 96 MHz; the low-speed crystal is off, and the clock and the radio timer run from the internal RC oscillator stock code.
- The watchdog is the hardware one: it starts with every reset and cannot be turned off. Read protection is off and SWD is open measured.
- The ADC reference is about 3.0 V, not 3.3: the stock firmware counts with 3.3 and reads the input voltage 10 % high measured.
- The first 64 KB of flash hold the Miniware loader, which this firmware never touches and installs through. Its image is unique to each chip: 12 bytes at 0x0800FFF0 are the chip's UID mixed in measured. The OpenWare loader sits at 0x08010000 (8 KB), the application after it, the settings in a page of their own that an update does not overwrite.
How it boots
Two loaders and the application. After every reset the Miniware loader runs first: button A held opens its USB disk
MHP50_DFU; otherwise it checks the authenticity chip and jumps to 0x08010000 if the first word there, the
only one it checks, looks like a stack pointer stock code. That is the OpenWare loader. It stays when the
application asked for it, after a watchdog reset or when the application is not valid, and starts the application
otherwise.
- Updates go over USB, no buttons: the loader writes the application (
make flash), the application writes the loader (make flash-loader) measured. Each writes only the other's window, erases its first page first and writes the words that make it bootable last, so a write cut short leaves an image that does not start: the application stays in the loader, and a broken loader sends the next reset to the Miniware disk. - The Miniware disk installs the OpenWare loader once on a stock plate, together with the application in one HEX, and is the way back measured. It writes nothing below 0x08010000, so the Miniware loader cannot be erased this way stock code.
- A crash or a hang lands in the loader: a crash leaves a record with the address of the faulting instruction, a hang comes back by the watchdog in 11.8 s. The heater goes off first: 3.67 A from the bench supply fell to 0.01 A within one sample measured.
- Not tested: a power loss while the loader is being written; the next reset should open the Miniware disk guess.
Power
Two inputs, each with its own switch; only one is ever on.
- DC jack 5.5 × 2.5 mm: voltage read on PC3, switch on PC6 measured.
- USB-C with USB PD: voltage on PA2, switch on PC7. The contract is negotiated by an ET7301B, a FUSB302-compatible PD chip, on a software I²C bus (PB6/PB7) with its interrupt on PB4; the firmware read its device ID 0x81 measured. That PC6 and PC7 drive P-channel switches is stock code.
Each input's voltage is read ahead of its own switch: the firmware compares PC3 and PA2 before it opens either, and the two channels change apart, 3286 and 672 with the bench supply on, 597 and 671 with it off stock code measured. The logic supply also runs from the inputs ahead of the switches: after a reset both switches are off while the loader and the firmware already run, and with the DC supply off the plate keeps running from USB-C with the DC switch closed stock code measured. How the two inputs are joined for it is not known.
The firmware compares the two inputs and opens one switch. The stock firmware picks the input once at power-up, so a supply plugged in later goes unnoticed; OpenWare picks again every second outside a run, checked both ways on the bench measured.
The DC voltage scale was taken against a bench supply at two points, 24.0 V and 12.0 V: 7.2954 mV per ADC count plus 65 mV. The plate now reads 23 993 mV where the supply shows 23 990; the stock firmware showed 26.3 V at a real 24.0 measured. The divider is said to be 18 kΩ / 2 kΩ IronOS thread.
Heating needs 8 V or more: from the DC jack, or a PD contract of 8 V and up; a plain 500 mA USB port is not enough, and the plate says so. The power limit from the DC jack is a setting, 90 W by default (at 90 the bench supply measures 87.7–89.0 W measured); from USB PD it is the power of the contract, which a setting can cap lower. In the thread, PC1 and PC2 probably charge a 15 F supercapacitor that can run the microcontroller with no input at all IronOS thread; the stock firmware raises PC1 on a power failure and in a crash stock code.
Heating
- The heater is in the replaceable head. A resistance between 2 and 10 Ω counts as a good head; the author's BS50_1 head reads 4.33–4.43 Ω measured.
- Power goes through a PWM on PB1 (TIM3, 100 kHz), not all the time but in bursts of 0–5000 ms with a measurement in between stock code; the 100 kHz was never checked with a scope. The MOSFET driver is a TPS51601A behind a level shifter IronOS thread.
- The driver needs two enables: PB13, high during a burst, and PD4, which the firmware toggles every 10 ms. A hung firmware stops toggling it and the heater goes off by itself stock code; that the driver has no power without the toggling is IronOS thread.
- The heater's resistance is measured through an amplifier on PB0, at rest before the first burst and after each one: two readings, with PB13 high and low, and their difference. The same resistance tells whether a head is there and in contact measured.
- Power is duty × V² / R, and OpenWare takes the duty straight from the power limit; the stock firmware added 4 % and a constant to the current, so its limit was not a limit.
- Iron adapters (SA80, SA115, SA210, SA245) heat to a constant temperature of up to 400 °C with a regulator of their own, and stop the run if the tip's resistance leaves 2–7 Ω, its sensor opens or shorts, or its reading stops rising with the heat stock code. That path has never run on an adapter: the author has none, so it is written from the stock firmware's own numbers and checked by arithmetic against them.
Sensors
| What | Pin | How |
|---|---|---|
| Plate temperature | PC5 | The head's thermocouple through an amplifier, about 9 mV/°C at the ADC; a linear scale per head type plus the cold junction. The ADC runs out at 338 °C (BS50) to 372 °C (AL50_1) stock code. That it is a type K thermocouple with a gain of about 220 is guess |
| Head body, cold junction | PA3 | A 100 kΩ NTC in the head, a 311-point table from −30 to 125 °C; 26.8 °C at room temperature measured |
| Heater resistance | PB0 | Current amplifier, see Heating measured |
| Input voltage | PC3, PA2 | DC jack and USB-C, see Power measured |
| Tilt | I²C PB10/PB11 | SC7A20 accelerometer; heating stops when the plate tips over 30°, checked by tilting it live measured |
| Fan speed | PA0 | Tachometer pulses; how many per turn is guess |
| Which head | PB12, PA3 | Plates by the name in the head's 1-Wire EEPROM (AL50, BS50, AL50_1, BS50_1, CP50), encrypted with a key from the chip's ROM number and checked by CRC32; the author's BS50_1 reads right measured. Iron adapters by the voltage on PA3 |
| Chip temperature | internal | For information only, no protection uses it |
Every ADC channel is the average of 5 samples, with no other filtering.
Interface and storage
- Screen: an ST7735 colour LCD, 160 × 80, on SPI1 (CS PA4, D/C PD5, reset PD6), backlight PWM on PA8 at 20 kHz. The author's panel needs its window shifted by x+1, y+26 measured.
- Flash: a W25Q64, 8 MB, on the same SPI1 (CS PB14). Two 2 MB FAT volumes: at 0x200000 the
disk of the Miniware loader,
MHP50_DFU; at 0x400000 the plate's own disk with the heating profiles measured. - Buttons: A on PC8, B on PC9, low when pressed; that is all there is on the case. A held at power-up sends the Miniware loader into its DFU disk mode measured.
- Fan PWM on PA1 (32 kHz in the stock firmware), tachometer on PA0; buzzer on PB8 at 2 kHz; an RGB LED on PB15 fed a bit stream by SPI2 and DMA stock code. That the LED is a WS2812 with G-R-B order is guess.
- An authenticity chip on 1-Wire on the main board, on PC0. The Miniware loader checks it at every start: the CRC of a flash area and of the chip's page, the chip's UID and ROM number against the copies stored in it. A mismatch shows "Not e-Design Product!" and reboots forever, and so does a silent chip. OpenWare never touches it; writing it bricks the plate stock code.
- USB-C is the only data port: OpenWare is a serial port (USB 1209:0003) with a text command channel, and in disk mode it lends the profile volume to the computer as a flash drive measured. SWD comes out on the D+/D− pair of the USB-C side that USB does not use IronOS thread.
- Bluetooth: OpenWare's phone app talks to the plate over the Nordic UART service, the same text commands as over USB. The stock firmware had its own service that could start heating with no confirmation on the plate stock code.
Pin map
| Pin | What is on it |
|---|---|
| PA0 | fan tachometer stock code |
| PA1 | fan PWM stock code |
| PA2 | ADC: USB-C input voltage measured |
| PA3 | ADC: head thermistor; iron adapter identification measured |
| PA4 | screen CS stock code |
| PA5, PA6, PA7 | SPI1: screen and flash stock code |
| PA8 | screen backlight PWM stock code |
| PA9, PA10 | unused; an unpopulated LED and the accelerometer interrupt IronOS thread |
| PA11, PA12 | USB D−, D+ measured |
| PA13, PA14 | SWDIO, SWCLK IronOS thread |
| PB0 | ADC: heater resistance measured |
| PB1 | heater PWM stock code IronOS thread |
| PB4 | USB-C PD chip interrupt measured |
| PB6, PB7 | software I²C to the USB-C PD chip measured |
| PB8 | buzzer stock code |
| PB10, PB11 | software I²C to the accelerometer stock code |
| PB12 | 1-Wire EEPROM in the head, read only measured |
| PB13 | heater driver enable stock code IronOS thread |
| PB14 | flash CS stock code |
| PB15 | RGB LED stock code |
| PC0 | 1-Wire authenticity chip, checked by the Miniware loader at every start; never write it stock code |
| PC1 | raised by the stock firmware on a power failure; supercapacitor IronOS thread |
| PC2 | a short pulse in the stock firmware, purpose unknown guess |
| PC3 | ADC: DC input voltage measured |
| PC5 | ADC: plate thermocouple measured |
| PC6, PC7 | input switches: DC, USB-C measured |
| PC8, PC9 | buttons A, B measured |
| PC10 | UART4 TX at 1 Mbaud, the stock firmware's debug output; unused here stock code |
| PD4 | heater driver enable, toggled every 10 ms stock code IronOS thread |
| PD5, PD6 | screen D/C, reset stock code |
How the firmware drives it
- The regulator holds the heating rate, not the temperature: once a period (1500 ms for the BS50_1; the stock firmware used 3000 ms for BS50 and AL50, 500 ms for the CP50 pot) a PID on the rate decides how many milliseconds to heat in it. The bursts run at 100 kHz with a resistance measurement between them. On the author's BS50_1 it holds 60 °C and 100 °C with 2–3 °C of overshoot measured.
- Rates: heater PWM 100 kHz, fan 32 kHz, backlight 20 kHz, buzzer 2 kHz; a 1 ms system tick, buttons every 15 ms (700 ms is a long press), the driver enable every 10 ms, USB PD in a 1 kHz interrupt at the lowest priority.
- Heating profiles are G-code files on the plate's disk, up to sixteen: steps with a target, a time, a tolerance and a settle time, plus the fan, the LED and the buzzer. A heating step does not end until the plate has held the target inside the tolerance; a step that misses it by its planned time plus a margin stops the run.
- Protections, each stopping the heater and naming itself on the screen: no plate or a lost thermocouple (resistance outside 2–7 Ω, or the thermocouple ADC at its end), a tilt over 30°, the head body over 80 °C, the input below 8 V or a lost PD contract, a silent tilt sensor, a head pulled out or swapped while heating. A hung firmware is reset by the watchdog, and the heater is already off with PD4.
- What the stock firmware does badly and this one does not repeat: reflow phases with no timeouts, a phase ending on a single reading, no limit on the plate temperature, a stopped fan that does not stop the heater, an edit of the setpoint that turns the heater off for 4–5 seconds, and the input picked once per boot.
The screen
Drawn by the firmware's own drawing code on a computer, so they are what the glass shows. The whole interface runs in the emulator; how it is built is on its own page.