TM8 - Frequency Measurement

This trace mode is used to measure frequencies up to 1 GHz (with the prescaler).

It has a best case unwrapped precision of ± 0.03 %

Frequency measurement works by enabling the data capture engine for a pre-programmed number of signal cycles. At the end of this measurement period, the capture engine is frozen.

Instead of retrieving captured data from the sample RAM, the sample address counter itself is used to determine the duration of the measurement interval and therefore the frequency of the input signal.

There are five registers used to program trace mode 8:

R3Sample Pre-load (Low Byte)Spock Counter/RAM address (low byte).
R4Sample Pre-load (High Byte)Spock Counter/RAM address (high byte).
R14Input/AttenuationAlt/Chop channel input/attenuation settings.
R21Frequency Timer Pre-LoadNumber of signal cycles to count.
R22Frequency Pre-scaleInput frequency pre-scale divider.

and two optionally used to read the measurement duration:

R9Counter Capture (Low Byte)Spock Counter/RAM address capture (low byte).
R10Counter Capture (High Byte)Spock Counter/RAM address capture (high byte).

As with all other trace modes, the counter value is turned automatically on completion of the trace command so R9 and R10 may not need to be read.