CodingBox Documentation

The controller and its firmware: DDM, APC, memory, protection

Every managed transceiver has a small computer inside. The microcontroller (MCU) measures, regulates, reports and — from the programmer's point of view most importantly — is the memory you read and write. Whether a module has a plain EEPROM or an MCU pretending to be one decides how it can be coded, why some writes vanish after a power cycle and why passwords exist at all. This page describes what the controller does and how its design shows up on the bench.

What the MCU does

TaskDetailsVisible as
Measurementsamples temperature (thermistor or on-chip sensor), Vcc, laser bias, monitor-PD current (Tx) and receiver photocurrent (Rx) through a 10–12-bit ADC several times per second; applies factory calibrationDDM values — Parameters
APC — automatic power controlcompares monitor-PD current with the factory target and adjusts the driver's bias DACconstant Tx power, rising bias — Tx bias & ageing
Temperature compensationlook-up tables adjust modulation current and, on PAM4, DSP settings across temperaturestable extinction ratio
TEC controlPID loop holding laser temperature on cooled modules; wavelength-locker feedback on DWDMlaser temperature, TEC current monitors
Thresholds and flagscompares every monitor with the alarm/warning thresholds, sets latched flags, drives IntLThresholds & alarms
Low-speed pinsreads TX_DISABLE, RS0/RS1, LPMode, ResetL; drives TX_FAULT, RX_LOS (or gates the hardware signals)pin behaviour
Two-wire slaveanswers at A0h/A2h (SFP) or A0h with pages/banks (QSFP, CMIS)the memory map — Two-wire interface
State machinesCMIS module and data-path states; application selection; squelchCMIS
Protection and vendor functionspasswords, write-protect regions, save commands, vendor unlock, authentication signaturesWrite-protection types
CDB / firmware updateon CMIS modules, receives and flashes new firmware imagesfirmware version bytes

Typical parts: 8-bit MCUs (8051-class) with a few kB of flash in low-cost SFP/SFP+; 32-bit Cortex-M class in 100G+ and CMIS modules; some vendors use a dedicated transceiver-controller ASIC that integrates ADCs, DACs and the two-wire slave.

Two ways to build the memory

DesignHow the map is storedConsequences for programming
Discrete EEPROM (e.g. AT24C02-class) for A0h, MCU for A2hA0h identity is a real serial EEPROM the host and programmer talk to directly; the MCU handles diagnostics onlyA0h writes are plain EEPROM writes — respect t_WR and page size; a hardware WP pin may block them (Write-protection types 1–3)
MCU-emulated mapthe MCU answers every two-wire request from RAM and mirrors changes to its internal flash/EEPROM — or notwrites go where the firmware decides: accepted, ignored, password-gated, stored only after a save command, or overwritten from the firmware's own copy on the next boot (types 4–5)
HybridEEPROM for the vendor block, MCU for pages and passwordsmixed rules per byte range

An emulated map explains most bench mysteries: FFh from a page the firmware does not implement, writes that "succeed" and revert, bytes that are read-only in one range and free in the next, clock stretching while the MCU is busy sampling (EEPROM read & write errors).

Boot and the t_init window

On power-up the MCU loads calibration and identity from its non-volatile store, starts the ADC, runs the APC to its target and only then enables the two-wire slave and clears data-not-ready. That is the 300 ms (SFP) to 2 s (QSFP/CMIS) the specifications allow before a host may expect answers, and the reason a read immediately after insertion returns garbage (What the host does).

Calibration lives here

The raw ADC counts mean nothing without the constants the factory measured on a test station: monitor-PD current vs actual launch power, receiver photocurrent vs input power at the module's wavelength, thermistor curve, bias DAC scale. On internally calibrated modules the firmware applies them and reports physical units; on externally calibrated modules the constants are written to A2h 56–91 for the host to apply (Calibration). Overwriting the vendor area where some firmwares keep these constants produces absurd DDM or a dead APC loop — the classic way a careless write "bricks" a module (Manufacturing & testing).

How protection is implemented

MechanismImplementationBench view
Passwordfirmware compares the 4 bytes written to the password area (SFP A2h 123–126, QSFP 123–126, CMIS 122–125) with a stored value; unlocks writes for the sessionWRITE FAIL until the right value is entered — Passwords
Write-protect regionsfirmware ignores writes to ranges it considers read-only (checksums, thresholds, calibration, vendor area)bytes read back unchanged, no error
Hardware WP pin on a discrete EEPROMthe pin is tied high inside the module or driven by the MCUneeds the programmer board to drive it
Save commandwrites land in RAM; a vendor-specific sequence commits them to flashreverts after power cycle unless the sequence is sent
Firmware mirroron boot the firmware rewrites the map from its own imagechanges vanish at every power cycle — only the vendor's tool can change the image
Authenticationthe firmware computes a signature (hash of serial, vendor data and a secret) into vendor bytes; the host verifiesidentity edits pass checksums yet the host still rejects — Vendor lock

How each type is recognised and programmed: Write-protection types, EEPROM recoding.

Firmware updates

CMIS modules can receive firmware over the two-wire bus through CDB commands (start download, write blocks, complete, run, commit), often with two image banks so a failed update falls back. SFF-8472/8636 modules have no standard mechanism; vendors use proprietary sequences through vendor bytes. Firmware fixes are how vendors resolve CMIS interoperability problems (CMIS issues), and firmware version bytes (CMIS lower page 39–40, page 01h 128–129) are worth recording with the identity.

Failure modes of the controller

SymptomLikely cause
Module invisible on the bus, optics otherwise fineMCU not booting: corrupted firmware, brown-out, damaged crystal
DDM values frozen or absurdADC or calibration corruption; firmware hang
Tx power drifting although APC should hold itmonitor-PD or ADC fault, APC disabled
Random NACKs, slow readsMCU overloaded (sampling), clock-stretch limits exceeded by a fast programmer
Works, but every write revertsfirmware mirror by design — not a fault
Module dead after a writefirmware configuration or calibration area overwritten

In CodingBox

CodingBox treats the module as the firmware presents it: it detects the map type, applies known passwords and programming scripts for save-command and mirrored designs, recalculates checksums, keeps a backup before every write and lets you restore it from the code database if a controller reacts badly. The EEPROM editor marks ranges that the specification defines as read-only or vendor-specific so you know when you are writing into the firmware's private territory.