Skip to content

Timestamp ADC samples promptly

magnupet edited this page Nov 23, 2018 · 7 revisions

Guideline Information

Item Value
Guideline Number 11
Guideline Responsible (Name, Affiliation) Björn Gottschall, NTNU
Guideline Reviewer (Name, Affiliation) Magnus Peterson, Synective Labs
Guideline Audience (Category) System architect
Guideline Expertise (Category) TBD
Guideline Keywords (Category) Sampling, performance analysis

Guideline advice

When sampling an analog signal using an ADC, timestamp the samples as close as possible to the sampling instant.

Insights that led to the guideline

A free-running ADC enables sampling an analog signal at a high frequency. Samples from the ADC are typically sent over a serial link to a host computer for timestamping and further processing. These timestamps do not capture the timing nature of the analog signal accurately due to cable latency, buffering by the serial communication stack, and unpredictable OS scheduling of the processing program.

Recommended implementation method of the guideline along with a solid motivation for the recommendation

Timestamp ADC samples promptly i.e., as close as possible to the ADC sampling instant and before sending them over the serial link to the processing program on the host computer. This ensures that the timestamps reflect the timing nature of the analog signal.

Instantiation of the recommended implementation method in the reference platform

The current sensor board called Lynsyn built to measure power consumption of the EMC2DP timestamps ADC samples before sending over serial link to the host computer.

Evaluation of the guideline in reference applications

Profiling applications intrusively by requesting samples from an external ADC inevitably adds latencies for the communication. This latency can vary widely depending on the used interface and the communication stack. Lynsyn supports this type of sampling via an I2C interface, which adds ~300 us latency for the request of one sample. To overcome this issue, Lynsyn provides non-intrusive timestamped sampling, adding no sampling latencies from any communications due to local buffering on the ADC. The host collects the buffered data and does not interfere with the actual sampling process or the profiled application running on the target. In this way, the acquired samples represent the analog signal as good as possible.

References

Review

Related guidelines

none

Clone this wiki locally