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:
R3 Sample Pre-load (Low Byte) Spock Counter/RAM address (low byte). R4 Sample Pre-load (High Byte) Spock Counter/RAM address (high byte). R14 Input/Attenuation Alt/Chop channel input/attenuation settings. R21 Frequency Timer Pre-Load Number of signal cycles to count. R22 Frequency Pre-scale Input frequency pre-scale divider.
and two optionally used to read the measurement duration:
R9 Counter Capture (Low Byte) Spock Counter/RAM address capture (low byte). R10 Counter 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.