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

📄 manual_dscqmmmeasureperiod.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>DscQMMMeasurePeriod - 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'>DscQMMMeasurePeriod</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 measures the period of an input signal by counting the number of pulses of a known reference frequency which occur between two successive rising edges of the input signal. The input signal is connected to Gate 5 (pin 15), and the counting frequency is selected by frequency. The accuracy of the measurement is equal to the period of the chosen reference frequency.
<p>
The function operates as follows: Counter 5's output is preset low. On the first rising edge of the input signal, Counter 5 will begin to count edges of the reference frequency, and on the second rising edge its count will be transferred into its hold register. The contents of the hold register are returned in the parameter periods and represents the number of edges, or periods, of the reference frequency equal to a single period of the input signal. Note that since only the rising edge of the input signal is used to control Counter 5, the input signal's duty cycle is irrelevant. Also note that the function waits for the first rising edge before beginning the 
measurement. This adds to the total execution time for the function.
<p>
If the signal's period is too long, Counter 5 will reach its maximum count of 65535 and its output will toggle high. In this case the function will return error code DE_QMM_OVERFLOW, and periods will be set to 0. To correct this situation, select the next slower count frequency and repeat the procedure in this fashion until no error code is returned.
<p>
The longest period which can be measured using this function is 65,535 x the period of the chosen reference frequency. In the case of 400Hz, the slowest option, the longest period is 163,837ms, or 2 mins. 44 secs. Since the fastest reference frequency is 4MHz, the smallest period which can be captured is greater than the period of this frequency, or 0.25祍. However the measurement error will increase substantially as the period of the input signal approaches this lower limit.
<p>
Measuring the period of a fast input signal is more accurately done by measuring the frequency instead with <a href="manual_DscQMMMeasureFrequency.html" class='printable' title ="DscQMMMeasureFrequency">dscQMMMeasureFrequency</a>() and taking the reciprocal.
<p>
The period of the input signal is calculated by the formula:	Period = periods * reference period
<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_Source_Frequency_Table">4 QMM Source Frequency Table</A><BR></div></td></tr></table><P><h2><a name="Function_Definition">Function Definition</a></h2>
<p>
BYTE dscQMMMeasurePeriod(<a href="manual_DSCB.html" class='printable' title ="DSCB">DSCB</a> board, BYTE frequency, DWORD* periods);
<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>frequency</TD><TD>The desired reference frequency to use for the measurement. See the table below.</TD></tr><tr ><TD>periods</TD><TD>Pointer to a variable to hold the result of the measurement</TD></tr></table><p>
<h2><a name="Return_Value">Return Value</a></h2>
<p>
Error code or 0.
<p>
<h2><a name="QMM_Source_Frequency_Table">QMM Source Frequency Table</a></h2>
<p>
<table border=1><tr ><TH>Macro</TH><TH>Value</TH><TH>Reference Period</TH></tr><tr ><TD>QMM_SOURCE_F1_4MHZ</TD><TD>11</TD><TD>.25祍</TD></tr><tr ><TD>QMM_SOURCE_F2_400KHZ</TD><TD>12</TD><TD>2.5祍</TD></tr><tr ><TD>QMM_SOURCE_F3_40KHZ</TD><TD>13</TD><TD>25祍</TD></tr><tr ><TD>QMM_SOURCE_F4_4KHZ</TD><TD>14</TD><TD>.25ms</TD></tr><tr ><TD>QMM_SOURCE_F5_400HZ</TD><TD>15</TD><TD>2.5ms</TD></tr></table><p></div><p><em> <br> This page was last modified 12:17, 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 + -