Both families' residents share a prologue and part at one instruction, the `opl` that sets PMST. 2.1.1 and 2.2.05 write 00b0: IPTR zero, so their vectors are the ROM's own table at 0000, and MP/MC left at the pin. 2.3.x writes 18b8: MP/MC forced to 1, no ROM in the map, vectors moved to 1800 - where every 2.3.x image carries a copy of the ROM's dispatch table, 16 of the first 20 slots identical, which no B image carries anywhere. Nothing else came across. 2.3.12's block at program 0000 lands on the ROM window with 11 words in 4,090 identical, nine of them zero, longest run one word. The service loader is not among what was copied, so what performs a 3453C's first download is still open. Not a V.92 story: 2.1.1 already carries +PQC and the V.92 identity, and the 2.3.x DSP payload is 7,439 words smaller. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
30 KiB
The hardware tick, the audio path, and the DSP's low program memory
Three questions the harness had been carrying as assumptions. All three are now answered from the physical board and from the firmware images it runs, and each answer has more than one independent source.
The board is the 20.16 MHz, 512 KiB Courier on /dev/cu.usbserial-21210,
running ID_SDL v4.03d - supervisor 7.4.16, DSP 3.1.2.
1. One firmware tick is 5.000 ms
Three independent lines agree, and none of them is a model.
The board. S18 sets a self-test duration in seconds and &T1 runs local
analogue loopback for that long, entirely inside the modem: no phone line, no
off-hook, no NVRAM. courier_emu.tick_probe timed four settings three times
each (artifacts/tick-probe-01/):
| S18 | measured |
|---|---|
| 2 | 9.845, 9.845, 9.841 s |
| 4 | 11.843, 11.841, 11.845 s |
| 8 | 15.846, 15.846, 15.845 s |
| 12 | 19.845, 19.843, 19.841 s |
Least squares over the twelve points gives 1.000031 seconds per S18 unit with a worst residual of 3.0 ms, on a fixed 7.843 s loopback setup overhead. So a firmware second is a true second, to about three parts in ten thousand.
The firmware. Both builds convert an S-register byte, which is in seconds,
to a countdown by multiplying by 200 (mov ah,0xc8 ; mul ah), at five sites in
each image. Seconds x 200 = ticks, and a second is a second, so one tick is
5.0 ms.
The silicon. The supervisor programs 80186 Timer 0's compare A once, and later checks it. On the 80186 an internally clocked timer counts at CLKOUT/4:
| build | clock | T0CMPA | counts/s | period |
|---|---|---|---|---|
| board 7.4.16 | 20.16 MHz | 0x6270 = 25,200 |
5,040,000 | 5.000 ms |
| main211 2.1.1 | 25.8048 MHz | 0x7e00 = 32,256 |
6,451,200 | 5.000 ms |
Two different builds on two different crystals, each choosing the max count
that lands on exactly 5.000 ms. The board's value is written at 0x008ce and
verified by the firmware itself at 0x4a83b (cmp word [0xff32], 0x6270).
The board's oscillator can reads 40.320 MHz (see board-parts.md),
and the 80C186 divides its oscillator input by two, so CLKOUT is 20.16 MHz.
That removes the one ambiguity in this table: 25,200 counts is a round figure
either way - 5.000 ms at CLKOUT = 20.16 MHz, or 10.000 ms had 20.16 been the
crystal and CLKOUT half of it. The &T1 slope had already chosen the first,
since seconds convert to ticks by multiplying by 200. The can agrees.
This also settles something the "pairing trap" note flagged: main211 is the 25.8048 MHz build, not a 20.16 MHz one. Its timer constant only lands on 5 ms at 25.8048 MHz.
What this does to the harness constants
daa.py's INSTRUCTIONS_PER_MS = 1_111 is refuted, and its own comment says
why. It was derived by assuming the burst that takes the tick counter to 180 is
a 2 s North American ring, giving a 10 ms tick. At the real 5 ms tick, 180
ticks is 900 ms - an ordinary minimum ring-burst qualification, which is what
that counter is for.
Worse, the derivation is circular: machine.py synthesizes the tick itself at
tick_ms * INSTRUCTIONS_PER_MS, so "2,000,000 instructions reaches 180 ticks"
is arithmetic on the two constants, not a measurement of either.
That leaves the codec-implied figure as the only one still standing. It was
measured on a main211 run, so it pairs with main211's crystal, not this
board's: 4,348 instructions per millisecond at 25.8048 MHz is 5.9 cycles per
instruction, an ordinary 80186 mix. 1,111 would be 23, which is not.
The change, and what it did to the answered-call runs
Applied: INSTRUCTIONS_PER_MS 1,111 -> 4,348, SUGGESTED_TICK_MS 10 -> 5, and
RING_START_MS 8,000 -> 2,000 ms, which keeps the old instruction offset now
that a millisecond is worth four times as many instructions.
Measured at equal line time - the 40M baseline against 156M at the new rate, so
both runs carry about 355 line frames (artifacts/clock-recalibration-01/):
./courier link main211.xmf --summary |
before | after |
|---|---|---|
| line frames | 354 | 357 |
codec_rx_queued |
323,520 | 338,880 |
codec_rx_consumed |
66,267 | 271,475 |
| backlog ratio | 4.88 | 1.25 |
v8_dispatches |
89 | 89 |
| result | CONNECT |
CONNECT |
The receive backlog was the thing that invalidated every earlier reading of
whether the datapump had heard the line. It is not gone, but it is down from
five times to a quarter, and CONNECT and the overlay's dispatch count are
unchanged, so the call still comes up the same way.
--tick-source dsp gains something separate. The two sides used to disagree -
side b reported no serial text at all, 9,785 ticks against side a's 1,455, 710
detector replies against 45, and zero line frames. They are now symmetric: both
OK, both 1,455 ticks, both 45 detector replies, both 11 frames, and both
seeing the peer off hook.
--exchange barely moves, which is the check that this went in the right
place: that path was already paced on the codec rather than on
INSTRUCTIONS_PER_MS, so it should be insensitive to the constant, and it is
(8,800 ms of line time against 9,000, same dtmf_blocks, same dial-tone stall).
What is left is the residual 1.25. The rate that would balance this path is nearer 5,435 instructions per millisecond - 4.75 cycles per instruction at main211's 25.8048 MHz, as ordinary as 4,348's 5.9. Two honest options remain, and this document takes neither: fit the constant to the balance, or pace the link on the codec the way the modeled line already is. The second is the structural fix; the first is a number.
2. The 80186 is not in the audio path; where it goes on the DSP side is
still open
This section originally claimed the audio arrives on the C5x serial port via
a four-phase handler chain at program 0x01a8. That was wrong, and the
correction is below the measurement that stands.
What stands: no CPU port carries audio
AT&T8 runs analogue loopback with self-test and, unlike &T1, leaves the DTE
in command mode, so the ATGLK2 monitor answers while audio flows - it
returned 000 errors, so the path ran. Sweeping ports 0x00..0x7f idle
against active (artifacts/io-port-loopback-01/), only four move:
| port | idle | during &T8 |
|---|---|---|
0x18 |
FF | C0, C1, C6 |
0x1a |
FF | C0, C1 |
0x1c |
FD | F9 |
0x1e |
FF | FB |
All four are mailbox handshake and status registers. No CPU I/O port carries audio samples, so the 80186 is not in the audio path. That is a board measurement and it is unaffected by what follows.
The correction
Two claims made here from static reading do not survive the runs' own instrumentation:
"The only peripheral registers the DSP image touches are DRR and DXR; the TDM
registers 0x30..0x35 are never referenced." Wrong. TRCV (0x30) is read
676,558 times in a 60M-instruction run, at program 0x8c1e - twice for
every DRR read. The scan that missed it only matched lamm/samm forms and
did not cover the resident bank's addressing.
"The frame handlers are a four-phase rotating chain, one DRR read and one
DXR write each." That code exists, but it does not run. dxr_writes is
3 in the same run, all at program 0x00c6, which is the reset-time
initialisation. tdxr_writes and tspc_writes are 0. The DSP never
transmits on either serial port after reset.
What the DSP actually does, per run counters:
| source | reads | program |
|---|---|---|
DRR (0x20) |
338,279 | 0x8c1c |
TRCV (0x30) |
676,558 | 0x8c1e |
ASIC external I/O 0x50 |
338,279 | 0x8c1f |
ASIC external I/O 0x52 |
411,025 | - |
ASIC external I/O 0x54 |
676,556 | - |
All in one polling loop in the resident bank, and 0x52's count equals
line_frame_interrupts exactly. So the repo's existing position - that the
C52's live view of the outside world is the ASIC boundary
(courier_firmware_analysis.md, "DAA chipset identity") - is at least as well
supported as the serial-port reading, and this document should not have
asserted otherwise.
What is genuinely open is which of these the hardware uses for audio. The harness answers all of them, so run counts cannot separate them; they only show the firmware polls all three.
What the low-address code is
The dormant code at 0x0176..0x0223 is a codec control path, and a specific
one: it drives a TI TLC320AC0x, whose protocol is to request a secondary
control frame with bit 0 of the transmitted word. See
board-parts.md. It runs at reset - the three DXR writes are
its initialisation - and then stops. Whether it is dormant because the ASIC
fronts the codec on this board, or because one firmware serves two hardware
variants, is not settled here.
3. Corrected: the XMF payload loads at 8000, not 0000
Superseded 2026-09-15. This section argued that main211's DSP payload occupies program
0000..75d9, and from there that the part runs in microprocessor mode with its mask ROM never mapped. The origin was wrong. The supervisor names its own destination, and it says8000. What follows is the correction; the reasoning it replaces is in git.
The origins are not a property of the container and were never measured - they
were constants in courier_emu/xmf.py. The supervisor states them. Its
download call site is the same shape a flash ROM's is,
mov ax, <entry> ; the C5x program word to load at and enter
call <reset>
mov ax, <start> ; first source offset
mov cx, <end> ; one past the last
call <downloader>
and the further images come from the table the loader indexes with
mov bl, 6 ; mul bl ; mov bx, <base>. Read out of the images themselves:
| row | 2.1.1 / 2.2.05 | 2.3.12 / 2.3.33 |
|---|---|---|
| resident | 8000, 30,170 words |
1000, 26,080 words |
| 6 | 9d00 |
1dc9 |
| 7 | af50 / af00 |
0000, 4,090 words |
| 8 | dc00 |
5cb0 |
So the 3453B series occupies 8000..ffff - the board's two CY7C199 parts,
32K words of external program RAM - and touches nothing below 8000. The
3453C series occupies 0000..7fff instead, one image loading at program
0000.
The branch evidence reads the other way round once the origin is right. At
81cc the instruction is bcnd 81cf and it targets the bit 15, @7f that
follows it; lacc #81de at 81c3 names the handler at 81de. At origin
8000 those are literal addresses. The superseded reading placed the same code
at 01cc and had to strip bit 15 off every branch target in the segment - all
of them, with not one target below 8000 anywhere in the payload.
The wait-state argument survives, and says less than it appeared to. The reset code does program external timing:
8000 ldp #000
8001 splk @57, #ffff
8005 setc intm
8007 splk @2a, #0010 ; CWSR
8009 splk @28, #000a ; PDWSR - program/data wait states
800b splk @29, #0001 ; IOWSR - I/O wait states
(2.3.x writes 2000 and 0101 to the same two registers, and adds an
out @53, 8057 ahead of everything.) External memory is certainly in the map -
the 32K of RAM this code runs from is external. That is no longer evidence
about 0000..1fff, because the firmware never addresses it.
bootstrap_match: true at bootstrap_bytes: 60344 still holds, and still
means the supervisor transfers exactly the resident row. It never said where
the words land; the destination goes to ports 40/42 from the call site
above, and that is the 8000 the row names.
What this leaves
The 3453B payload is consistent with the 'C51 measured on the 2806 board:
0000..1fff is the part's 8K mask ROM, holding the service loader at 0610
that performs the BLDP writes, and the download fills the external RAM above
it. See the download architecture and
board.md.
The 3453C payload is not. It loads program words at 0000 and runs its
resident from 1000, both inside the window a 'C51 in microcomputer mode
answers from mask ROM, where nothing is writable and no loader survives. Those
images need external program memory from 0000 - a different part or a
different MP/MC - and no board running them has been probed here.
Nothing above is a readout of the die, and the mask ROM's contents are recovered separately in dsp-rom-content-analysis.md. What each family does with that ROM - the B series vectoring through it, the C series unmapping it and carrying a copy of its dispatch table - is measured in mask-rom-dependency.md.
Still unavailable
A host-controlled read of arbitrary DSP program memory. Tag 46 streams real
DSP program words to the host and was confirmed on hardware, but only from the
fixed base 0x860b with an index the DSP chooses from six values. No mailbox
tag exposes a table-read address. Reading 0000..0fff off the die still needs
JTAG or code execution on the DSP.
Reproducing
.venv/bin/python -m courier_emu.tick_probe \
--device /dev/cu.usbserial-21210 --baud 115200 \
--output artifacts/tick-probe-01
Needs no phone line and never takes the loop off hook. S18 is read first and
restored afterwards, and the transport's allowlist contains no &W, so nothing
reaches NVRAM.
The &T8 port sweep is recorded in artifacts/io-port-loopback-01/. It sends
only reads plus AT&T8 and AT&T0.
The DTMF digit is counted in INT0 periods, and the count is the fault
The mailbox interrupt
was measured on the board at 2,401 Hz, and setting the harness to that rate
stops a 302 dial from being decoded. This is what the tone actually does,
measured off --dsp-tx-pcm at 9,600 Hz with a 0.83 ms envelope window.
It is one-for-one with the interrupt
Four rates, one command apart (--frame-hz), everything else identical -
IDSDL302.ROM, ATDT6245, the idsdl302 fixture:
--frame-hz |
tone | gap | digits decoded |
|---|---|---|---|
| 391 (default) | 96.5 ms | 77.2 ms | 6245 |
| 782 | 52.9 ms | 43.6 ms | 6245 |
| 1200 | 35.4 ms | 30.0 ms | 6245 |
| 2401 (measured) | 18.1 ms | 16.7 ms | none |
Fitting the two extremes gives tone = 36,586 / f + 2.9 ms - 36.6 interrupt
periods plus a fixed 2.9 ms - and that model predicts the two middle rates to
within 2.5 ms, which is the envelope's own resolution. The digit is counted in
INT0 periods, one for one, with no divider anywhere in the harness.
So the failure at the measured rate is not a mailbox fault at all. It is a digit too short to decode, and the threshold sits between 35 ms, which still dials, and 18 ms, which does not.
The count comes from S11, and implies an interrupt rate of ~540 Hz
S11 moves it, linearly, at a fixed rate:
S11 |
tone | implied count at 391 Hz |
|---|---|---|
| 50 | 68.8 ms | 26.9 |
| 70 (default) | 96.5 ms | 37.7 |
| 95 | 130.6 ms | 51.1 |
1.373 ms of tone per S11 unit, with an intercept of 0.1 ms - so the firmware
loads 0.523 interrupt periods per S11 unit, and the default 70 becomes the
36.6 the sweep found independently.
That is the whole problem in one number. S11 is a duration in milliseconds, so
a default digit should be about 70 ms of tone. It is 70 ms when
36.6 counts / f + 2.9 ms = 70 ms -> f = 545 Hz
The firmware's own DTMF constants imply an INT0 rate near 540 Hz. The board runs the interrupt at 2,401. Neither number is wrong: they differ by a factor of about 4.4, and that factor is a divider the harness does not have.
What that means, and what it does not
The harness collapsed two clocks into one. There is the interrupt, which the
board says is 2,401 Hz, and there is whatever the firmware's timing chain
advances on, which its own constants say is near 540 Hz. FRAME_INSTRUCTIONS
has been standing in for the second of those - which is why 391 Hz produces
digits in the right decade and 2,401 Hz produces 18 ms - and the correction is
not to change the rate but to model both: raise the edge to 2,401 and put the
divider in front of the countdown chain.
Where the divider lives is not settled here. On the 403 image the INT0 tail runs
lcall 8000:0676 with al = 1, and that is a thunk - call [0x212]; retf -
whose target is installed at run time; the 302 build vectors INT0 at 8f43:0000
instead and leaves [0x212] reading zero at the end of a dial. Resolving it
needs the chain traced at run time, not disassembled.
Two things this does not show:
- That 4.4 is the divider. It is the ratio between a measured interrupt rate
and a rate inferred from
S11on the assumption thatS11is milliseconds of tone. If that assumption is off, so is the factor. A real digit timed on the board would settle it and has not been done. - That the digit length is 302's only problem at 2,401 Hz. The dial was read through this harness's own DTMF decoder. Its threshold between 35 ms and 18 ms is a property of that decoder, not of an exchange.
[0x134], the counter the INT0 tail decrements unconditionally, is not this
timer: --mem-watch 134:135 records 96 writes across a whole dial, one
countdown from 0x60 to zero at exactly one decrement per interrupt. It is a
one-shot of about a second, and it is the only thing in the tail that could be
mistaken for the digit clock.
Measured on the board: a digit period is exactly twice S11
The 4.4 factor above rested on S11 being milliseconds of tone. That assumption
is now replaced by a measurement, artifacts/dial-timing-01, taken on the
20.16 MHz board at 7.4.16 / 3.1.2.
No probe and no hook. courier_emu.dial_timing blind-dials (ATX0) strings
of 4 to 40 digits and times each from the command to the result code. That
interval is setup + n*(tone + gap) + S7 + reporting, and everything but the
middle term is constant in n, so the per-digit time is the slope of a line
through several digit counts and all the fixed overhead falls into the
intercept. Eight dials per setting, three settings:
S11 |
ms per digit | intercept |
|---|---|---|
| 50 | 100.12 | 4024.3 ms |
| 70 | 140.05 | 4023.7 ms |
| 95 | 190.09 | 4024.7 ms |
1.999 ms per S11 unit, through an intercept of 0.1 ms, and the fixed term
is the same 4,024 ms in all three - which is the check that the method is
sound, since it is the one number that must not move.
So a digit period is exactly 2 x S11 milliseconds: the tone and the gap after
it are each S11 ms. That is S11's documented job - duration and
spacing - and it is now measured rather than assumed.
What that fixes, and what it leaves
The harness at 391 Hz took 2.739 ms per S11 unit against the board's 1.999,
so it was 1.370x too slow, and the rate that matches is 391 x 1.370 = 536 Hz.
MODELLED_FRAME_HZ is now that, and at it:
| harness, 536 Hz | board | |
|---|---|---|
tone, S11 = 70 |
70.2 ms | 70.0 ms |
| gap | 56.9 ms | 70.0 ms |
| digit period | 127.2 ms | 140.1 ms |
The tone is right to 0.3%. The gap is not, and it is now isolated as its own
fault: the harness loads 28.4 interrupt periods for the gap against 36.6 for the
tone, where the board makes the two equal. That is a ratio of 0.78 where it
should be 1.00, and it is not a rate error - no choice of --frame-hz fixes it,
because it is the same clock counting a different number.
302 still dials 6245 to ringback and answer at the new default, with 117 DTMF
blocks against 136; 403 plain is unchanged.
The divider is near 9/2, and that is not a satisfying number
2,401 Hz measured at the interrupt, 536 Hz needed at the digit chain: a divider of 4.48. Whole numbers either side are ruled out by this data - a divider of 4 would need 2.006 ms per unit and 5 would need 2.230, against the 1.999 measured, and only 4.5 lands inside the error - but 9/2 is a strange thing for a gate array to do, and the honest reading is that one of the two rates is not yet measured as exactly as it looks. The 2,401 comes from 15,868 interrupts over a 6.61 s wall-clock window that includes the host's own write and abort, so a percent or two of it is host timing, not board timing.
Both constants therefore stay in machine.py as separate named figures rather
than being reconciled into one. What is not in doubt: the interrupt is far
faster than the chain it feeds, the chain's rate is 536 Hz to within the
precision of a tone measurement, and the harness had been modelling only one of
the two.
Chasing the gap: the interrupt clock was drifting, and it was not the cause
Two things came out of going after the 13 ms.
The frame edge was losing 4.8%, and it is fixed. The injection at
machine.py:1565 set _last_frame = self.instructions on each delivery - restarting the phase rather than advancing
it. The check only runs at the service loop's granularity, so every edge landed
a little late and the next was measured from the late one, and the lateness
accumulated. Measured by watching the handler's own status cell, which the 302
build caches at [0x285] and the 403 build at [0x17f], so every entry carries
an instruction stamp:
before 510.5 Hz delivered against 536 nominal
after 535.8 Hz mean period, 531.0 Hz median
2 periods of 17,790 longer than 1.5x nominal
_last_frame now advances by exactly one period, the way the bridge's own
counters already did, and a debt of more than one period is dropped rather than
burst - which is what the controller does, since it latches one pending edge and
_int0_pending is that slot.
It is not what makes the gap short. With the clock uniform the digit is unchanged: tone 69.6 ms, gap 56.4 ms, period 126.0 ms. So the deficit is not drift, and it is not delivery.
What the gap fault is, precisely
At 536 Hz, against the board's 2.000 x S11 + 0.1 ms:
S11 |
tone | gap | period | board period | deficit |
|---|---|---|---|---|---|
| 50 | 50.4 | 36.7 | 87.1 | 100.12 | 13.04 |
| 70 | 70.2 | 56.9 | 127.2 | 140.05 | 12.90 |
| 95 | 95.8 | 81.7 | 177.5 | 190.09 | 12.59 |
2.009 ms per S11 unit against the board's 1.999 - the rate is right to 0.5% -
through an intercept of -13.4 ms where the board's is +0.1. So:
- The tone is exact at every
S11: 50.4, 70.2, 95.8 against 50, 70, 95. - The deficit is constant in
S11, not proportional - so it is not a rate. - It is a count, not a latency: 7.04 interrupt periods at 391 Hz and 7.18 at 536 Hz, scaling as 1/f across a 1.37x change in rate.
- The period is measured tone-start to tone-start, so the envelope threshold cancels out of it and the 13 ms is real time, not a boundary artifact.
The harness's interdigit gap is therefore S11 - 13.2 ms, about seven
interrupt periods short, while the tone it alternates with is right.
Where it is not, and the one hypothesis left
Ruled out by the above: the frame rate, the delivery drift, a proportional error,
and the measurement's own thresholds. Also ruled out earlier: [0x134], and any
explanation that redistributes time between tone and gap, since the sum is
short.
What is left is what the firmware waits on between digits, and there is a candidate with a number attached. The board's DSP reports on a 20 ms cadence while the loop is off hook (the mailbox measurement), and the harness answers instantly. If the digit sequencer waits for a report boundary before starting the next tone, the board pays a wait the harness does not, and 13.2 ms sits inside one 20 ms period. That is a hypothesis with the right shape and the right magnitude; it is not established, and confirming it means finding the 302 sequencer rather than reasoning from the size of the number.
The instrument for that now exists: --mem-watch on [0x285] gives every INT0
entry an instruction stamp, and MEM_WATCH_EVENTS in machine.py bounds how
many are kept - it is 96, which keeps the tail of a run, and this measurement was
taken by raising it temporarily to 100,000 for one run rather than shipping a
larger default.
The 302 digit sequencer, and what finding it settles
Where it is
The digit commands do not go through the 24-word ring. That ring
(0x29e-0x2ce, read pointer [0x29a], write pointer [0x29c]) is filled one
word at a time by 0xf65c and three at a time - 0xff00, tag, argument - by
0xf688, and across a whole ATDT6245 it carries 45 messages, none at digit
cadence. Traced with --mem-watch 29e:2ce, whose writes all come from 0x8f678,
the store inside 0xf65c.
The digits go out through the INT0 handler's own send, at 0x8f465, and
--trace-pc 8f465 catches all nineteen words of a dial:
013f 013f 013f 013f 1500
1600 1306 1600 1600 1302 1600 1600 1304 1600 1600 1305 1600
443f 0400
0x13 carrying the keypad index, bracketed by 0x16:0000 either side - which is
exactly what bridge.py:243 documents, and the
digits are 6 2 4 5. So the sequencer is the supervisor, one tone command and
two silences per digit, and its timing is directly readable.
Note in passing that _note_dial_tone_command, which decodes precisely this, is
dead code - defined in bridge.py and called from nowhere.
What its timing says: the harness has two clocks, 4.46x apart
The sequencer's own intervals, from the instruction stamps:
S11 = 50 |
S11 = 95 |
slope | |
|---|---|---|---|
| commanded digit period | 395.4 ms | 796.5 ms | 8.913 ms per unit |
| the audio that results | 87.1 ms | 177.5 ms | 2.009 ms per unit |
| the board | 100.12 ms | 190.09 ms | 1.999 ms per unit |
The audio is right to 0.5%. The CPU's own command timeline is 4.46x too slow,
and the ratio holds at both S11 values.
That is the same 4.48 as 2401 / 536. There is no missing divider between
the interrupt and the digit chain. The frame edge really is the 2,401 Hz the
board reported; the harness's instruction clock runs about 4.47x fast against
its own audio clock, and MODELLED_FRAME_HZ = 536 has been absorbing exactly
that discrepancy - which is why setting the edge to the measured rate broke the
dial, and why 391 Hz had looked arbitrary but serviceable.
The same gap shows up without any dialling at all: a 150,000,002 instruction run
is 34.5 s on INSTRUCTIONS_PER_SECOND, and the exchange sees 99,840 samples,
which is 10.4 s of audio at 9,600 Hz.
And the gap fault survives the correction
Dividing the sequencer's own numbers by that 4.46:
tone 1.004 ms per S11 unit, intercept -0.5 ms -> tone = S11, exactly
gap 0.994 ms per S11 unit, intercept -10.8 ms -> gap = S11 - 10.8 ms
So the interdigit wait is genuinely short in the supervisor's own timeline, by
about 11 ms, independently of the clock error - it is not an artifact of it. The
tone, by the same arithmetic, is exactly S11. That matches the board's
2 x S11 period only if the board's gap is a full S11, which remains the one
thing this has not measured directly.
Two faults, then, not one, and now separable:
- The clock ratio, ~4.47x between instructions and audio samples. It is the larger of the two, it explains the divider that was not there, and fixing it would let the frame edge run at the rate the board actually reports. It also resets every constant in the harness that is expressed in instructions, which is why it is recorded here rather than attempted in the same change.
- The interdigit wait, ~11 ms short in the sequencer itself, beside a tone that is exact.
The clock ratio, found and fixed: a clock ratio applied to instructions
bridge.py scheduled the C52 as
# The Courier identifies its split as 20 MHz 80186 / 25 MHz C52.
dsp_steps = self._x86_ticks * 5 // 4
which is wrong twice over.
It compares a clock ratio against an instruction count. An 80186 instruction
is 5.93 cycles, the figure timers.py already derives and uses; a C52
instruction is one. So per 80186 instruction the C52 executes the clock ratio
times 5.93, not the clock ratio.
And the clock ratio is one, not 5/4. 25.8048 MHz is main211's crystal.
This board is 20.16 MHz throughout - its boot ROM, its DAA and its timer
programming all say so - and both processors run from it.
So the C52 was being given 5.93 times too few steps, and could not fill the
intervals the supervisor was timing. That is the whole of the two-clock split:
the supervisor's dial timeline ran 4.46x slower than the audio it produced, and
FRAME_INSTRUCTIONS had been absorbing the difference, standing at 391 and then
536 where the board says 2,401. Both were one error wearing a rate's clothing.
What it fixes
With DSP_STEPS_PER_X86 = 5.93 and the edge at the measured 2,401 Hz:
| before | after | board | |
|---|---|---|---|
tone, S11 = 70 |
70.2 ms | 73.5 ms | 70.0 ms |
| gap | 56.9 ms | 72.8 ms | 70.0 ms |
| period | 127.2 ms | 146.3 ms | 140.05 ms |
period, S11 = 50 |
87.1 ms | 104.7 ms | 100.12 ms |
ms per S11 unit |
2.009 | 2.080 | 1.999 |
| intercept | -13.4 ms | +0.7 ms | +0.1 ms |
| 302 outcome | ringback, answer | connected | - |
The gap fault is gone. Tone and gap now match each other, as the board's do, and the -13.4 ms intercept that was the whole of that fault is +0.7. It was never an interdigit wait: the C52 could not render the silence it was given, so the supervisor's next tone arrived before the gap had been filled with samples.
FRAME_INSTRUCTIONS is therefore the board's rate now, and MODELLED_FRAME_HZ
is gone. --frame-hz remains, for comparing against the measured rate rather
than for tuning.
The residual, and what it probably is
Everything is 4.1% long: the slope is 2.080 ms per S11 unit against 1.999, at
both S11 values, with a near-zero intercept. A uniform rate error of that size
is what an approximate cycles-per-instruction figure looks like - matching the
board exactly would need 5.70 rather than 5.93, and 5.93 is itself derived from
a sample count rather than measured against a bus. It is left as it is, because
5.70 would be fitting the residual and 5.93 is derived.
The DSP now runs 5.93 steps per 80186 instruction rather than 1.25, so a 150 M instruction dial takes about 3 minutes rather than 110 seconds.
What it does not fix
403 plain still dials nothing and stays idle, though its DSP-originated
messages rise from 28 to 133. Whatever holds that path is not this.