Page 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 sales@rtd.com techsupport@rtd.com Web Site http://www.rtd.com DM5816/DM6816 RTD Embedded Technologies, Inc.
Page 3
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.
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.
Page 5
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 –...
Page 6
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 ........................
Page 7
DM5816/DM6816 RTD Embedded Technologies, Inc.
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: •...
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.
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.
This will insure compatibility with all CPUs. See chapter 4 for details on disabling the interrupt sharing circuit. DM5816/DM6816 RTD Embedded Technologies, Inc.
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.
Page 13
(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.
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.
Page 15
Fig. 1-7 – Base Address Switch, S1 DM5816/DM6816 RTD Embedded Technologies, Inc.
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.
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...
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.
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).
Page 20
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 DM5816/DM6816 RTD Embedded Technologies, Inc.
Defining the I/O Map The I/O map for the DM5816 is shown in Table 4-1 below. As shown, the module occupies 20 consecutive I/O port locations. The base address (designated as BA) can be selected using DIP switch S1, located on the edge of the module, as described in Chapter 1, Module Settings.
Page 22
DM5816/DM6816 RTD Embedded Technologies, Inc.
PWM behaves as if in free-running mode. The trigger input must transition high by the end of the PWM cycle or another cycle will start. Bit 5 -- Reserved (Write with a 0) Bit 6 -- Reserved (Write with a 0) Bit 7 -- Reserved (Write with a 0) DM5816/DM6816 RTD Embedded Technologies, Inc.
PWM behaves as if in free-running mode. The trigger input must transition high by the end of the PWM cycle or another cycle will start. Bit 5 -- Reserved (Write with a 0) Bit 6 -- Reserved (Write with a 0) Bit 7 -- Reserved (Write with a 0) DM5816/DM6816 RTD Embedded Technologies, Inc.
PWM behaves as if in free-running mode. The trigger input must transition high by the end of the PWM cycle or another cycle will start. Bit 5 -- Reserved (Write with a 0) Bit 6 -- Reserved (Write with a 0) Bit 7 -- Reserved (Write with a 0) DM5816/DM6816 RTD Embedded Technologies, Inc.
This address is used to write to the control register for the 8254. The control word is defined above. BA + 16: Clear IRQ/IRQ Enable (Read/Write) A read clears the P14 jumper-selectable IRQ status flag at BA + 17, bit 3. IRQ Enable Register: DM5816/DM6816 RTD Embedded Technologies, Inc.
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 DM5816, you must be able to perform a variety DM5816/DM6816...
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 DM5816!
Page 29
6 and 7, but we can say for sure that bit 5 ends up cleared instead of being set. A similar problem happens when you use subtraction to clear a bit in place of the method shown above. DM5816/DM6816 RTD Embedded Technologies, Inc.
This chapter explains the digital I/O circuitry on the DM5816. The DM5816 has three TTL/CMOS digital output lines available for digital control applications on each of the three pulse width modulator chips. Chapter 4 shows how to program these lines.
Chapter 6 – Timer/Counters This chapter explains the 8254 timer/counter circuit on the DM5816. An 8254 programmable interval timer provides three 16-bit, 8-MHz timers for timing and counting functions such as frequency measurement, event counting, and interrupts. These timer/counters can be configured in a number of ways to support your application.
Page 32
When the initial count has expired, the output goes low for one clock pulse and then goes high again. Appendix C provides the 8254 data sheet. DM5816/DM6816 RTD Embedded Technologies, Inc.
This chapter explains P14 jumper selectable interrupts and basic interrupt programming techniques. The DM5816 has one interrupt circuit which can generate interrupts on any IRQ channel 2 through 15, depending on the setting of the jumper on P4 or P16.
Your DM5816 can interrupt the processor when a variety of conditions are met. By using these interrupts, you can write software that effectively deals with real world events. Interrupt Request Lines To allow different peripheral devices to generate interrupts on the same computer, the PC bus has eight different interrupt request (IRQ) lines.
BEFORE you do anything else. Second, just before exiting your ISR, you must clear the interrupt status flag of the DM5816 and write an end-of-interrupt command to the 8259 controller. Finally, when exiting the ISR, in addition to popping all the registers you pushed on entrance, you must use the IRET instruction and not a plain RET.
Page 36
The following C and Pascal examples show what the shell of your ISR should be like. Only the clear interrupt command sequence for the source which caused the interrupt needs to be included. In C: void interrupt ISR(void) /* Your code goes here. Do not use any DOS functions! */ DM5816/DM6816 RTD Embedded Technologies, Inc.
The vectors for the hardware interrupts are vectors 8 through 15, where IRQ0 uses vector 8, IRQ1 uses vector 9, and so on. Thus, if the DM5816 will be using IRQ3, you should save the value of interrupt vector 11.
IRQs are numbered 0 through 7. • Two of the most common mistakes when writing an ISR are forgetting to clear the interrupt status of the DM5816 and forgetting to issue the EOI command to the 8259 interrupt controller before exiting the ISR. DM5816/DM6816...
Appendix A – DM5816/DM6816 Specifications DM5816/DM6816 Characteristics Typical @ 25° C Interface Switch-selectable base address, I/O mapped Jumper-selectable interrupts Pulse Width Modulators Number of channels................9 Resolution................8-bits Max internal clock................8 MHz Max external clock ....................10 MHz Trigger inputs..................................3 Output type.......................
Page 40
Environmental Operating temperature…………………………………………………………………-40 to +85° C Storage temperature ................. -40 to +85° C Humidity ................0 to 90% non-condensing Size 3.55"L x 3.775"W x 0.6"H (90mm x 96mm x 15mm) DM5816/DM6816 RTD Embedded Technologies, Inc.
Appendix C – Component Data Sheets Intel 82C54 Programmable Interval Timer Link to the datasheet: http://support.intel.com/design/archives/periphrl/docs/23124406.pdf NOTE: This link may have changed since the creation of this manual. DM5816/DM6816 RTD Embedded Technologies, Inc.
RTD Embedded Technologies, Inc. warrants the hardware and software products it manufactures and produces to be free from defects in materials and workmanship for one year following the date of shipment from RTD EMBEDDED TECHNOLOGIES, INC. This warranty is limited to the original purchaser of product and is not transferable.
Need help?
Do you have a question about the DM5816 and is the answer not in the manual?
Questions and answers