Command-Line Options
Sample
Running the frequency discipline sample with the
-h
option yields the following usage message:Usage: tcc_tgpio_frequency_discipline_sample [--pin N] [--channel N] [--device <device_name>] [--period N | --frequency N] [--sleep N] [--proportional N] [--integral N]
Option | Description |
---|---|
--pin N | Specify the output pin index. Default: 0. |
--channel N | Specify the channel for the output pin. Default: 0. |
--device device_name | Specify the TGPIO device. Default: “/dev/ptp0”. |
-T N , --period N | Specify the output period in nanoseconds. Default: 76896. |
-f N , --frequency N | Specify the output frequency in hertz. Default: 13004. |
-s N , --sleep N | Specify the interval in nanoseconds between the changes of the output period.
Default: 1000000. |
-p N , --proportional N | Specify the proportional gain of the PI controller. Default: 0. |
-i N , --integral N | Specify the integral gain of the PI controller. Default: 0. |
Analyzer Script
Running the analyzer script with the
-h
option yields the following usage message:usage: tcc_tgpio_frequency_discipline_sample_plotter.py [-h]
[--units {ns,us,ms,s,Hz,kHz,MHz}]
[--output OUTPUT]
files [files ...]
Option | Description |
---|---|
Positional arguments files | Log file or files: <path>,<period|frequency> [<path>,<period|frequency> …] |
--units UNIT | Time units to display. Available units: s, ms, us, ns, Hz, kHz, MHz |
--output FILE | Output file; otherwise, display in window |
-h , --help | Show this help message and exit |
File Format
The format of the export file may vary by logic analyzer hardware and software. The Saleae* Logic 1.2.x logic analyzer software was used in this sample.
tcc_tgpio_frequency_discipline_sample_plotter.py
works with comma-separated CSV files.
The first column is a timestamp of each edge, in seconds. The second column is the edge.
A rising edge is 1; a falling edge is 0. This script supports files with only
one channel.Example file:
Time[s], Channel 0
0.000000000000000, 0
1.017330524000000, 1
2.131018628000000, 0
2.131057090000000, 1
2.131095558000000, 0
...