Developer Guide

  • 2021.2
  • 06/11/2021
  • Public
Contents

Output Scenario: Period Jitter

Period jitter is the variation in the signal’s period from the ideal period over time. To measure period jitter, you can measure the period of many cycles and subtract from the ideal period. With many measurements, you can calculate statistics, such as minimum, maximum, and standard deviation. In this scenario, you will generate a signal and use a logic analyzer to capture the data. You will do this first with software GPIO, then with TGPIO, and compare jitter values.
Command Example
  1. Connect software GPIO pin 0 to channel 0 of the logic analyzer. Connect TGPIO pin 0 to channel 2 of the logic analyzer. Connect the ground pin to the ground of the logic analyzer (any channel).
    The names “software GPIO pin 0” and “TGPIO pin 0” are placeholders. For information about pins specific to your hardware, see Example Pins.
  2. Open two terminal windows.
  3. In the first terminal, run stress-ng.
    stress-ng -t0 -C 0 -c 0 --taskset 2 --aggressive
  4. Run software GPIO mode:
    1. In the second terminal, go to the following directory:
      cd /usr/share/tcc_tools/samples/tcc_tgpio_samples/tcc_tgpio_advanced_sample/cfg/<BOARD>
      Where
      <BOARD>
      matches your current platform.
    2. Run the sample in software GPIO mode:
      tcc_tgpio_advanced_sample --mode soft --signal_file soft_signal.cfg
    3. In the logic analyzer software, start data capture on channel 0 for 15 seconds.
    4. Wait until the logic analyzer stops capturing data.
    5. Stop the sample (Ctrl+C).
    6. Export the data from the logic analyzer software as
      1ch_swgpio.csv
      .
  5. Run TGPIO mode:
    1. In the second terminal, run the sample in TGPIO mode:
      tcc_tgpio_advanced_sample --mode tgpio --signal_file tgpio_signal.cfg
    2. In the logic analyzer software, start data capture on channel 2 for 15 seconds.
    3. Wait until the logic analyzer stops capturing data.
    4. Stop the sample and stop stress-ng (Ctrl+C).
    5. Export the data from the logic analyzer software as
      1ch_tgpio.csv
      .
  6. Analyze the captured data with the provided script:
    1. Go to the script directory:
      cd ${TCC_ROOT}/samples/plot_scripts
    2. Copy the CSV files from the previous steps to this directory.
    3. Run the script to analyze results:
      ./tcc_signal_analyzer_plotter.py --period --units ms 1ch_swgpio.csv 1ch_tgpio.csv
Output Example
The output shows the minimum or shortest period, the average period, the maximum or longest period, standard deviation, and jitter (the difference between the minimum period and the maximum period). For example:
---- 1ch_swgpio.csv ---- min: 0.458416 ms avg: 0.500017 ms max: 0.538310 ms std: 0.002093 ms jitter: 0.079894 ms ---- 1ch_tgpio.csv ---- min: 0.500014 ms avg: 0.500017 ms max: 0.500020 ms std: 0.000003 ms jitter: 0.000006 ms
The script generates a plot, which appears in a separate window. For example:
In this example, software GPIO data is represented in blue. TGPIO data is represented in orange. Software GPIO causes higher jitter compared to TGPIO. Results may vary based on system events, such as interrupts and scheduler.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.