OpenWare

Text commands (SCPI)

Both firmwares are driven by lines of text in the form of SCPI, the command language of lab instruments: *IDN?, MEAS?, TEMP 300. The TS1C station and iron and the MHP50 plate take them over a USB serial port, the iron and the plate over Bluetooth as well. The phone apps and the computer tools (tools/ts1c.py, tools/mhp50.py) send the same lines, and so can anyone with a serial terminal: what the buttons do, a line does, and so do things the buttons cannot, such as reading the log or flashing the firmware.

The two firmwares use the same verbs, but each has a parser of its own, and they differ in a few rules, listed below. The tables in the firmware repositories are the contract: docs/development.md for the TS1C, fw/app/scpi.h for the MHP50.

Connecting

DeviceUSB serial portBluetooth
TS1C station1209:0001none: the station is a Bluetooth central to its own iron only
TS1C iron1209:0002Nordic UART Service, name TS1C-XXXXXXXX, no pairing, one link at a time
MHP50 plate1209:0003Nordic UART Service, name MHP50-XXXXXXXX, from the first four bytes of the chip's UID

Lines and replies

Where the two firmwares differ

TS1CMHP50
HeadersThe short forms only: SYST:ERR? works, SYSTem:ERRor? is −113Short and long forms, SYST:ERR? or SYSTem:ERRor?
NumbersIntegers, decimal or 0x hex; no fractionsDecimal, signed, with a fraction; addresses decimal only (0x08012000 is 134291456); text in double quotes
A failed queryA line in which no query ran gets no reply at all, so hosts end their lines with ;:SYST:ERR?Its place in the reply stays empty; the ; around it still come
A missing number—9.91E37, as in SCPI
A full error queueThe new error is droppedThe newest entry becomes −350
SYST:RESResets once the line's replies are outResets at once; a reply not sent yet is lost

Errors

SYST:ERR? reads the error queue, oldest first, one error per answer, and gives 0,"No error" when it is empty. The queue holds 8 errors; the MHP50 keeps one for USB and one for Bluetooth. Errors also go to the device's log.

CodeTextWhenTS1CMHP50
−100Command errorA command not understood—yes
−102Syntax errorGarbage in the line—yes
−108Parameter not allowedA parameter too many—yes
−109Missing parameterA required parameter is absentyesyes
−113Undefined headerNo such command; on the TS1C also a long form, or an application's command sent to the loaderyesyes
−160Block data errorA broken block—yes
−200A run is going, USB disk mode is onA start, a disk write or a setting during a run; any work on the disk while it is given to the computer—yes
−221TS1C: Settings conflict; MHP50: the words on the screenA valid command the device cannot do now: HEAT ON on a station with no iron linked; a start the plate refuses, such as Put a plate on to start or No plate contactyesyes
−222Data out of rangeA value out of range; on the TS1C also not a number, boolean or listed word where one is wantedyesyes
−224Illegal parameter valueA word not in the list—yes
−250Mass storage errorThe disk did not mount, or the file system failed—yes
−256, −257File name not found, File name errorNo such file, a bad name—yes
−311Memory errorThe flash did not take an erase or a write, or read back otherwiseyesyes
−350Queue overflowThe error queue was full—yes
−363Input buffer overrunA line longer than 256 bytesyesyes

Of the IEEE 488.2 common commands there is only *IDN?: no *RST, *CLS, *OPC?, status registers or service request.

Examples

Lines as the bench devices answered them; > is the computer, < the device. The plate's reply is one line, wrapped here.

> *IDN?;:TEMP?;:SETT?                                            TS1C iron
< OpenWare,TS1C-IRON,84C2E444E8E1,v0.7.0-2-g9281be2-dirty;0;PREHEAT=250,OFF=2400,BOOST=400
> :FOO?
                                          (no reply: the line's only query failed)
> :TEMP?;:FOO?;:SETT:BOOST 500;:SYST:ERR?;:SYST:ERR?;:SYST:ERR?
< 0;-113,"Undefined header";-222,"Data out of range";0,"No error"

> MEAS?                                                          MHP50 plate
< RUN=HEAT,MODULE=BS50_1,TEMP=100.1,SETPOINT=100.0,POWER=23,POWER_MAX=90,INPUT=DC,VIN=24066,FILE="",
  STEP=0,STEPS=0,ELAPSED=83,TITLE="Manual heating",MSG="At temperature",MSG_RIGHT="for 1 min",BLOCK=""

Commands both firmwares have

Written here in the TS1C's short form; the MHP50 takes the long form too (SYSTem:ERRor?). The last column says whether the loader answers it as well.

CommandReply or effectLoader
*IDN?OpenWare,<device>,<serial>,<version>: TS1C-STATION or TS1C-IRON with the Bluetooth MAC and the version; MHP50 with the chip's UID (24 hex digits) and the build id (8). A loader adds -LOADER to the deviceyes
SYST:ERR?The oldest error, <code>,"<text>"yes
SYST:INFO?MODE=APP|LOADER,IMAGE_ID=…,RESET=…: which image runs, the id of the application in flash, what reset the chip (power, pin, software, watchdog…)yes
SYST:RES [LOAD]Reset; with LOAD, stay in the loaderyes
SYST:FAUL?The record of the application's last crash, kept over the reset: IMAGE_ID, IPSR, SP, R0–R3, R12, LR, PC, XPSR; empty if there is noneyes
SYST:FAUL:CLEForget the crash recordyes
LOG?A block of the log's whole lines since the last LOG?yes
LOG:ALL?A block of the whole log ringyes
MEM:READ? <addr>,<len>A block of bytes from the chip's memory map: flash, RAM, the UID; on the TS1C at most 1024 bytesyes
FLAS:ERAS <addr>Erase a flash page of the other image: the loader erases the application's, the application the loader's. Pages are 512 bytes on the TS1C, 256 on the MHP50. The Miniware bootloader is never in reachyes
FLAS:WRIT <addr>,<block>Write erased flash in the same window and compare it by reading backyes
SYST:KEYA button press, held for a time if given: A|B[,<ms>] on the station and the plate, BTN[,<ms>|DOWN|UP] on the iron. On the plate 30–10000 ms, 100 by default; over 700 ms is a long press—
SYST:CRASCrash the application on purpose with an undefined instruction: the crash is recorded and the chip resets into the loader. No reply: the port goes with the chip—
SYST:HANGHang it: interrupts off, then the watchdog resets the chip into the loader (on the TS1C, if a computer is on the port within 5 s, else the application starts again). The plate turns its heater off first—

The flash windows: the TS1C loader writes 0x6000–0x3EFFF, its application 0x4000–0x5FFF; the MHP50 loader writes 0x08012000–0x08052FFF, its application 0x08010000–0x08011FFF. On the TS1C, SYST:CRAS and SYST:HANG come with the release after v0.7.0.

TS1C station

Over USB, besides the commands above. Units are in the field names: _MV mV, _MA mA, _DC 0.1 °C, _DS 0.1 s, _DW 0.1 W, _US µs, _C °C; commands take whole degrees and seconds.

CommandReply or effect
:HEAT ON|OFF, :HEAT?Heat on at Work Temp or off, as a short press of A at home. ON with no iron linked, or against the No-PD Heat rule, is −221
:SETT?Every setting: WORK=300,BOOST=400,PREHEAT=250,IDLETIME=600,IDLETEMP=150,SLEEPTIME=1800,UNIT=C,STEP=1,LIGHT=5,SCREEN=2,NOPD=OFF,BEEPSTART=ON,BEEPREADY=ON,BEEPLOW=ON (the defaults)
:SETT:<NAME> <value>, :SETT:<NAME>?One setting, as an edit in the menu: saved 3 s later, sent to the iron, the screen redrawn. It does not wake the station
:SETT:RESThe Reset item: the defaults, the paired iron forgotten
:DISP:DATA?The frame last drawn, as a block: a 1-bit BMP of 128×64, 1086 bytes, lit pixels white; also while the station sleeps
:PD?The station's own USB PD: the fields of the iron's :PD?, plus BUDGET_MA (the dock's budget), HV_BLOCK (5 V only allowed), TRANSITION (a voltage change under way)
:IRON?ADDR=<12 hex>,LINKED=ON|OFF,LINK=ON|OFF: the paired iron (zeros without one), whether it is linked, whether the station holds the link
:IRON:LINK ON|OFFRelease the paired iron for a phone, or take it back, as three presses of B; OFF without a paired iron is −221
:IRON:MEAS?, :IRON:PD?, :IRON:IDN?The iron's last :MEAS?, :PD? and *IDN? replies, in the iron's form; −221 while not linked or before the first reading
:SYST:ENC <n>n encoder steps, −32768 to 32767, positive clockwise
:SYST:DOCK OUT|IN|AUTOForce the dock sensor out or in, or give it back
:MEM:WRIT <addr>,<block>Write RAM or the peripheral registers, not the flash controller; the application only. The iron has it too
SettingValues
WORK, BOOST, PREHEAT, IDLETEMP100–400 °C, whatever the unit shown. PREHEAT above WORK is −222; WORK below PREHEAT pulls PREHEAT down with it
IDLETIME, SLEEPTIME30–2400 s, a multiple of 30: the time in the dock to Idle Temp and to sleep
UNITC or F
STEP1–25, the encoder step
LIGHT1–10, the contrast
SCREEN0–6: Classic, Budget, Power flow, Dial, Graph, Sources, Trend
NOPD, BEEPSTART, BEEPREADY, BEEPLOWON or OFF

TS1C iron

One table for USB and Bluetooth, besides the commands both firmwares have. Heat started over Bluetooth stops when the link is lost, heat started over USB does not; boost and a button held by :SYST:KEY over Bluetooth are let go at the link's loss too.

CommandReply or effect
:MEAS?The telemetry, 29 fields: UPTIME_DS, VIN_MV, DOCK_MV, VBUS_MV, VBAT_MV, IBUS_MA, IBAT_MA, SC_OK, TIP_DC, TIP_UV, HANDLE_DC, SUPERCAP_DC, CHIP_DC, BC_LVL, CHARGE_STATE, VINREG_MV, IBUS_LIM_MA, HEAT_MODE, REG_SRC, SETPOINT_C, REG_SP_C, PULSE_US, DUTY_PERMILLE, POWER_DW, TIP_MOHM, IMAGE_ID, SWITCHES, PD_HV, VERSION
:PD?USB PD: STATE, CC, BC_LVL, REV, PDO_COUNT, PDO1…PDO7 (hex), REQ_MV, REQ_MA, CONTRACT_MV, CONTRACT_MA, LONGEST_US
:TEMP <°C>, :TEMP?Heat at that setpoint, 0–400 °C, starting or changing in place; 0 is off. The query gives the setpoint held now, 0 unless heating
:HEAT ON|OFF, :HEAT?ON: as one short press of the handle's button with the heat off, at the last setpoint (−221 without one since the reset). OFF: any heat off
:HEAT:REST ON|OFFRest or work, as the short press toggles them; −221 unless heating out of the dock with no USB-C source above 5 V
:HEAT:BOOST ON|OFFAs if the button were held: the boost setpoint while ON
:SETT?PREHEAT=…,OFF=…,BOOST=…; there are no queries of single settings
:SETT:PREHEAT, :SETT:BOOST10–400 °C: the setpoint in the dock, the boost setpoint; kept in RAM
:SETT:OFF0–65535 s, the shutdown time; 0 is never
:DOCK <in>,<mV>,<mA>,<sleep>, :DOCK?The station's word to its iron: in the dock, the station's PD contract, the dock's budget, the station asleep
:HEAT:MODE OFF|RTIP|OTG|PULSE|REG,<1..400>The heating steps one by one, for debugging; PULSE outside OTG is −221

MHP50 plate

Over USB and Bluetooth, besides the commands both firmwares have.

CommandReply or effect
MEASure?What the plate is doing now, the words on the glass among it: RUN, MODULE, TEMP, SETPOINT, POWER, POWER_MAX, INPUT, VIN, FILE, STEP, STEPS, ELAPSED, TITLE, MSG, MSG_RIGHT, BLOCK
TEMPerature <°C>, TEMPerature?The setpoint of manual heating, whole degrees from 50 to the head's limit
HEAT ON|OFF, HEAT?Start manual heating, or stop any run, as a long press on the right
PROGram:RUN "<file>"Run a profile from the plate's disk
SETTings?Every setting: BACKLIGHT, BEEP, DC_POWER, PD_POWER, TIP_OFFSET, TILT, PRESET_1…PRESET_4
SETTings:<NAME> <value>, SETTings:<NAME>?One setting, in the same units; applied at once and saved
PD?The USB PD contract and the source's offers: CONTRACT_MV, CONTRACT_MA, PDO_COUNT, PDO1… (raw, 0x and 8 hex digits)
MMEMory:CATalog?<used>,<free> and a "<name>,,<size>" per file on the plate's disk
MMEMory:DATA? "<file>"The whole file as a block, even RUNLOG.TXT of 512 KiB: it goes out in pieces
MMEMory:DATA "<file>",<block>Write a file of up to 4096 bytes, its name 1–64 bytes, over one of the same name
MMEMory:DELete "<file>"Delete a file
MMEMory:INITializeMake the disk an empty stock one again; every file is lost
SPI:READ? <addr>,<len>Raw bytes of the external 8 MiB flash

Where it departs from SCPI-1999