Calibration Protocol

The protocol for calibration is simple and fast to ensure that it can be used in production environments. The pins used for programming the device, either the ISP interface or the JTAG interface, are also used for calibration since they are most likely to be available in a final product (or on the PCB).

Two pins are used for calibration: MOSI and MISO on the ISP interface, or TDI and TDO on the JTAG interface. To simplify the following explanations, only MOSI and MISO are mentioned, although these can be replaced with TDI and TDO for the case of the JTAG interface.

The overall concept is that the programming tool generates the calibration clock (C-clock), and the device uses this as a reference to calibrate its internal RC oscillator. When the device has completed the calibration it signals “OK” to the programming tool on the MISO line.

The device is responsible for enabling a pull-up on the MOSI line, and the programming tool is responsible for enabling a pull-up on the MISO line. Unfortunately the programming tool is in many cases behind level converters, so the device sets also the MOSI line high. This is done to make sure that noise is unlikely to corrupt the calibration.

The programming tool can use 1024 C-cycles (cycles on the C-clock) as a time-out period, as the calibration routine is guaranteed to be completed within this number of C-cycles.