📄 manual_interrupt-based_operations.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html lang="en"><head><title>Interrupt-Based Operations - 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'>Interrupt-Based Operations</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'>Interrupts are a means of running a piece of specialized code automatically in response to a hardware event. The hardware generates an interrupt request (IRQ) on the bus, which causes the processor to suspend its current task and run the special task. The special task is usually a routine to collect data from the board or to output data to the board. It can also include code to process the data. Interrupts offload timing and data transfer operations from the main program so it can concentrate on other tasks. The main program or programs can perform other tasks at the same time as the interrupts are occurring.
<p>
Interrupt-based sampling enables faster and more precise timing of I/O operations than is possible with standard single-operation function calls such as <tt><a href="manual_DscADSample.html" class='printable' title ="DscADSample">dscADSample</a>()</tt>. It is essential when operations must be performed at high sample rates, since usually the main program cannot manage the operation itself with reliability or without taking up too much processor time.
<p>
The Universal Driver contains several built-in functions for collecting (A/D) or outputting (D/A) data with interrupts. It also provides a "user interrupt" mechanism that enables you to run your own code each time an interrupt occurs. When run in conjunction with the built-in interrupt functions, your own code can run after the standard interrupt routine runs or it can run instead of the standard interrupt routine. Many boards also support user interrupts that are unrelated to A/D or D/A operations. User interrupts are described fully in the next chapter.
<p>
Every built-in A/D and D/A interrupt operation follows the same basic procedure. First, a structure containing the various options and parameters for the interrupt operation (i.e. <a href="manual_DSCAIOINT.html" class='printable' title ="DSCAIOINT">DSCAIOINT</a>) must be created and initialized. Then, a buffer that will either hold resulting samples taken (A/D) or contains a set of output values (D/A) must be created. Finally, the interrupt function is called. The board will then start to generate interrupts, which are caught and handled by a separate system thread. Depending on the mode of operation, the interrupt operation will either terminate when the current number of transfers reaches the maximum number specified (one-shot mode) or else will reset the counter and continue to generate interrupts (recycle mode). Any interrupt operation may be terminated at any time by calling <tt><a href="manual_DscCancelOp.html" class='printable' title ="DscCancelOp">dscCancelOp</a>()</tt>.
<p>
<strong>NOTE:</strong> DSCUD 5.7 now supports multiple simultaneous interrupt operations. This allows you to:
<p>
A)Perform multiple different interrupt types on a single board, as long as this is physically supported by the board. For example, you can run A/D interrupts and D/A interrupts simultaneously on a single <a href="manual_Diamond-MM-32-AT.html" class='printable' title ="Diamond-MM-32-AT">Diamond-MM-32-AT</a>.
<p>
B)Perform simultaneous interrupt operations on different boards as long as they are on different IRQ levels. For example, you can run simultaneous A/D interrupts on two <a href="manual_Diamond-MM-32-AT.html" class='printable' title ="Diamond-MM-32-AT">Diamond-MM-32-AT</a> boards where board 1 is set to IRQ 5 and board 2 is set to IRQ 7.
<p>
C)Any combination of (A) and (B). For example you may run, all simultaneously, A/D and D/A interrupt operations on two <a href="manual_Diamond-MM-32-AT.html" class='printable' title ="Diamond-MM-32-AT">Diamond-MM-32-AT</a> boards, only if they each reside on different IRQs.
<p>
<strong>You cannot perform simultaneous interrupt operations on two different boards that occupy the same IRQ level.</strong>
<p></div><p><em> <br> This page was last modified 14:47, 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 + -