⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manual_dscqmmmeasurefrequency.html

📁 Diamond公司Dscud通用驱动使用说明手册
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"        "http://www.w3.org/TR/html4/loose.dtd"><html lang="en"><head><title>DscQMMMeasureFrequency - Universal Driver Documentation</title><meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"><meta name="robots" content="index,follow"><link rel="shortcut icon" href="/favicon.ico"><link rel="stylesheet" href="/dscud/style/wikiprintable.css"><script type="text/javascript" src="/dscud/style/wikibits.js"></script><style type='text/css'><!--a.new, #quickbar a.new { color: #CC2200; }#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }#article { margin-left: 152px; margin-right: 4px; }//--></style></head><body bgcolor='#FFFFFF'><div class='titlebox'><h1 class='pagetitle'>DscQMMMeasureFrequency</h1><span class='subtitle'>Universal Driver Documentation</span></div><div class='navbox'><a href="manual_Main_Page.html" class='printable' title ="Main Page">Main Page</a> || <a href="manual_Table_of_Contents.html" class='printable' title ="Table of Contents">Table_of_Contents</a> || <a href="http://www.diamondsystems.com/">Diamond Systems Website</a></div></div><div class='bodytext'><a name="top"></a>This function uses counters 4 and 5 to measure the frequency of a TTL-level signal. The input signal can be connected to any of the nine sources listed below. In order for this function to run, Counter 4 output (pin 12) must be wired externally to Counter 5 gate (pin 15). Otherwise, the program will hang.
<p>
The output of Counter 4 is initially high, and the output of Counter 5 is initially low. Counter 4's output will remain high for the duration specified in interval. The frequency is measured by using Counter 5 to count the number of rising edges of the input signal which occur during this measured time interval, and the count is returned in pulses. Counter 5 is gated by the output of Counter 4, so it counts for a known period of time. If the measurement period is too long, Counter 5 will reach its maximum count of 65535, its output will toggle high, and the function will return an error code of DE_QMM_OVERFLOW. Thus the programmer has both a hardware and a software indication of overflow. In this case use the next smaller measurement interval and try again, continuing in this fashion until no error code is returned.
<p>
The entire procedure lasts exactly as long as the specified measurement interval. For the longest interval (10 seconds), the computer may appear to have hung; however, it is simply in a monitoring loop waiting for Counter 4's output to toggle low, and it will return to the calling program as soon as this event occurs.
<p>
The fastest measurable frequency is limited by the 9513 chip specifications to 7MHz; specifying a measurement interval of 1 ms for a 7MHz input frequency will yield a count of 7000, well within the 65535 count limit. The slowest measurable frequency depends on the allowable error tolerance, since the edge count could be off by 1 due to alignment of the input edges with the measurement interval. 
<p>
Measuring the frequency of a very slow signal is more accuratly done by measuring the period with <a href="manual_DscQMMMeasurePeriod.html" class='printable' title ="DscQMMMeasurePeriod">dscQMMMeasurePeriod</a>() and taking the reciprocal.
<p>
The frequency of the input signal is derived from the formulas
<p>
	Frequency = pulses / Measurement period
or	Frequency = pulses * Measurement frequency
<p>
The function will return DE_QMM_OVERFLOW if a measurement overflow occured. Otherwise it will return DE_NONE .
<p>
<p><table border="0" id="toc"><tr><td align="center"><b>Table of contents</b> <script type='text/javascript'>showTocToggle("show","hide")</script></td></tr><tr id='tocinside'><td align="left"><div style="margin-bottom:0px;"><A CLASS="internal" HREF="#Function_Definition">1 Function Definition</A><BR></div><div style="margin-bottom:0px;"><A CLASS="internal" HREF="#Function_Parameters">2 Function Parameters</A><BR></div><div style="margin-bottom:0px;"><A CLASS="internal" HREF="#Return_Value">3 Return Value</A><BR></div><div style="margin-bottom:0px;"><A CLASS="internal" HREF="#QMM_Interval_Table">4 QMM Interval Table</A><BR></div><div style="margin-bottom:0px;"><A CLASS="internal" HREF="#QMM_Source_Table">5 QMM Source Table</A><BR></div></td></tr></table><P><h2><a name="Function_Definition">Function Definition</a></h2>
<p>
BYTE dscQMMMeasureFrequency(<a href="manual_DSCB.html" class='printable' title ="DSCB">DSCB</a> board, BYTE interval, BYTE source, WORD* pulses)
<p>
<h2><a name="Function_Parameters">Function Parameters</a></h2>
<p>
<table border=1><tr ><TH>Name</TH><TH>Description</TH></tr><tr ><TD>board</TD><TD>The handle of the board to operate on</TD></tr><tr ><TD>interval</TD><TD>Desired measurement time interval. See the table below.</TD></tr><tr ><TD>source</TD><TD>Source signal to measure. See the table below Note that Gate 5 is not a valid choice since it is used by the function.</TD></tr><tr ><TD>pulses</TD><TD>Pointer to a variable that will contain the number of pulses</TD></tr></table><p>
<h2><a name="Return_Value">Return Value</a></h2>
<p>
Error code or 0.
<p>
<h2><a name="QMM_Interval_Table">QMM Interval Table</a></h2>
<p>
<table border=1><tr ><TH>Macro</TH></tr><tr ><TD>QMM_INTERVAL_1MS_1KHZ</TD></tr><tr ><TD>QMM_INTERVAL_10MS_100HZ</TD></tr><tr ><TD>QMM_INTERVAL_100MS_10HZ</TD></tr><tr ><TD>QMM_INTERVAL_1S_1HZ</TD></tr><tr ><TD>QMM_INTERVAL_10S_01HZ</TD></tr></table><p>
<h2><a name="QMM_Source_Table">QMM Source Table</a></h2>
<p>
<table border=1><tr ><TH>Macro</TH></tr><tr ><TD>QMM_SOURCE_SRC1</TD></tr><tr ><TD>QMM_SOURCE_SRC2</TD></tr><tr ><TD>QMM_SOURCE_SRC3</TD></tr><tr ><TD>QMM_SOURCE_SRC4</TD></tr><tr ><TD>QMM_SOURCE_SRC5</TD></tr><tr ><TD>QMM_SOURCE_GATE1</TD></tr><tr ><TD>QMM_SOURCE_GATE2</TD></tr><tr ><TD>QMM_SOURCE_GATE3</TD></tr><tr ><TD>QMM_SOURCE_GATE4</TD></tr></table><p></div><p><em> <br> This page was last modified 12:21, 12 Feb 2004.<br>Copyright (c) 2004 Diamond Systems.  All Rights Reserved.</em><!-- Time since request: 0.16 secs. --></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -