rtd DM5816 User manual

BDM-610010027
Rev. A
DM5816/DM6816 – Triggered
User's Manual

DM5816/DM6816 RTD Embedded Technologies, Inc.
2
RTD EMBEDDED TECHNOLOGIES, INC.
103 Innovation Blvd
State College, PA 16803-0906
Phone: +1-814-234-8087
FAX: +1-814-234-5218
E-mail
techsuppor[email protected]
Web Site
http://www.rtd.com

DM5816/DM6816 RTD Embedded Technologies, Inc.
3
Manual Revision History
Rev A New Manual Naming Method
Published by:
RTD Embedded Technologies, Inc.
103 Innovation Boulevard
State College, PA 16803
Copyright 2005 by RTD Embedded Technologies, Inc.
All rights reserved
The RTD Embedded Technologies Logo is a registered trademark of RTD Embedded Technologies.
dspModule, cpuModule, and utilityModule are trademarks of RTD Embedded Technologies. PC/104,
PC/104-Plus, and PCI-104 are registered trademarks of PC/104 Consortium. All other trademarks
appearing in this document are the property of their respective owners.

DM5816/DM6816 RTD Embedded Technologies, Inc.
4
Table of Contents
Introduction.................................................................................................................................................... 8
PulseWidthModulators(PWM) .................................................................................................................. 8
8254Timer/Counters.................................................................................................................................. 8
WhatComesWithYourModule................................................................................................................... 8
Module Accessories................................................................................................................................... 9
Hardware Accessories ........................................................................................................................... 9
UsingThisManual ...................................................................................................................................... 9
When You Need Help ................................................................................................................................. 9
Chapter 1 – Module Settings....................................................................................................................... 10
Factory-Configured Switch and Jumper Settings.................................................................................... 10
P4, P16 — Interrupt Channel Select.................................................................................................... 11
P5 — 8254 Clock and Gate Source Select.......................................................................................... 12
P13 — Not Used .................................................................................................................................. 14
P14 — Interrupt Source Select ............................................................................................................ 14
S1 — Base Address............................................................................................................................. 14
Chapter 2 – Module Installation .................................................................................................................. 16
ModuleInstallation ................................................................................................................................... 16
External I/O Connections......................................................................................................................... 17
Connecting the Digital I/O .................................................................................................................... 17
Connecting the Timer/Counter I/O....................................................................................................... 17
Connecting the External Interrupt ........................................................................................................ 17
Running the 5816DIAG Diagnostics Program......................................................................................... 18
Chapter 3 – Hardware Description.............................................................................................................. 19
Pulse Width Modulators........................................................................................................................... 19
Timer/Counters ........................................................................................................................................ 19
Chapter 4 – I/O Mapping............................................................................................................................. 21
Defining the I/O Map ................................................................................................................................ 21

DM5816/DM6816 RTD Embedded Technologies, Inc.
5
BA + 0: Pulse Width Modulator 0.0 Duty Cycle (Write only)............................................................... 23
BA + 1: Pulse Width Modulator 0.1 Duty Cycle (Write only)............................................................... 23
BA + 2: Pulse Width Modulator 0.2 Duty Cycle (Write only)............................................................... 23
BA + 3: PWM Control and Digital Output Register (Write Only):........................................................ 23
BA + 4: Pulse Width Modulator 1.0 Duty Cycle (Write only)............................................................... 24
BA + 5: Pulse Width Modulator 1.1 Duty Cycle (Write only)............................................................... 24
BA + 6: Pulse Width Modulator 1.2 Duty Cycle (Write only)............................................................... 24
BA + 7: PWM Control and Digital Output Register (Write Only):........................................................ 24
BA + 8: Pulse Width Modulator 2.0 Duty Cycle (Write only)............................................................... 25
BA + 9: Pulse Width Modulator 2.1 Duty Cycle (Write only)............................................................... 25
BA + 10: Pulse Width Modulator 2.2 Duty Cycle (Write only)............................................................. 25
BA + 11: PWM Control and Digital Output Register (Write Only):...................................................... 25
BA + 12: 8254 Timer/Counter 0 (Read/Write)..................................................................................... 26
BA + 13: 8254 Timer/Counter 1 (Read/Write)..................................................................................... 26
BA + 14: 8254 Timer/Counter 2 (Read/Write)..................................................................................... 26
BA + 15: 8254 Timer/Counter Control Word (Write Only) .................................................................. 26
BA + 16: Clear IRQ/IRQ Enable (Read/Write).................................................................................... 26
BA + 17: IRQ Status (Read Only) ....................................................................................................... 27
BA + 18: Reserved.............................................................................................................................. 27
BA + 19: Reserved.............................................................................................................................. 27
Programming the DM5816....................................................................................................................... 27
Clearing and Setting Bits in a Port ........................................................................................................... 28
Chapter 5 – Digital I/O................................................................................................................................. 30
Chapter 6 – Timer/Counters........................................................................................................................ 31
Chapter 7 – Interrupts ................................................................................................................................. 33
P14: Jumper Selectable Interrupts ........................................................................................................... 33
Selecting the Interrupt Channel................................................................................................................ 33
Interrupt Sharing ...................................................................................................................................... 33
Basic Programming for Interrupt Handling .............................................................................................. 33

DM5816/DM6816 RTD Embedded Technologies, Inc.
6
What Is an Interrupt?............................................................................................................................ 33
Interrupt Request Lines........................................................................................................................ 34
8259 Programmable Interrupt Controller ............................................................................................. 34
What Exactly Happens When an Interrupt Occurs? ............................................................................ 35
Using Interrupts in Your Programs....................................................................................................... 35
Writing an Interrupt Service Routine (ISR) .......................................................................................... 35
Saving the Startup Interrupt Mask Register (IMR) and Interrupt Vector.............................................. 37
Restoring the Startup IMR and Interrupt Vector .................................................................................. 37
Common Interrupt Mistakes................................................................................................................. 38
Appendix A – DM5816/DM6816 Specifications .......................................................................................... 39
Appendix B – Connector Pin Assignments ................................................................................................. 41
Appendix C – Component Data Sheets ...................................................................................................... 43
Appendix D - Limited Warranty ................................................................................................................... 44

DM5816/DM6816 RTD Embedded Technologies, Inc.
7

DM5816/DM6816 RTD Embedded Technologies, Inc.
8
Introduction
The DM5816/DM6816 Pulse Width Modulator (PWM) dataModule
®
turns your IBM PC-compatible
cpuModule™ or other PC/104 computer into a high-performance control system. The DM5816 and
DM6816 are the same board except for the addition of the AT bus connector on the DM6816. This
connector allows you to stack the module easily with other AT modules and also allows you access to
the AT interrupts. Through the rest of this manual, the module will be referred to as the DM5816. Ultra-
compact for embedded and portable applications, the module features:
• Nine 8-bit Pulse Width Modulated Outputs with trigger input
• Three 16-bit timer/counters and on-board 8 MHz clock,
• Operation from single +5V supply,
• DOS example programs with source code in BASIC and C,
• Diagnostics software.
The following paragraphs briefly describe the major functions of the module. A detailed discussion of
module functions is included in subsequent chapters.
Pulse Width Modulators (PWM)
The DM5816 has nine 8-bit pulse width modulator circuits. The PWM function is divided into three blocks
with each having three PWMs with trigger inputs.
Each block consists of an 8-bit counter that is driven by either an on-board 8 MHz clock, the 8 MHz
clock divided by a 16-bit counter/timer or an external clock. There are three 8-bit PWM registers. The
counter output is compared to each register and the PWM outputs are high if the count is less than the
register and low if the count is greater than the register. The trigger input can be used to generate very
low duty cycle signals while retaining the 8-bit PWM resolution.
8254 Timer/Counters
An 8254 programmable interval timer provides three 16-bit, 8 MHz timer/counters to support a wide range of
user timing and counting functions.
What Comes With Your Module
You receive the following items in your module package:
•DM5816 module with stack-through bus header
•Mounting hardware
•Example programs in BASIC and C with source code & diagnostics software
•User’s manual

DM5816/DM6816 RTD Embedded Technologies, Inc.
9
If any item is missing or damaged, please call the RTD Embedded Technologies, Inc. Customer Service
Department at (814) 234-8087. If you require service outside the U.S., contact your local distributor.
Module Accessories
In addition to the items included in your module package, Real Time Devices offers a full line of software
and hardware accessories. Call your local distributor or our main office for more information about these
accessories and for help in choosing the best items to support your module’s application.
Hardware Accessories
Hardware accessories for the DM5816 include the DOP series optoisolated digital input boards, the
DMR series mechanical relay output boards, the TB50 terminal board and XB50 prototype/terminal
board for easy signal access and prototype development, the DM14 extender board for testing your
module in a conventional desktop computer, and XT50 twisted pair wire flat ribbon cable assembly
for external interfacing.
Using This Manual
This manual is intended to help you install your new module and get it running quickly, while also providing
enough detail about the module and its functions so that you can enjoy maximum use of its features even
in the most complex applications. We assume that you already have an understanding of data acquisition
principles and that you can customize the example software or write your own application programs.
When You Need Help
This manual and the example programs in the software package included with your module provide
enough information to properly use all of the module’s features. If you have any problems installing or
using this dataModule, contact our Technical Support Department, (814) 234-8087, during regular
business hours, Eastern Standard Time or eastern daylight time, or send a FAX requesting assistance
to (814) 234-5218. When sending a FAX request, please include your company’s name and address,
your name, your telephone number, and a brief description of the problem. You can also contact us
through our E-mail address techsupport@rtd.com.

DM5816/DM6816 RTD Embedded Technologies, Inc.
10
Chapter 1 – Module Settings
The DM5816 has jumper and switch settings you can change if necessary for your application. The module
is factory-configured as listed in the table and shown on the layout diagram in the beginning of this
chapter. Should you need to change these settings, use these easy-to-follow instructions before you stack
the module with your computer system.
Factory-Configured Switch and Jumper Settings
Table 1-1 lists the factory settings of the user-configurable jumpers and switch on the DM5816 module.
Figure 1-1 shows the module layout and the locations of the factory-set jumpers. The following
paragraphs explain how to change the factory settings. Pay special attention to the setting of S1, the
base address switch, to avoid address contention when you first use your module in your system.

DM5816/DM6816 RTD Embedded Technologies, Inc.
11
Fig. 1-1 – Module Layout Showing Factory-Configured Settings
P4, P16 — Interrupt Channel Select
(Factory Setting: Jumper installed on G; IRQ Disabled)
These header connectors, shown in Figure 1-2, lets you connect any one of four jumper selectable (P14)
interrupt sources to an interrupt channel, IRQ2 through IRQ15. XT channels 2 through 7 are jumpered on
P4 and AT channels 10 through 15 are jumpered on P16 (DM6816 only). In AT computers channels 2 and
9 are the same channel. To activate a channel, you must install a jumper vertically across the desired IRQ
channel’s pins. Only one channel on either P4 or P16 should be jumpered at any time. Figure 1-2a shows
the factory settings.
This module supports an interrupt sharing mode where the pins labeled G connect a 1 k-ohm pull-down
resistor to the output of a high-impedance tri-state driver which carries the interrupt request signal. This
pull-down resistor drives the interrupt request line low whenever interrupts are not active. Whenever an
interrupt request is made, the tri-state buffer is enabled, forcing the output high and generating an
interrupt. There are four IRQ circuits, one for the P14 jumper selectable interrupts and one each for the
incremental encoder channels. Their outputs are tied together through an "OR" gate, allowing all interrupt
sources to share the same IRQ channel. To determine which circuit has generated an interrupt on the
selected IRQ channel, read the status byte (I/O address location BA + 17) and check the status of bits 0
through 3, as described in Chapter 4. After the interrupt has been serviced, you must return the IRQ line
low, disabling the tri-state buffer and pulling the output low again. This is done by clearing the IRQ for
the source which generated the interrupt. You also can have two or more modules that share the same
IRQ channel. You can tell which module issued the interrupt request by monitoring each module’s IRQ
status bit(s). If you are not planning on sharing interrupts or if you are not sure that your CPU supports
interrupt sharing, it is best to disable this feature and use the interrupts in the normal mode. This will
insure compatibility with all CPUs. See chapter 4 for details on disabling the interrupt sharing circuit.

DM5816/DM6816 RTD Embedded Technologies, Inc.
12
NOTE: When using multiple modules sharing the same interrupt, only one module should
have the G jumper installed. The rest should be disconnected. Whenever you operate a
single module, the G jumper should be installed. Whenever you operate the module with
interrupt sharing disabled, the G jumper should be removed.
Fig. 1-2 – Interrupt Channel Select Jumpers, P4 and P16
Fig. 1-3 – Pulling Down the Interrupt Request Line
P5 — 8254 Clock and Gate Source Select
(Factory Settings: See Figure 1-4)
This header connector, shown in Figure 1-4, lets you select the clock sources for the three 8254 16-bit
timer/ counters. Figure 1-5 shows a block diagram of the timer/counter circuitry to help you in making
these connections.
The clock source for Counter 0 is selected by placing a jumper on one of the two leftmost pairs of pins on
the header, OSC or EC0. OSC is the on-board 8 MHz clock, and EC0 is an external clock source which
can be connected through I/O connector P6, pin 1. Counter 1 has three clock sources: OT0, which
cascades it to Counter 0; OSC, which is the on-board 8 MHz clock; and EC1, which is an external clock
source connected through I/O connector P6, pin 5. Counter 2 has three clock sources: OT1, which

DM5816/DM6816 RTD Embedded Technologies, Inc.
13
cascades it to Counter 1; OSC, which is the on-board 8 MHz clock; and EC2, which is an external clock
source connected through I/O connector P6, pin 9.
The gate of Counter 2 can be connected to the output of Counter 1 (OT1) or to an external gate source
(EG2) connected through I/O connector P6, pin 10. When no external gate source is connected, this line
is tied high.
Fig.1-4 – 8254 Clock and Gate Sources Jumpers, P5
Fig. 1-5 – 8254 Circuit Diagram

DM5816/DM6816 RTD Embedded Technologies, Inc.
14
P13 — Not Used
This header connector is not used on the DM5816 and should have no jumpers installed.
P14 — Interrupt Source Select
(Factory Setting: OT2)
This header connector, shown in Figure 1-6, lets you select one of four interrupt sources for interrupt
generation. The four sources are: EI1, external interrupt 1, P2-2); EI2, external interrupt 2, P3-2; OT1, the
output of timer/ counter 1; and OT2, the output of timer/counter 2. To connect an interrupt source, place
the jumper across the desired set of pins.
Fig. 1-6 – Interrupt Source Select Jumper, P1
S1 — Base Address
(Factory Setting: 300 hex (768 decimal))
One of the most common causes of failure when you are first trying your module is address contention.
Some of your computer’s I/O space is already occupied by internal I/O and other peripherals. When the
module attempts to use I/O address locations already used by another device, contention results and the
module does not work.
To avoid this problem, the DM5816 has an easily accessible DIP switch, S1, which lets you select any
one of 6 starting addresses in the computer’s I/O. Should the factory setting of 300 hex (768 decimal) be
unsuitable for your system, you can select a different base address simply by setting the switches to any
one of the values listed in Table 1-2. The table shows the switch settings and their corresponding
decimal and hexadecimal (in parentheses) values. Make sure that you verify the order of the switch
numbers on the switch (1 through 4) before setting them. When the switches are pulled forward, they are
OPEN, or set to logic 1, as labeled on the DIP switch package. When you set the base address for your
module, record the value in the table inside the back cover. Figure 1-7 shows the DIP switch set for a
base address of 300 hex (768 decimal).

DM5816/DM6816 RTD Embedded Technologies, Inc.
15
Fig. 1-7 – Base Address Switch, S1

DM5816/DM6816 RTD Embedded Technologies, Inc.
16
Chapter 2 – Module Installation
The DM5816 is easy to install in your cpuModule™ or other PC/104 based system. This
chapter tells you step-by-step how to install and connect the module.
After you have installed the module and made all of your connections, you can turn
your system on and run the 5816DIAG board diagnostics program included on your
example software disk to verify that your module is working.
Module Installation
Keep the module in its antistatic bag until you are ready to install it in your cpuModule™ or other
PC/104 based system. When removing it from the bag, hold the module at the edges and do not touch
the components or connectors.
Before installing the module in your system, check the jumper and switch settings. Chapter 1 reviews
the factory settings and how to change them. If you need to change any settings, refer to the
appropriate instructions in Chapter 1. Note that incompatible jumper settings can result in unpredictable
module operation and erratic response.
The DM5816 comes with a stack-through P1 connector. The stack-through connector lets you stack
another module on top of your DM5816.
To install the module, follow the procedures described in the computer manual and the steps below:
1. Turn OFF the power to your system.
2. Touch a metal rack to discharge any static buildup and then remove the module from its
antistatic bag.
3. Select the appropriate standoffs for your application to secure the module when you install
it in your system (two sizes are included with the module).
4. Holding the module by its edges, orient it so that the P1 bus connector’s pin 1 lines up with pin
1 of the expansion connector onto which you are installing the module.
5. After carefully positioning the module so that the pins are lined up and resting on the expansion
connector, gently and evenly press down on the module until it is secured on the connector.
NOTE: Do not force the module onto the connector. If the module does not readily press into
place, remove it and try again. Wiggling the module or exerting too much pressure can result
in damage to the DM5816 or to the mating module.
6. After the module is installed, connect the cables as needed to I/O connector P2, P3, and P6 on
the module. When making these connections, note that there is no keying to guide you in
orientation. You must make sure that pin 1 of the cable is connected to pin 1 of the connector
(pin 1 is marked on the module with a small square). For twisted pair cables, pin 1 is the dark
brown wire; for standard single wire cables, pin 1 is the red wire.
7. Make sure all connections are secure.

DM5816/DM6816 RTD Embedded Technologies, Inc.
17
External I/O Connections
Figure 2-1 shows I/O connector pinouts for P2, P3, and P6. Refer to these diagrams as you make your
I/O connections.
Fig. 2-1 – P2, P3, and P6 I/O Connector Pin Assignments
Connecting the Digital I/O
The DM5816 is designed for direct connection to industry standard opto-22 isolated I/O racks and
system modules. Each digital I/O line has a digital ground, as shown in Figure 2-1. For all digital I/O
connections, the high side of an external signal source or destination device is connected to the
appropriate signal pin on the I/O connector, and the low side is connected to the DIGITAL GND. A
cable to provide direct connection to opto-22 systems, the XO50, is available as an accessory from RTD.
Connecting the Timer/Counter I/O
External connections to the timer/counters on the DM5816 can be made by connecting the high side
of the external device to the appropriate signal pin on I/O connector P6 and the low side to a P6
DIGITAL GND.
Connecting the External Interrupt
The DM5816 can receive externally generated interrupt signals – EXT INT1, through I/O connector P2,
pin 2, and EXT INT2, through I/O connector P3, pin 2 – and route them to an IRQ channel through on-
board header connectors P14 and P4. Interrupt generation is enabled through software. When interrupts
are enabled, a rising or falling edge on the EXT INT line will cause the selected IRQ line to go high,

DM5816/DM6816 RTD Embedded Technologies, Inc.
18
depending on the setting of BA + 16, bit 1, and the IRQ status bit will change from 0 to 1. The pulse
applied to the EXT INT pin should have a duration of at least 100 nanoseconds.
Running the 5816DIAG Diagnostics Program
Now that your module is ready to use, you will want to try it out. An easy-to-use, menu-driven
diagnostics program, 5816DIAG, is included with your example software to help you verify your
module’s operation. You can also use this program to make sure that your current base address
setting does not contend with another device.

DM5816/DM6816 RTD Embedded Technologies, Inc.
19
Chapter 3 – Hardware Description
This chapter describes the features of the DM5816 hardware. The major circuits are the incremental
encoders and the timer/ counters.
The DM5816 has two major circuits, the pulse width modulators and the timer/counters. Figure 3-1
shows the block diagram of the module. This chapter describes the hardware which makes up the major
circuits.
Fig. 3-1 – DM5816 Block Diagram
Pulse Width Modulators
The DM5816 has three pulse width modulator circuits. Each circuit has one 8-bit up/down counter and
three 8-bit compare registers to generate the PWM output. Twelve digital output lines are available for
control functions (see I/O connector pinout diagrams in Appendix B).
Timer/Counters
An 8254 programmable interval timer provides three 16-bit, 8-MHz timer/counters to support a wide
range of timing and counting functions. Figure 3-2 shows the timer/counter circuitry.
Each 16-bit timer/counter has two inputs, CLK in and GATE in, and one output, timer/counter OUT.
Each can be programmed as binary or BCD down counters by writing the appropriate data to the
command word, as described in Chapter 4. The command word also lets you set up the mode of
operation. The six programmable modes are:
Mode 0 Event Counter (Interrupt on Terminal Count)

DM5816/DM6816 RTD Embedded Technologies, Inc.
20
Mode 1 Hardware-Retriggerable One-Shot
Mode 2 Rate Generator
Mode 3 Square Wave Mode
Mode 4 Software-Triggered Strobe
Mode 5 Hardware Triggered Strobe (Retriggerable)
These modes are detailed in the 8254 Data Sheet, reprinted from Intel in Appendix C.
Fig. 3-2 – Timer/Counter Circuit Block Diagram
This manual suits for next models
1
Table of contents
Other rtd Computer Hardware manuals

rtd
rtd DM6210 User manual

rtd
rtd cpuModule CMX147786HX User manual

rtd
rtd FPGA35S6045HR User manual

rtd
rtd ECAN1000HR User manual

rtd
rtd SYNC25104HR User manual

rtd
rtd cpuModule CML47786HX User manual

rtd
rtd CMi37786HX User manual

rtd
rtd CMV6586DX133 User manual

rtd
rtd CMX34KB User manual

rtd
rtd CNV36JXNX User manual
Popular Computer Hardware manuals by other brands

Neousys Technology
Neousys Technology PCIe-PoE2+ user manual

Motorline professional
Motorline professional MC60 User's and installer's manual

ADLINK Technology
ADLINK Technology AMC-7000 user manual

Olivella Modular
Olivella Modular Signos user manual

OLIMEX
OLIMEX ES32-POE user manual

Extron electronics
Extron electronics AXP 64 C AT user guide