4-9
Programming the DM6210
This section gives you some general information about programming and the DM6210.
The module is programmed by reading from and writing to the correct I/O port locations. 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.
In addition to being able to read/write the I/O ports on the DM6210, 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 C, Pascal, 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 the correct operation for each register on the DM6210.
Clearing and Setting Bits in a Port
When you clear or set one or more bits in a port, you must be careful that you do not change the status of
the other bits. You can preserve the status of all bits you do not wish to change by proper use of the AND and
OR binary operators. Using AND and OR, single or multiple bits can be easily cleared in one operation. Note
that most registers in the DM6210 cannot be read back; therefore, you must save the value in your program.
To
clear
a single bit in a port, AND the current value of the port with the value b, where b = 255 - 2
bit
.
Example:
Clear bit 5 in a port. Read in the current value of the port, AND it with 223
(223 = 255 - 2
5
), and then write the resulting value to the port. In BASIC, this is programmed as:
V_SAVE = V_SAVE AND 223
OUT PortAddress, V
/DQJXDJH
0RGXOXV
,QWHJHU 'LYLVLRQ
$1'
25
&
D EF
D EF
D E F
_
D E_F
3DVFDO
02'
D E02'F
',9
D E',9F
$1'
D E$1'F
25
D E25F
/DQJXDJH
5HDG%LWV
:ULWH%LWV
5HDG %LWV
:ULWH %LWV
7XUER&
'DWD LQSRUWE$GGUHVV RXWSRUWE$GGUHVV'DWD 'DWD LQSRUW$GGUHVV
RXWSRUW$GGUHVV'DWD
7XUER3DVFDO
'DWD 3RUW>$GGUHVV@
3RUW>$GGUHVV@ 'DWD
'DWD 3RUW:>$GGUHVV@
3RUW:>$GGUHVV@ 'DWD
Summary of Contents for DM6210
Page 2: ......
Page 9: ...i 1 INTRODUCTION...
Page 10: ...i 2...
Page 14: ...1 2...
Page 22: ...1 10...
Page 24: ...2 2...
Page 28: ...2 6...
Page 30: ...3 2...
Page 34: ...4 2...
Page 44: ...5 2...
Page 48: ...5 6...
Page 50: ...6 2...
Page 56: ...6 8...
Page 58: ...7 2...
Page 61: ...8 1 CHAPTER 8 DIGITAL I O This chapter explains the digital I O circuitry on the DM6210...
Page 62: ...8 2...
Page 66: ...9 2...
Page 68: ...9 4...
Page 70: ...10 2...
Page 74: ...10 6...
Page 75: ...A 1 APPENDIX A DM6210 SPECIFICATIONS...
Page 76: ...A 2...
Page 78: ...A 4...
Page 79: ...B 1 APPENDIX B CN3 CONNECTOR PIN ASSIGNMENTS...
Page 80: ...B 2...
Page 82: ...B 4...
Page 83: ...APPENDIX C COMPONENT DATA SHEETS C 1...
Page 84: ......
Page 85: ...Intel 82C54 Programmable Interval Timer Data Sheet Reprint...
Page 86: ......
Page 88: ...D 2...
Page 91: ...DM6210 User Settings Base I O Address hex decimal IRQ Channel...