-
Dec 2: one text protocol for both firmwares
3 days ago • 0 commentsUntil today the TS1C had a binary protocol: over Bluetooth, IronOS services plus my own characteristics; over USB, vendor requests. The telemetry layout is known to two files, one in the firmware and one in the app: if the iron sends telemetry shorter than expected, the app shows nothing, and the station requires iron firmware from the same build. The hot plate has its own binary USB requests and no connectable Bluetooth.
I took the oscilloscope as the model, that is, SCPI: lines of text over USB and over Bluetooth (Nordic UART Service), one parser for the phone, scripts and manual debugging, and bytes as an IEEE 488.2 block, the way a scope sends a screenshot. One condition: everything you can do with the buttons, you can do with a command.
I departed from classic SCPI in one thing: replies are
NAME=valuepairs, not a positional list. The app on Pages is always newer than the firmware in people's irons, and missing fields simply stay empty. The station sends the iron everything it has accumulated plus a telemetry request in one line, one radio exchange. A setpoint from the encoder now arrives in 202 ms instead of 1198 (along the way I removed the 0.5 s wait after the last click).Within the day the TS1C command set became the base for the hot plate too:
*IDN?, memory, firmware, buttons, heating, settings, PD, telemetry, plus:LOG?and:SYST:FAUL?, which both clients already had. Aligning them came down to details: the log as a block of whole lines, PDOs as hex with0x. Files on the hot plate use the oscilloscope verbs,MMEM:CAT?andMMEM:DATA?. The hot plate has no:DISP:DATA?screenshot: its ST7735 is drawn straight into the panel in strips, and there is simply no frame in memory.USB on both boards became a CDC serial port. On the CH579, corruption showed up right away: if the first 64-byte packet ended with a run of identical bytes, its first 1–4 bytes arrived overwritten with bytes 56–59, and 19 of 20 test lines broke on the station. Fixed with endpoint double buffering. The bootloaders switched to text too: the station flashes in 3.0 s instead of 13.4. A full hot plate flash through the new bootloader first took 214 s: the image had grown threefold because of the BLE library, and a flash page was written as 128 half-words. With one fast operation per page, 22 s.
Little remains different: the TS1C understands only the short command forms, the hot plate the long ones too; the hot plate has fractions in numbers and
9.91E37in place of a missing number. Command reference: https://openware-project.github.io/scpi.html -
Dec 1, evening: firmware in the browser — two emulators
3 days ago • 0 commentsI needed a prototype of the hot plate UI. Instead of redrawing it, I built the real
screen.cinto WebAssembly with the same font. The first build asked the browser for 135 MB in one piece: settings were written to the same flash address as on the plate (0x08052F00), and to make that address exist, all the memory up to it was allocated. I moved the settings into ordinary buffers.The hand-edited JS prototype stayed separate, and the WebAssembly build became an emulator that you open on GitHub Pages without soldering or flashing anything.
main.cis included as text (#include main.c), itsmain()is renamed, the first pass of the infinite loop exits vialongjmp, and after that the page calls the loop one pass at a time. The model: ST7735 commands into a framebuffer, a BS50 head, a 26 V DC jack, a thermal model with inertia; the profiles from the repository are parsed by the real parser. The button state machine had to be duplicated in the model: the driver masks interrupts with instructions that WebAssembly doesn't have. The buttons first sat under the screen, but on the plate they are on the sides, so I redrew the case from a photo.I did the TS1C station emulator next, with the same recipe. The Makefile rewrites the CH579 register header so that every register becomes an offset in a RAM buffer; the firmware itself only has
#ifndefstubs. The encoder goes through the real timer interrupt handler with quadrature phases, and the buttons through the pins, so debounce, long press and wake-up are the firmware's own. Instead of Bluetooth there is a model of the iron: tip, 750 F supercapacitor, a 12 V dock budget. -
Dec 1: Bluetooth drops on the TS1C, and PD on the hot plate
3 days ago • 0 commentsIn the morning I dug into the station–iron disconnects, three in 13 minutes. First I saw station "stalls" of 62 and 125 ms, but that was a measurement error: exactly 2048 and 4096 RTC ticks, a torn counter read. The real cause: the iron opens its receive window ±6 ticks (about ±180 µs) around the anchor, and the anchor sometimes drifts by 0.3–2 ms. After a 0.9 ms shift the iron no longer hears the station, and the link drops on timeout.
WindowWidening128 (3.9 ms) instead of 2: before, 4 drops in 19 minutes; now 0 in 87 minutes, 32 of them with heating.One watchdog reset of the iron I don't understand yet. The name of the current main loop step is now written to NOINIT, and I'm waiting for it to happen again. Along the way I found why the probe didn't beep on Nov 25: the timer FIFO was written while the reset bit was set, and got lost. The station no longer connects to the first iron it hears, but takes the one sitting in its dock: an iron passes the check if its contacts are unpowered while the dock is off and powered after the dock turns on.
On the hot plate, USB-PD. The CC level was read right after switching the multiplexer, without settling, that is, from the previous position; with a delay the readings flipped. The Miniware bootloader leaves SysTick at the lowest priority, so I moved it back up. Servicing the PD controller in an interrupt (up to 2.5 ms) landed inside the 48 µs 1-Wire write-zero slot and stretched it past 480 µs: the slave reset, and the plate name was read with a CRC error. Mid-run that would have been a false "The plate was changed" failure. Now the 1-Wire slot runs entirely with interrupts off. The hot plate runs from USB-C at 22 V, but I haven't tested heating from a live PD charger yet.
In the evening, watts. The stock DC jack scale gave 26.3 V at a real 24.0, and the plate counted ~88 W while the bench supply showed 71.9. After calibration, at a 90 W setpoint the plate draws 87.7–89.0 W. The first hot plate releases are out, v0.1.0 and v0.1.1.
-
Nov 29–30: MHP50 — teardown, my own bootloader, G-code profiles
3 days ago • 0 commentsOn Nov 30 the TS1C went open: MIT, first release v0.1.0. And since the evening of the 29th I've been digging into the MHP50 hot plate. Stock is APP V3.02 and UI V2.01. Inside: a CH32F208WBU6 (Cortex-M3 with BLE), the Miniware bootloader in the first 64 KB, the application from 0x08010000, an ST7735 160×80 screen, external W25Q64 flash. The stock regulator controls the ramp rate; reflow is a Rise → Keep → Weld state machine with no timeout.
The probe follows the TS1C pattern, through the DFU disk. The dump showed no read or write protection, the watchdog is hardware and always on, and the key at 0x0800FFF0 equals UID ^ 0x0800FFF0: that's the stock "Demo Mode" check. Before jumping to the application the bootloader checks only the stack word. The DFU disk drops HEX records that don't fit into the 256-byte page buffer, and the file still becomes
.rdy.My bootloader went to 0x08010000 in place of the stock application, with the application from 0x08012000. While checking erase, the chip had a surprise: erased CH32F208 flash reads as 0xE339E339, not 0xFF.
Profiles are a subset of the G-code of my Ukuetis kiln controller; its parser moved here under MIT. First heating: 60 °C from 26.7 °C in 36 s, with overshoot to 63.1; 100 °C holds at 99.6–101.6. The first version of the runner went by time, and reflow announced "done" at 160.7 °C: the step ended by the clock, not by the plate. Now a heating step ends when the plate holds the target within tolerance for a dwell time; the same profile took 4:15 instead of 3:00.
The first screens were text, with abbreviations like "A-5 B+5". The buttons on the case are unlabeled and sit to the left and right of the screen, so what each one does has to be drawn at its own edge. I made a clickable HTML prototype, and by morning, icons for short and long press with a dot or a dash under each, like Morse code; the 32 freed pixels went to the graph, 128 columns instead of 96. The pictures for the UI spec are drawn by the firmware itself, and that caught a bug: the profile plan was computed in tenths of a degree against an axis in whole degrees, and the planned curve was pinned to the top edge.
-
Nov 29: TS1C — USB-PD, the 4.2 V experiment, and the handle button
3 days ago • 0 commentsThe TS1C manual says: charger 20 V 45 W. The stock disassembly shows that in the dock at 5–18 V the station doesn't heat or charge at all, and at 20 V it turns on a 20.8 kHz PWM on PB1. Charging in the dock is limited by the supercapacitor's 3.05 A anyway: from 2.6 to 4.1 V takes at least 6 minutes, and above 9 V it won't get any faster. Why Miniware cut off everything below 18 V, I don't know.
The station's PD worked the first time: the charger sent 5/9/12/15 V at 3 A, 20 V at 3.25 A and two PPS, the station picked 12 V 3 A after 14 ms, and the contract settled in 204 ms. An overnight run switching 12 ↔ 5 V: 1866 contracts in 2.75 hours without errors. Once during the night the station lost power: a Hard Reset from the charger or the charger's own reset, I didn't find out which.
The iron's SC8815 rail follows USB-C even with the PB4 switch off: 8.7 V at 9 V input, 11.8 V at 12. The rail can't be separated from the high voltage, so at 9–12 V the iron works as if it were corded: it heats straight from the charger at full power and charges in the gaps between pulses. On a 12 V 3 A charger the tip went 114 → 300 °C.
In the afternoon I tried to cut the charge tail short: 4.2 V at the terminals while the cell itself is still below 4.1 V. The charger started dropping out, and the iron started pushing ~12 V back into the input: the bench supply set to 5 V showed 12.4. After reverse mode, the SC8815 kept the 12 V output voltage written to it. Back to the stock 4.1 V until I measure the supercapacitor's resistance on an opened iron.
In the evening the station lit up "5V ONLY": when the iron was docked it applied 12 V to cold contacts, the inrush tripped as a dock overload, and that banned everything above 5 V. I made it like the stock ladder: 5 V first, raise after 2 seconds. In the dock at 12 V: 28 → 250 °C in about 25 seconds, heater 1.6 A plus charging 1.2 A within a 2.8 A budget.
The "30 seconds without work, go to sleep" rule dropped the iron into sleep in the middle of soldering a massive pad: pulses of 16–47 ms, and the tip within a degree of the setpoint. Work can't be detected from the tip, so off the dock, sleep and work are toggled with the handle button. Until yesterday the firmware didn't read the button at all, and a touch triggered a 200 ms boost pulse; now boost comes only from holding it longer than 0.5 s. At night boost settled at 389–392 °C instead of 400, with the integral at its limit; the integral limit now grows with the setpoint, and the first 20 seconds of boost hold 398.4–399.9 °C.
While at it, I flashed a second kit, someone else's. From the Mac the updater accepts the file only via drag-and-drop in Finder: three attempts to write it with a command ended with the disk disappearing and stock left on the iron.
-
Nov 28–29: TS1C — the station, two regulator presets, and a solder-melt check
3 days ago • 0 commentsThe station came alive: the SSD1306 screen on SPI, the encoder and button A control heating. IronOS code is GPL-3.0, and this firmware links with WCH's closed BLE library, so I take neither code nor fonts from there; the screen primitives are a port of GyverOLED (MIT). The panel is two-colour: the yellow band cuts off the top of the digits, and from photos the yellow rows are 0–15. For the main screen I drew 71 mockups at 128×64; seven made it into the menu as choices, among them Power flow, an energy monitor like the one in a Prius.
An iron lifted off the dock saw 4.2–4.5 V on its contacts from its own rail and thought it was still docked, so I made the USB-C cable the main sign of being docked. Lifting the iron off the dock now turns heating on by itself: on stock, lifting didn't wake it from sleep, and the first press of A only woke the screen. From 150 °C a lifted iron reaches 297 °C in 6 seconds.
Heat-up with the stock regulator feels sluggish to me, and I came up with two presets: Fast, aggressive with overshoot, and Precise, accurate but slower. First I needed to know what to trust. The multimeter's external thermocouple soldered to the tip read ~20 % higher than the iron (of the rise over room temperature) and lagged by 2 seconds. So, a eutectic: Sn63/Pb37 wire (183 °C) wound on the tip shorts the multimeter probes in resistance mode. The first run broke off during the ramp, at 145 °C, and I didn't count it. The second one, tip under foil, +1 °C every 20 seconds: the circuit opened at 160.3 °C by the iron, and the external thermocouple at the same moment read 184. The iron reads about 23 °C low at 183 °C.
A step from 150 to 300 °C, one run each: stock reaches 295 °C in 6.8 s with an overshoot of +8.2 °C, Precise in 6.6 s with +1.3, Fast another 1.5 s faster, but it overshoots by 13 °C. After 36 runs I kept only Precise: Fast wins about 2 seconds, only from a cold tip, and always overshoots.
-
Nov 27: TS1C — heating in steps, and a bench power supply
3 days ago • 0 commentsI'm bringing up heating in steps, and the current can be cut at any moment with a USB command. The plan has four steps. First, no heating: measure the tip resistance and turn on the SC8815 reverse mode at 6 V. Second, a single 50–100 ms pulse from 5–6 V. Third, a regulator with a 150 °C ceiling, a pulse length limit, a stop below 2.6 V on the supercapacitor and a "heating, but the temperature isn't rising" check. Fourth, 12 V and the setpoint over Bluetooth.
Step 1: tip 4.10–4.13 Ω, reverse mode at 6 V for 30 seconds, nothing went back into USB. Step 2: one 101.5 ms pulse from 6 V, average current 1.17 A, the tip 4.35 °C warmer, so the heater is fed from the SC8815 output. Step 3: the stock regulator with a 150 °C ceiling; 100 °C holds at 99.8–100.3, 150 °C at 148.8–151.3, and one charge lasted 35 minutes at 150 °C.
In the afternoon I put the iron on a bench power supply to do an honest energy balance. Right after connecting, the bench host shut down: the UPS went to battery for a scheduled self-test, the NUT client lost the server and powered the host off. With the bench supply it's clear that the SC8815 input current ADC reads 18 % low (440 mA against 500 on the supply), and the supercapacitor capacitance from the energy balance is 620–700 F; the first estimate, 560 F from a short run, didn't hold up. From 4.1 to 2.6 V the supercapacitor gives 2.8–3.7 kJ; at 10 W average that's 4.5–6 minutes of soldering.
I tested the "heating, but the temperature isn't rising" protection with water: tip in water, 148.7 → 113.6 °C, stop at the 104th second.
I lowered VINREG to 3.72 V, and charging at 1.9 A started stalling at ~3.6 V with no flag in STATUS and never restarted. Now VINREG = VBAT + 0.3 V, within 3.72–4.48 V: 3.50 → 4.09 V in 213 s.
Late in the evening, step 4: 12 V on the rail, up to 9.96 A from the supercapacitor, same as stock; 300 °C holds at 298.9–300.9. The hot heater is about 4.2 Ω, so straight from 5 V it draws at most ~4.4 W, while 300 °C in air needs 5–8.5. Hence a hybrid: while charging, the iron sleeps at 150 °C from USB, and it works from the supercapacitor.
-
Nov 26: TS1C — Bluetooth, and the first charge from 5 V
3 days ago • 0 commentsWCH's closed BLE library is built with Keil. It linked with GCC after two changes: I rewrote every object in the archive with objcopy and added Keil's sections to the linker script. Without that the library code fell out of the hex, and the linker said nothing. The iron presents itself as a peripheral with IronOS services, so that PineSAM and PineTool can see it. At three in the morning the station found the iron (RSSI −52…−60 dBm), connected and read its data. The log already has one disconnect with code 0x08 (supervision timeout); I haven't looked into it yet.
While writing settings to flash, the hardware threw a surprise: row 0xFA00–0xFAFF of this iron does not program. Of 64 words, 2–4 are accepted, in different places on each of three attempts, while the neighbouring row takes 64 of 64, and erase works. The application on both boards now avoids page 0xFA00–0xFBFF.
In the evening, measurements without heating: input 4.25 V, cold junction 25.6 °C, supercapacitor NTC 25.0 °C. The accelerometer doesn't answer on any bus; on I2C there are only 0x22 and 0x74. After /CE is released, the SC8815 charger/converter sits at its factory values, 4.2 V per cell and a current limit of about 60 A, so before starting it I rewrite them with the stock 4.1 V and 3.05 A.
Charging from 5 V USB ran into the 4.5 V VINREG threshold: at 0.25 A the input sags to 4.5 V. The path resistance is about 1.35 Ω, ~0.6 Ω of it inside the iron. The 0.49 A limit set from the CC resistor means nothing: in a USB-A to USB-C cable that resistor always advertises "default USB".
-
Nov 25: TS1C — a probe through the update disk, and my own bootloader
3 days ago • 0 commentsToday I started on the TS1C. The stock firmware is in the TS1CAPPV160 archive on the Miniware forum: station V1.60 and iron V1.40. I took both apart in Ghidra together with an AI agent. Both units have a CH579M, a Cortex-M0 with Bluetooth LE; the application starts at 0x4000, and below it sits the Miniware bootloader, which is not in the archive. Along the way I found bugs in the stock firmware: the station reads past the end of the PDO list if the source advertises only one or two, and waits for the reply to a voltage request with no timeout; the iron's supercapacitor over-temperature protection never fires, because a second pair of thresholds overwrites the flag; the cold-junction table has two typos, an error of up to 1.9 °C.
I don't have a programmer. According to the datasheet the CH579 has SWD and a WCH ROM bootloader, but whether they are enabled can only be seen on a live chip. So my first code on the station was a probe: a tiny image shaped like the stock one (vectors, the string
TS1C Pedestal APPat 0x4300) that installs through the stock USB update disk, brings up USB and dumps the flash.From the Mac it didn't work: the station showed up as ten identical disks, and the file turned into
.ERR. On the bench Raspberry Pi the probe also got.ERR, while stock V1.60 copied the same way got.RDY. I was already preparing an experiment with a single changed character to find out what the bootloader checks in the image, and then the probe went through as a second copy. It checks nothing: with this bootloader the first file after connecting always becomes.ERR, and the second one is accepted. Reading the bootloader code showed why: the disk is emulated in RAM, and sectors go to the HEX parser in the order they arrive.The probe dumped the bootloader, the whole 256 KB of flash and the InfoFlash. Config word 0x50FFFF48: SWD disabled, readout by a programmer disabled, so the SWD route would not have worked anyway. Before starting the application the station bootloader checks only button B and 18 bytes of the string at 0x4300, no CRC, no signature. The probe is supposed to beep at startup, but it doesn't, and I haven't figured out why yet.
I want to flash and debug the boards without replugging them by hand, so I put my own bootloader on top of Miniware's, at 0x4000–0x5FFF, with the application from 0x6000. The Miniware bootloader stays as a fallback that can't be broken: button B and a replug. My bootloader catches a hung application in a window after a watchdog reset, and NOINIT RAM holds a 1 KB ring log and a crash record with registers; I tested that with a deliberately crashing build. By night both the station and the iron were running my bootloader: the iron's Miniware bootloader works the same way, and the very first upload went through on the second copy.
vvzvlad