Precision timing

Browse source code on GitHub

Overview

This sample implements a small software-backed precision clock and uses the precision-timing API to set its absolute time and apply phase and rate corrections. The rate correction is calculated by an independent PI controller.

Building and Running

Build and run the sample on native_sim:

west build -b native_sim/native/64 samples/subsys/precision_timing
west build -t run

Sample Output

Precision clock: time 1000250000 ns, rate 16.25 ppm

See also

Precision Time
Precision Clock
Precision PI Controller