93K_TMU

TMU测试方法包含以下:

•Frequency-测量信号的频率与TMU。

•PropDelay -测量信号的传播延迟与TMU。

•PulseWidth-测量信号的脉冲宽度与TMU。

•RiseFallTime -测量上升和下降时间的信号与TMU。

•TmuBurst -执行上述列出的TMU测量(频率,脉冲宽度,传播延迟,上升和下降时间)在同一时间在一个突发。您可以指定在突发中包含任何或所有这些TMU测量值。

•TmuJitter -测量信号的抖动与TMU。

TMU频率测试原理,根据给定的模式(斜率),取上升沿或下降沿固定的时间点,周期、频率是根据连续的时间点进行计算。然后取平均周期或频率。TDC255275

TMU可在指定向量或者未指定向量的情况下执行。

详解:

Parameter

Type

Decription

pins

PinString

The digital pin(s) or pin group(s) to be measured.

mode

string

The measurement mode. It can be:

FREQ+: measure the frequency from rising edge to rising edge

FREQ-: measure the frequency from falling edge to falling edge

PER+: measure the period from rising edge to rising edge。如果捕获多个周期,则仅报告平均周期。.

PER-: measure the period from falling edge to falling edge. 如果捕获多个周期,则仅报告平均周期。.

PERALL+: measure the periods from rising edge to rising edge.报告计算的所有周期。还报告了平均周期。

PERALL-: measure the periods from falling edge to falling edge. 报告计算的所有周期。还报告了平均周期。.

datarate [Mbps]

long

待测信号的最大预期数据速率 [Mbps].

sample_per_meas

long

每次测量要取的样本数量

initial_discard

int

arming 后要丢弃的样本数量.

Default is 0.

inter_sample_discard

int

两个样本之间要丢弃的样本数

Default is 0.

exit if TMU has not finished

int

 控制测试方法是否退出的标志. 

0: Upload the results

1: Do not upload the results

Default is 0.

wait timeout[s]

double

等待TMU完成测量的时间.

The default value is 1e-6.

The time depends on how long the TMU will run.

ftstResult

int

The flag indicating whether the functional test result is taken into account of the final pass/fail result. It can be:

0: do not include functional test result

1: include functional test result

Default is 1.

output

string

Output the measurement result to the UI report window or not.

ReportUI: output to UI report window.

None: do not output to UI report window.

Default is None.

testName

string

The test names to be used as limits. Default is meanValue.

If you want to use the test names defined in the test table or testflow limits, type in the test names manually. Make sure the test names are in the Test name column of the test table (Refer to Structure of a TMLimits CSV file) or in the Test Name column of Tests page of Flow Data Editor.

TMU_TASK

EXAMPLE1:TMU RAW DATA

在结束TMU数据采集之前设置等待时间,然后上传原始结果.正确的超时值取决于采样的数量、信号频率以及参数precaler和interSampleDiscard,如下面的示例代码所示。

检查TMU是否运行结束:

bool taskFinished = false;

tmuTask.waitTMUfinished(tmuTimeout, taskFinished);

cout << "TMU finished = " << taskFinished << endl;

您可以通过传递1µs作为超时值来调用waitTmuFinished()。但是必须在retrieving TMU结果之前调用它:

double tmuTimeout = numSamples * (1/freqSignal) * preScaler* interSampleDiscard +(1/freqSignal) * initDiscard;

tmuTimeout = tmuTimeout * 1.1; // safety margin

cout << "TMU Timeout = " << tmuTimeout * 1e3 << "ms" << endl;

tmuTask.pin(pinList)

.setEdgeSelect (edge)

.setAThreshold (threshold)

.setNumSamples (numSamples)//

.setNumShots (1)//

.setNumMeasurements (1)//

.setInterSampleDiscard (interSampleDiscard)//RISE_FALL模式必须为偶数

.setPreScaler (preScaler)//分频,RISE_FALL模式 2-16

.setInitialDiscard (initDiscard);//

关闭TMU任务 ,不关闭TMU.

//tmutask.diableTMU();

datarate的另一种设置方法如下,DATA_RATE_DEPENDENT_VALUES_TYPE是一个数据结构,用于接收precaler (precaler成员)、interdiscard(interdiscard成员)、precaleroffsetmember (precaleroffsetmember)和targetSamplingRate targetSamplingRate成员)的计算值:

TMU::DATARATE_DEPENDENT_VALUES_TYPE drsettings;

tmuTask.pin(pAll)

.setEdgeSelect(edge)

.setAThreshold(threshold V)

.setNumSamples(numSamples)

.setNumShots(1)

.setNumMeasurements(1)

.setInitialDiscard(initDiscard);

.setDatarate(datarate,drsettings);

示例:TMU频率测试

两种方式测量频率,第一种是为了提高测量精度,将采到的两个沿的时间 除以 经过的周期。经过的周期=(mInterSampleDiscard+1)*mPrescaler

ON_FIRST_INVOCATION_BEGIN();

{

task.pin(digitalPin)

.setEdgeSelect(TMU::RISE)

.setInterSampleDiscard(mInterSampleDiscard)//舍弃99个点

.setNumSamples(2).//每次测量采样两次

setNumMeasurements(1)//每次ARM测量5次

.setPreScaler(mPrescaler);//1倍分频

CONNECT() ;

task.setAsPrimary();

task.setup();

FUNCTIONAL_TEST() ;

}

ON_FIRST_INVOCATION_END();

TMU_RESULTS tmuResults;

task.pin(digitalPin).uploadRawResults(tmuResults);

ARRAY_D values;

tmuResults.getPinMeasuredResults(digitalPin, values, TMU::APP_RAW);

cerr << setprecision(10);//设置10位小数

cerr << "FREQUENCY (via raw data upload) = "<<((mPrescaler*(mInterSampleDiscard+1)) / (values[1]-values[0]))*1e-6 << " MHz"<< endl;

task.pin(digitalPin).uploadPeriodResults(tmuResults);

DOUBLE period = tmuResults.getPeriodMean(digitalPin);

cerr << setprecision(10);

cerr << "FREQUENCY (via HW processing) = " << 1e-6/period << " MHz" << endl;

示例:TMU测试jitter

TMU_PIN

TMU_RESULT

TMU PER PIN OVERVIEW

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值