The printer as emulated, and where each detail came from. src/sm6337.js runs
the factory firmware on an emulated КР580ВМ80А and turns the board’s outputs
into a carriage position, a paper position and needles struck.
node tools/check.js sm6337 # what the manuals say it does, asserted
node tools/sm6337.js --text 'Hello\r\n' # print it, draw tmp/sm6337.png
node tools/sm6337.js --key ТЕСТ # the switch report, its own oracle
node tools/cputest8080.js # the 8080, against four test programs
check.js sm6337 is the one to run after a change.
SM6337.D27 .D28 .D29, three 8K К573РФ6А, D27 at $0000.All from oldpc.su/pc/sm/sm6337, and all scans with no text layer: every § and табл. cited here was read off the image, so a disagreement with the code is as likely to be a misreading as a bug.
| paper | interfaces | firmware | |
|---|---|---|---|
| СМ6337 | A3 | ИРПР-М, Стык С2 | D27 D28 D29 |
| СМ6337.06 | A3 | ИРПР-М | 015М, 015-01М, and the same D29 |
| СМ6337.02 | A4 | ИРПР-М, Стык С2 | |
| СМ6337.03 | A4 | ИРПР-М |
The D27-D29 set serves both widths: bit 0 of port $80 is a jumper, the
firmware takes a line of $0750 steps with it and $03C0 without, and its
self-test signs itself СМ6337.02 without.
КР580ВМ80А at 2 MHz from a КР580ГФ24; Ф2ТТЛ clocks the timers too, so a T-state is a timer clock, 0.5 µs.
$0000-$5FFF |
ROM. $3000 is the 9×11 font, 12 bytes a character; D29 is the 18×23 one |
$6000-$77FF |
RAM, three К537РУ10: receive buffer at $6000, line buffer at $7000, variables at $7400, stack from $7800 |
| port | ||
|---|---|---|
$40 $41 |
w | КР580ИР82, needles 1-8, D7 the top one, low strikes. The write is СТР.ПЕЧ, the fire strobe. The address bit is needle 9 |
$48 $49 |
КР580ВВ51А, Стык С2 | |
$50-$53 |
КР580ВИ53 D17: 0 counts steps, 1 is the dot clock, 2 the step rate | |
$58-$5B |
КР580ВИ53 D24: 0 baud rate, 1 bell pitch, 2 bell length | |
$78 $79 |
КР580ВН59, CALL table at $2E00 |
|
$80 |
r | bit 0 the A3 jumper, 1 paper present, 2 left sensor, 3 /STROBE held |
$80-$83 |
w | ВМА0 = A0 carriage direction, ВМА1 = A1 paper direction |
$84-$87 |
r | DIP switches: A0 reads S6, A1 reads S5 |
$84 |
w | ШАГ2, one paper step |
$88 |
r / w | the ИРПР-М byte, and its acknowledge / clear a head fault |
$8C |
r / w | keys ПС ПФ ТЕСТ КР, low when down / “управление длинной строки” |
$9C-$9F |
w | “резерв” in the РЭ; $9D as the carriage ramps up, $9C at speed |
$AC-$AF |
w | lamps: A0 low lights АВР, A1 low lights КР |
$BC-$BF |
w | A0 lets the step rate through to ШАГ1 |
The groups from $80 up that are write-only latch address lines, not data:
D25 is a К155ТМ7 with MA0, MA1 on its inputs. The firmware never loads A before
those OUTs.
| IR0 | head fault, АВР.ПГ |
| IR1 | SD1, the left sensor |
| IR2 | D17 OUT0: the step count ran out |
| IR3 | D17 OUT1 inverted (D7.3): the next dot column |
| IR4 | a key |
| IR5 | an ИРПР-М byte |
| IR6 | a serial byte |
РЭ §8.1’s prose has IR2 and IR3 the other way round; рис. 8.1 and the firmware agree with each other. The inverter on OUT1 is not decoration: on the other edge every line after the first starts with a stray glyph, because the IR3 handler stops the dot clock itself and the stop has to land between requests.
Every pitch in the manuals is metric and every one of them is an inch fraction: 2,54 mm is 1/10”, 2,117 mm is 1/12”, the 4,23 mm line is 1/6”, and АР2 A n steps “n x 0,353 mm”, which is n/72”. The mechanism is built to the inch and the documentation converts — the command set is Epson’s, and so is the geometry under it. The step sizes here are named in inches because the ratios are exact that way and ugly in millimetres.
Two four-phase 1.8° steppers, ДШИ-200-1-2. Phase switching is a counter and a PROM per motor on the БУМП-1 (РЭ §8.4.4, §8.4.6), so the firmware sends a direction and pulses and nothing else.
$2C0D and back down.$3000 in D27.$746D, and a form feed advances to the next
multiple of it. АР2 C n stores n × the line spacing in force at the time, so
later spacing changes do not move it (РЭ §7.9.40, and measured: 66 lines is
2640 steps and 11″, but 66 lines after АР2 A 24 is 5280). Power-on loads the
ROM constant $0B64 at $024E — 2916 steps, 12.15″.printer=sm6337 puts this printer on the printer card’s cable
(SM6337.Cable), the wide machine with the A3 jumper fitted. It runs on the
Agat’s clock: before every access to the card, and once a frame, it is run up
to the Agat’s cycle at 2 MHz against CPU_HZ. /STROBE falling is a byte exactly
when the capture counts one, and BUSY is the firmware’s D5.1. The cable carries
no INIT, so resetting the Agat does not reset the printer. The printer, its
paper included, carries over when the machine is rebuilt. A snapshot does not
hold the printer’s state: a restored machine finds the printer as it was left.
check.js printer runs the factory’s ТЕСТ ‘ПЕЧАТЬ’ into it: the bytes are the
golden ones and the sheet has the test’s five lines on it.
check.js sm6337 asserts all of this; it is 25 checks and about a minute.
src/paper.js
turns those strikes into A4, A3, 15×11 fanfold or a roll. src/pdf.js writes them
out, a page at a time as each one finishes, so a hundred-page job costs the
size of its output and not of its length.Paper keeps the last few pages
open for it and counts a strike that reaches further back as jammed.flight microseconds of
travel. flight defaults to 0, because the manuals time the energizing pulse
(290 µs, §8.4.2) and the current rise (100-300 µs) but never the flight, and
the gap it crosses is 0,30-0,45 mm (РЭ.06 п.12). 290 µs is its upper bound —
a needle that has not struck by then will not — which at 2200 steps/s is
0,64 of a step, 0,135 mm, and twice that between one direction and the next.
A scan of real output would settle it: print a vertical rule bidirectionally,
measure the zigzag, halve it. The firmware does not compensate and does not
try to; §4.3 prints graphics one way instead.$0B64 for the default form. Everything the printer
does with it is pinned; the value itself is not a standard form length, is
not a whole number of 1/6″ lines (72.9 of them), and the РЭ never states a
default to check it against. Only intent is missing.$9C/$9D and the $8C write: logged, not understood.CM6337_06_sch.pdf, 17 sheets) has not been read.