參數(shù)資料
型號: DM5806
廠商: Electronic Theatre Controls, Inc.
英文描述: DM5806 DATA MODULE DIGITAL I/O BOARD
中文描述: DM5806數(shù)據(jù)模塊數(shù)字I / O板
文件頁數(shù): 37/64頁
文件大?。?/td> 270K
代理商: DM5806
4-7
Programming the DM5806
This section gives you some general information about programming and the DM5806 board, and then walks
you through the major DM5806 programming functions. These descriptions will help you as you use the example
programs included with the board. All of the program descriptions in this section use decimal values unless other-
wise specified.
The DM5806 is programmed by writing to and reading from the correct I/O port locations on the board. These
I/O ports were defined in the previous section. Most high-level languages such as BASIC, Pascal, C, and C++, and
of course assembly language, make it very easy to read/write these ports. The table below shows you how to read
from and write to I/O ports using some popular programming languages.
Language
Integer Division
AND
OR
C
%
a = b % c
/
a = b / c
&
a = b & c
|
a = b | c
Pascal
MOD
a := b MOD c
DIV
a := b DIV c
AND
a := b AND c
OR
a := b OR c
BASIC
MOD
a = b MOD c
\
a = b \ c
AND
a = b AND c
OR
a = b OR c
In addition to being able to read/write the I/O ports on the DM5806, you must be able to perform a variety of
operations that you might not normally use in your programming. The table below shows you some of the operators
discussed in this section, with an example of how each is used with Pascal, C, and BASIC. Note that the modulus
operator is used to retrieve the least significant byte (LSB) of a two-byte word, and the integer division operator is
used to retrieve the most significant byte (MSB).
Many compilers have functions that can read/write either 8 or 16 bits from/to an I/O port. For example, Turbo
Pascal uses
Port
for 8-bit port operations and
PortW
for 16 bits, Turbo C uses
inportb
for an 8-bit read of a port
and
inport
for a 16-bit read.
Be sure to use only 8-bit operations with the DM5806!
Language
Read
Write
BASIC
Data=INP(Address)
OUT Address,Data
Turbo C
Data=inportb(Address)
outportb(Address,Data)
Turbo Pascal
Data:=Port[Address]
Port[Address]:=Data
Assembly
mov dx,Address
in al,dx
mov dx,Address
mov al,Data
out dx,al
相關PDF資料
PDF描述
DM6806 DM5806 DATA MODULE DIGITAL I/O BOARD
DM6380L V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
DM6381F V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
DM6382F V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
DM6383F V.34 Integrated Data/ Fax/Voice/Speakerphone Modem Device Set
相關代理商/技術參數(shù)
參數(shù)描述
DM-59 制造商:NTE Electronics 功能描述:DMM W/CAP/FREQ/HFE
DM5910J 制造商:n/a 功能描述:DM 91PF 5%
DM5B355J 制造商:ELP 功能描述:AF535X050
DM5E330J 制造商:MISCELLANEOUS MANUFACTURERS 功能描述:CAPACITOR MICA
DM5EC470J03 制造商:MISCELLANEOUS MANUFACTURERS 功能描述:CAPACITOR MICA