SAM L10/L11 Frequency Meter (FREQM)

# Frequency Meter (FREQM)

## Overview

FREQM can be used to accurately measure the frequency of a clock by comparing it to a known reference clock.

## Features

• Ratio can be measured with 24-bit accuracy
• Accurately measures the frequency of an input clock with respect to a reference clock
• Reference clock can be selected from the available GCLK_FREQM_REF sources
• Measured clock can be selected from the available GCLK_FREQM_MSR sources

## Principle of operation

FREQM counts the number of periods of the measured clock (GCLK_FREQM_MSR) with respect to the reference clock (GCLK_FREQM_REF). The measurement is done for a period of REFNUM/fCLK_REF and is stored in the Value register (VALUE.VALUE).

REFNUM is the number of Reference clock cycles selected in the Configuration A register (CFGA.REFNUM).

The frequency of the measured clock, fCLK_MSR, is calculated by:

$f_{CLK\_MSR} = \frac{VALUE + 1 + Error}{REFNUM + 1} f_{CLK\_REF}$ , where "Error" represents the error introduced by the synchronization mechanism. The error can be a maximum of two measured clock cycles.

The reference clock frequency, fCLK_REF, must be slower than the measurement clock frequency, fCLK_MSR.

Refer to the "FREQM – Frequency Meter" chapter from the product data sheet for more details.