IC测试论坛--专业IC测试网

标题: 在IC测试中如何应用欠采样理论进行波形的抓取 [打印本页]

作者: ictest    时间: 2009-7-7 09:47
标题: 在IC测试中如何应用欠采样理论进行波形的抓取
各位在实际的IC测试中有没有用过欠采样理论,在程序中如何实现,可否分享一下?
作者: admin    时间: 2009-7-9 14:36
抛块砖头:欠采样在实际测试中用的不多,目前高端测试机采样频率已经很高,基本满足目前市场上的芯片测试,另外欠采样对所采波形有严格要求,不是所有的波形都可以用欠采样来实现
作者: 半仙    时间: 2009-7-22 17:26
 有啊..其实J750里面和93k里面的用来量测PLL的输出频率都是用的欠采样理论实现的..

原理都差不多,就是设置输出全部都是H或者L..然后设定一个期望的范围, 如果有信号频率落在这个范围内,就判断pass.否则就是fail..

当如果输出频率在区间内有两个或两个以上的话, 就会报错..

这个是我所知道的欠采样的唯一应用了...

作者: ictest    时间: 2009-7-26 11:52
多谢两位回复,对于楼上的回复,在下有个疑问:“就是设置输出全部都是H或者L..然后设定一个期望的范围, 如果有信号频率落在这个范围内,就判断pass.否则就是fail”,既然输出都设置成H了,又怎么设置期望的范围呢,是在pattern里实现测试的,还是VB的编程里实现的??楼上能否再详细说一下

作者: 半仙    时间: 2009-7-26 19:45
 其实就是先在pattern里面的输出管脚全部设置成H或者L, 为的就是使输出结果为有pass和fail, 然后通过pass和fail的关系, 采样信号的频率和欠采样的理论计算出可能存在的输出频点(这个频点可能有无穷多个), 然后再根据设定的输出频率的频点范围, 输出的频点的数值..

但是如果输出频点的范围设置比较大的话, 落在这个区间里面有两个或者两个以上的频点, 那么就会报错...

我不知道现在有没有说清楚, 对于750里面的设置和代码的问题, 可以见如下所示:

HOW TO USE FREQUENCY COUNTER MODE ON THE J750
Last update by Daniel Murphy 3/22/99
What is Frequency Counter Mode?
Frequency Counter Mode is a pin setup on the J750 that allows the programmer to
count transitions on the specified pin. When a digital channel is in frequency
counter mode, its comparator output is gated to the positive edge triggered
clock input on the 16-bit frequency counter register associated with that
channel. Thus positive transitions on the specified pin cause the frequency
counter register to be incremented. The contents of frequency counter registers
may be cleared or read by an application program. Reading a frequency counter
register returns a 2’s complement number (range –32768 to +32767). Negative
values occur when the count surpasses 32767. To convert a negative number to a
positive value, add 65536 to it.
What are the restrictions on a test that uses Frequency Counter Mode?
1. The timing sheet used (Edge Set or Time Set Basic) must be in Extended Mode.
2. The timing sheet must set the mode of the pin that will do frequency counting
by selecting “freq_counter” in the Pin/Group Setup column.
3. The timing sheet must set the Compare Mode column of the pin to Window.
4. The pattern file must contain a “pin_setup freq_counter” statement specifying
the pins or channels that are in frequency counter mode. The pattern will use
the symbolic data characters 0 and X to open and close the frequency counter
window. See the description of frequency counter data below.
5. The program should clear the frequency counter register prior to executing
the test and read back the value in the register at the conclusion of the test.
How do I clear or read a channel’s frequency counter register in a test?
As of this writing there are four functions in the J750 Visual Basic for Test
API (Application Program Interface) which may be called by a program to access
the Frequency Counter registers. They are described below as well as in the VB
for Test help:
TheHdw.Digital.FreqCtr.Method where Method is one of the following:
1. ClearChan: This function clears the frequency count for a channel.
Syntax
TheHdw.Digital.FreqCtr.ClearChan(ByVal DigChanNum As Long)
Where DigChanNum = The number of a digital channel.
2. ClearPinSite: Clear the frequency count for a pin at a site.
Syntax
TheHdw.Digital.FreqCtr.ClearPinSite(pinName As String, ByVal Site As
Integer)
Where PinName = The name of a digital pin.
Site = The number of a site.
3. ReadChan: Return the frequency count for a channel.
Syntax
TheHdw.Digital.FreqCtr.ReadChan(ByVal DigChanNum) As Integer
Where DigChanNum = The number of a digital channel.
4. ReadPinSite: Return the frequency count for a pin at a site.
Syntax
TheHdw.Digital.FreqCtr.ReadPinSite(pinName As String, ByVal Site) As
Integer
Where PinName = The name of a single digital pin.
Site = The number of a site.
You may construct your own interpose functions using these API calls. For
reference, the next section has three, well documented sample Interpose
functions. The first, “ClearFreqCounter”, is for clearing a specified pin’s
frequency counter register, site by site. The second, “ReadFreqCounter”, will
read a pin’s Frequency Counter Register, site by site, and compare the values to
specified limits. The third, “MeasureFreq”, will read a pin’s Frequency Counter
Register, site by site, convert the values to frequency, and compare each
calculated frequency to specified limits.
Sample Interpose Function #1: Use to a pin’s Clear Frequency Counter Register
Option Explicit
' ==================================
' Public Functions: ClearFreqCounter
' ==================================
'
' This function clears the Frequency Counter for each active site.
' This routine is typically included in an Functional_T interpose
' function (StartOfBodyF).
'
' Inputs:
' argv(0) = the pinname whose frequency counter register is to be cleared
'
' Returns:
' The Function Fail Status (TL_SUCCESS or TL_ERROR)
'
Public Function ClearFreqCounter(argc As Long, argv() As String) As Long
Dim site As Long
Dim pinname As String
ClearFreqCounter = TL_SUCCESS
On Error GoTo ClearFreqCounterError
' Check to make sure that correct number of values are passed in
If argc <> 1 Then
MsgBox "Interpose function ClearFreqCounter requires a Pin Name as a
Parameter"
ClearFreqCounter = TL_ERROR
Exit Function
Else
pinname = argv(0)
End If
' Serially Clear Frequency Counter by Site
If theexec.Sites.SelectFirst <> loopDone Then
Do
site = theexec.Sites.SelectedSite ' get the site
' clear frequency count
Call TheHDW.Digital.FreqCtr.ClearPinSite(pinname, site)
Loop While theexec.Sites.SelectNext(loopTop) <> loopDone
End If
Exit Function
ClearFreqCounterError:
On Error GoTo 0
Call theexec.ErrorLogMessage("Function Error: ClearFreqCounter")
Call theexec.ErrorReport
ClearFreqCounter = TL_ERROR
End Function
Sample Interpose Function #2: Use to Read Frequency Counter Register
' =====================================
' Public Functions: ReadFreqCounter
' =====================================
'
' This function reads back the Frequency Counter register of the specified
' pin for each active site and compares the value to specified limits. The test
' results will be output to the Datalog in parametric format (i.e. with limits).
' This routine is typically included in an Functional_T interpose
' function (EndOfBodyF).
'
' Inputs:
' argv(0) = the pinname whose frequency is to be measured
' argv(1) = the test lower limit (in counts)
' argv(2) = the test upper limit (in counts)
'
' Returns:
' The Function Fail Status (TL_SUCCESS or TL_ERROR)
'
Public Function ReadFreqCounter(argc As Long, argv() As String) As Integer
Dim site As Long
Dim testnum As Long
Dim freq_count As Double
Dim count_min As Double
Dim count_max As Double
Dim pinname As String
Dim channum As Long
ReadFreqCounter = TL_SUCCESS
On Error GoTo ReadFreqCounterError

作者: 半仙    时间: 2009-7-26 19:45

' Check to make sure that correct number of values are passed in
If argc <> 3 Then
MsgBox "Incorrect Number of Arguments to Interpose Function
ReadFreqCounter."
ReadFreqCounter = TL_ERROR
Exit Function
Else
pinname = argv(0)
count_min = argv(1)
count_max = argv(2)
End If
' Serially read back the Frequency Counter Register counter, site by site
If theexec.Sites.SelectFirst <> loopDone Then
Do
site = theexec.Sites.SelectedSite ' get the site
' Get the frequency count for a pin at a site.
freq_count = TheHDW.Digital.FreqCtr.ReadPinSite(pinname, site)
' Get the actual flow testnumber
testnum = theexec.Sites.site(site).TestNumber
' Do test and print result (get channel number for printout)
channum = TheHDW.ChanFromPinSite(pinname, site, chIO)
If freq_count < count_min Or freq_count > count_max Then
theexec.Sites.site(site).TestResult = siteFail
Call theexec.Datalog.WriteParametricResult(site, testnum,
logTestFail, 0, pinname, channum, count_min, freq_count, count_max, 0, 0, 0, 0)
Else
theexec.Sites.site(site).TestResult = sitePass
Call theexec.Datalog.WriteParametricResult(site, testnum,
logTestPass, 0, pinname, channum, count_min, freq_count, count_max, 0, 0, 0, 0)
End If
Loop While theexec.Sites.SelectNext(loopTop) <> loopDone
End If
Exit Function
ReadFreqCounterError:
On Error GoTo 0
Call theexec.ErrorLogMessage("Function Error: ReadFreqCounter")
Call theexec.ErrorReport
ReadFreqCounter = TL_ERROR
End Function
Sample Interpose Function #3: Use to Measure Frequency on a pin
' =====================================
' Public Functions: MeasureFreq
' =====================================
'
' This function reads back the Frequency Counter register of the specified
' pin for each active site and converts the register value(s) to frequency
' using the specified vector period and specified number of cycles of the
' test. The calculated frequency is tested against the specified limits and
' the test results output to the Datalog in parametric format (i.e. with limits)
' This routine is typically included in an Functional_T interpose
' function (EndOfBodyF).
'
' Inputs:
' argv(0) = the pinname whose frequency is to be measured
' argv(1) = the tester vector period on the specified pin for this test
(seconds)
' argv(2) = the number of tester cycles during which the measurement will be
made
' argv(3) = the test lower limit (in Hz)
' argv(4) = the test upper limit (in Hz)
'
' Returns:
' The Function Fail Status (TL_SUCCESS or TL_ERROR)
'
Public Function MeasureFreq(argc As Long, argv() As String) As Integer
Dim site As Long
Dim testnum As Long
Dim freq_count As Double
Dim freq_value As Double
Dim freq_min As Double
Dim freq_max As Double
Dim prog_period As Double
Dim num_periods As Long
Dim pinname As String
Dim channum As Long
MeasureFreq = TL_SUCCESS
On Error GoTo MeasureFreqError
' Check to make sure that correct number of values are passed in
If argc <> 5 Then
MsgBox "Incorrect Number of Arguments to Interpose Function
MeasureFreq."
MeasureFreq = TL_ERROR
Exit Function
Else
pinname = argv(0)
prog_period = argv(1)
num_periods = argv(2)
freq_min = argv(3)
freq_max = argv(4)
End If
' Serially read back the Frequency Counter Register counter, site by site
If theexec.Sites.SelectFirst <> loopDone Then
Do
site = theexec.Sites.SelectedSite ' get the site
' Get the frequency count for a pin at a site.
freq_count = TheHDW.Digital.FreqCtr.ReadPinSite(pinname, site)
' Calculate frequency value from frequency count
freq_value = freq_count / (prog_period * num_periods)
' get actual flow testnumber
'testnum = tl_FlowGetTestNumber(0)
testnum = theexec.Sites.site(site).TestNumber
' Do test and print result (get channel number for printout)
channum = TheHDW.ChanFromPinSite(pinname, site, chIO)
If freq_value < freq_min Or freq_value > freq_max Then
theexec.Sites.site(site).TestResult = siteFail
'Call tl_FlowSetSiteTestResult(site, 0) ' fail
Call theexec.Datalog.WriteParametricResult(site, testnum,
logTestFail, 0, pinname, channum, freq_min, freq_value, freq_max, 0, 0, 0, 0)
Else
theexec.Sites.site(site).TestResult = sitePass
'Call tl_FlowSetSiteTestResult(site, 1) ' pass
Call theexec.Datalog.WriteParametricResult(site, testnum,
logTestPass, 0, pinname, channum, freq_min, freq_value, freq_max, 0, 0, 0, 0)
End If
Loop While theexec.Sites.SelectNext(loopTop) <> loopDone
End If
Exit Function
MeasureFreqError:
On Error GoTo 0
Call theexec.ErrorLogMessage("Function Error: MeasureFreq")
Call theexec.ErrorReport
MeasureFreq = TL_ERROR
End Function
What does my pattern file need to use frequency counter mode?
A pattern file that uses a pin in frequency counter mode requires the following
statements and use of data formats:
1. Statements:
A pin_setup statement that identifies pins as freq_count pins must be appear in
the pattern file before the vector statement and after any compiler control
statements.
Syntax
pin_setup = {pin-item freq_count ;
...
}
Where a pin-item can be:
a pin name or pin group name (defined in the pin map)
a digital channel number, from 0 to 1023
a range of digital channel numbers, in parentheses, in the form
( channel-# to channel-# )
any combination of pins and pin groups, or any combination of
channel numbers and ranges, enclosed in parentheses and separated by
commas, in the form
( item, item, ..., item )
Channels and pins cannot be intermixed in the same pattern file.
The pingroups used in the pin_setup statement may be identical to
pingroups in the vector statement pinlist, or supersets of them.
It is illegal to have a pin appear in multiple pingroups used in the
pin_setup statement.
Example:
pin_setup = { outputclkpin freq_count; }
2. Data Formats (For Ig-xl 3.20 and later)
The symbolic vector programming codes are used in special ways for frequency
counter pins. For frequency counter pins, legal data characters are 0 and X.
These datacodes do not have their normal meaning when used with frequency
counter pins. Instead, the datacodes control opening and closing the frequency
counter window, i.e. gating the pin to its frequency counter register clock.
A pair of datacodes over 2 cycles is necessary to open or close the window. The
window will open or close on the first cycle of the pair.
Before opening a frequency counter window, the datacode for that pin on all
prior cycles should be X.
To open the window for a particular pin, begin programming 0 on that pin. The
window will open the R0 edge of the first cycle programmed to 0, provided that
on the next cycle the pin is also programmed to 0. Continue programming the pin
to 0 for the number of cycles that you wish the window to be open.
To close the frequency counter window, program an X on the cycle after the one
on which the R1 edge will close the window.
This example illustrates the use of the frequency counter datacodes:
vector ($tset, FCP) {
> 1 X; // program to X on all prior vectors
> 1 0; // R0 in this cycle opens window
repeat N > 1 0; // Window stays open during repeat
> 1 0; // R1 on this cycle closes window
> 1 X; // program to X on all succeeding vectors
}
Once a pin’s value transitions from X to 0, the pattern generator looks ahead
one cycle to determine whether or not the frequency counter window should be
opened. If the next vector’s value is 0, the window will open on the R0 edge
(the open window strobe). As each cycle executes, the window will stay open as
long as the next vector’s value is 0. If the next vector’s value is X, the
window will close on edge R1 (Close window strobe).
Thus the window will remain open for approximately the number of cycles that the
pin has been programmed to 0.
For Ig-xl 3.10 and earlier:
The window opens on the R0 edge of the last vector programmed to X before a
vector programmed to 0. This will result in a count of one more than the count
would be under Ig-xl 3.20 and later. Also, because of the lookahead, under Igxl
3.10 and earlier it is highly recommended that programmers add one vector to
the pattern file after the vector with the “halt” or “end module” opcode. Make
sure this additional vector is loaded into the same memory (LVM or SVM) as the
vector with halt or end_module opcode. The additional vector will not be
executed but it should have the pin in frequency counter mode set to X. This
will prevent the pattern generator lookahead from causing the compare window to
reopen on the last vector, since the next memory location will have the pin set
to an X. This type of problem is avoided in 3.20 by having the window open on
consecutive cycles programmed to 0.
作者: ictest    时间: 2009-7-26 20:12

多谢半仙了,我得好好研究研究了


作者: reg238    时间: 2010-2-22 21:26
好帖!支持楼主!:)

____________________

27419-01 54419-01

46319-01 05419-01

96819-01 www.reverse-ssn-lookup.com


作者: reg238    时间: 2010-4-7 22:33
Thanks for this valuable thread!

____________________

HWP0000-HWP9999

HWQ0000-HWQ9999

HWR0000-HWR9999

HWS0000-HWS9999

HWT0000-HWT9999


作者: 客人    时间: 2010-5-6 18:09
请帮忙看看我的code 那里有问题
作者: admin    时间: 2010-5-7 22:07
 code 在哪啊??没看到





欢迎光临 IC测试论坛--专业IC测试网 (http://ictest8.com/bbs/) Powered by Discuz! X3.1