Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

DM6806 Datasheet(PDF) 37 Page - List of Unclassifed Manufacturers

Part # DM6806
Description  DM5806 DATA MODULE DIGITAL I/O BOARD
PDF  64 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  ETC [List of Unclassifed Manufacturers]
Direct Link  
Logo ETC - List of Unclassifed Manufacturers

DM6806 Datasheet(HTML) 37 Page - List of Unclassifed Manufacturers

Back Button DM6806 Datasheet HTML 33Page - List of Unclassifed Manufacturers DM6806 Datasheet HTML 34Page - List of Unclassifed Manufacturers DM6806 Datasheet HTML 35Page - List of Unclassifed Manufacturers DM6806 Datasheet HTML 36Page - List of Unclassifed Manufacturers DM6806 Datasheet HTML 37Page - List of Unclassifed Manufacturers DM6806 Datasheet HTML 38Page - List of Unclassifed Manufacturers DM6806 Datasheet HTML 39Page - List of Unclassifed Manufacturers DM6806 Datasheet HTML 40Page - List of Unclassifed Manufacturers DM6806 Datasheet HTML 41Page - List of Unclassifed Manufacturers Next Button
Zoom Inzoom in Zoom Outzoom out
 37 / 64 page
background image
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
Modulus
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



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com