That file had already decoded the six-word bring-up from the DSP's code, so
several things reconcile rather than being new - and two of them correct me.
MCLK is 2.880 MHz, solved from A=10, B=20 and three independently established
sample rates, and 40.320/2.880 is exactly 14. The 10.08 MHz predicted here
from 40.320/4 was arithmetic-from-plausibility and it lost to
arithmetic-from-the-firmware, as it should.
The continuity readings confirm the TI app guide's wiring that file inferred:
DOUT, DIN and FS on DSP 43, 106 and 104. But RESET <- XF does not hold - the
codec's RESET is on the shared net from CPU pin 58, which settles that file's
closing speculation in the negative. And its "the ASIC supplies SCLK and FS"
is corrected: the ASIC's only line to the codec is MCLK.
The speaker question sharpens rather than closes. The bring-up's fourth word
is 0409 - monitor squelch - so the part comes up with the speaker off and
something must write register 4 again. Whether anything does is a payload
search, not a probe. The same search would say whether AT&T1 is the codec's
analog loopback (register 5 DS01-DS00 = 00, a 0504 word) or arithmetic in the
DSP.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The recovered ROM has two boot loaders. Everything here had seen only the
serial one, because the disassembly it was read from stopped at 0x0700 and the
second starts at 0x072c. Boot-word bit 3 selects between them.
The second is not a serial port at all: it fetches each word with an XF/BIO
handshake and reads it from a memory-mapped port at data 0x50 - the same ASIC
window the resident polls for the mailbox - in 16-bit or 8-bit-pair form.
That matters because the previous section here claimed the boot table and the
codec share the primary serial port, kept apart by the AC01's high-impedance
window. The arithmetic does not work: DOUT is tri-stated for eight frames and
the download is 27,710 words. Retracted.
The parallel loader fits the board better on four counts: the supervisor's
download is already parallel, data 0x50 is already the ASIC window, it does not
contend with the codec's port, and XF - which it drives on every word - is
wired to the codec's RESET in TI's reference design.
The harness writes 4 to data 0xffff, selecting the serial loader. That was
chosen when only the serial loader was known. It boots successfully in the
model, so this is not a visible failure - which is why it went unnoticed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
XRDY says DXR can accept another word, which becomes true when a frame sync
moves the last one into the transmit shift register. It was reported set
whenever XRST was set, so the firmware's reset handshake at 0x8097 - write DXR,
spin on XRDY, write again - fell straight through instead of waiting a frame.
It now clears on a DXR write, sets on a frame sync, and is released by a 0 -> 1
edge on XRST.
Scoped to the AC01 path: the legacy TDM path models no framing on this port, so
nothing there would set XRDY again after a write and a spin would never end.
That is a limit of this model rather than hardware behaviour, and it is
commented as such.
Also records what the boot table sharing the port actually rests on. TI's
application guide puts the AC01 on the primary serial port and leaves the TDM
port pulled to COM, which the firmware agrees with; the ROM loader is on that
same port and is receive-only. The datasheet holds DOUT in high impedance until
the eighth primary frame sync, and the firmware issues exactly eight primary
frames first - two priming writes plus six register writes - so the ASIC can
drive DR with the boot table unopposed until the codec is fully programmed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
DRR was filled lazily, when the firmware happened to read it, so a run whose
receive queue was empty returned the same stale word every frame - 28,212 reads
of one value in the survey run.
codec_frame now runs at every frame sync:
- one ADC word per primary frame (section 2.4, "one word for each primary
communication interval"), delivering a zero for a quiet line rather than
repeating the last word;
- no sample on a secondary frame, which carries the addressed register when a
read was requested and zeros otherwise, so a readback arrives with the frame
rather than with the host's read;
- the secondary frame sync half a frame period after the primary that asked for
it, which is Figure 2-1's (B/2) FCLK periods given fs = FCLK/B;
- RRDY following a word having been clocked in.
The ROM boot table shares the port but is not the sample stream: a frame sync
consuming those words breaks the download. queue_codec_boot keeps them in their
own queue, drained only by the loader's polls.
302 boot measures 1911 frame syncs and 1911 samples consumed, one each, with
DRR carrying live audio.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The rate was hardcoded: 3472 cycles in the core and 9600 Hz in every generator
that filled the receive queue. The firmware retunes register 2 at runtime for
each V.34 symbol rate, so a constant is wrong by construction - and the two
figures disagreed with each other, making the DSP hear every frequency scaled
by 4/3.
C5xCore now decodes DXR the way the part does. Which kind of frame a word
belongs to is decided by the previous frame's control bits, which replaces a
test against two hardcoded ISR addresses that recognised the samples of two
known builds and nothing else. Secondary words are parsed into a nine-register
file; writing register 1 or 2 recomputes fs = MCLK/(2 x A x B) and the frame
period with it. Register reads, the no-op register, forced secondary and
software reset are handled.
bridge.LineToCodec resamples line audio to whatever rate the codec currently
reports, so the harness can keep carrying the line at a fixed rate without that
rate reaching the DSP. A 2100 Hz tone now measures 2100 Hz after conversion
instead of 1575.
Booting 302 through the ROM recovers the six reset registers, 7200 Hz, and a
frame period of 3472 - the constant it replaces, now derived.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The 9600 Hz figure was the harness's DAA_SAMPLE_RATE, not a measurement.
codec-sample-rates.md already derives 7200/7578.95/8000 Hz from the DTMF phase
increments and the V.34-indexed divider table; solving those against A = 10
gives MCLK = 2.880 MHz from all three, exactly 40.320/14, with FCLK = 144.000
kHz - the datasheet's own characterization point. A is never reprogrammed
because the 3.6 kHz anti-alias corner depends on it alone.
Records the consequence: the frame interrupt already runs at 7200 Hz while
every generator filling the receive queue assumes 9600, so the firmware sees
every frequency scaled by 4/3.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The TLC320AC01's secondary-frame mechanism is driven entirely from the C5x
XINT handler, which ORs a request code into the two LSBs of every DAC word and
revectors its own B2 dispatch cell for exactly one frame to send the control
word. Six registers are programmed at reset; they select free-run conversion,
+6 dB input gain, the high-pass filter, and fs = MCLK/400.
Records the disassembly, the runtime trace confirming it, the decoded register
values, and what the emulator currently discards.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>