background image

 

 

DM5816/DM6816 

RTD Embedded Technologies, Inc. 

33 

Chapter 7 – Interrupts 

 

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.

 

P14: Jumper Selectable Interrupts 

The  DM5816  circuitry  has  four  jumper  selectable  interrupt  sources  which  can  be  set  by 

installing a jumper across the desired pair of pins at P14.

 

To  use  these  interrupts,  an  interrupt  source  must  be  jumpered  on  P14,  an  interrupt  channel 

must be jumpered on P4, and the IRQ enable must be set high (BA + 16, bit 0). BA + 16, bit 1 

sets the polarity of the interrupt.

 

Selecting the Interrupt Channel 

The IRQ channel is selected by installing a jumper on header connector P4 or  P16  across the 

desired pair of pins,  as  described  in  Chapter  1.  A  jumper  is  also  installed  across  the  G  pins  if 

you are using the interrupt sharing feature.

 

Interrupt Sharing 

This  module  is  capable  of  sharing  interrupts  with  multiple  modules.  This  circuit  is  described  in 

chapter 1. If you are not planning on using shared interrupts or you are not sure that your CPU 

can support  shared interrupts, you should disable this sharing circuit by setting bit 2 at BA + 16 

to  a  "1".    By  doing  this  the  board  works  in  normal  interrupt  mode  and  is  compatible  with  all 

CPUs.

 

Basic Programming for Interrupt Handling 

 

What Is an Interrupt? 

An  interrupt  is  an  event  that  causes  the  processor  in  your  computer  to  temporarily  halt  its 

current  process  and  execute  another  routine.  Upon  completion  of  the  new  routine,  control  is 

returned to the original routine at the point where its execution was interrupted.

 

Interrupts are very handy for dealing with asynchronous events (events that occur at less than 

regular intervals). Keyboard activity is a good example; your computer cannot predict when you 

might press a key and it would be a  waste of processor time for it to do nothing while  waiting 

for  a keystroke  to  occur.  Thus,  the  interrupt scheme  is  used  and  the  processor  proceeds  with 

other tasks.  Then, when  a keystroke does occur, the keyboard

 

‘interrupts’ the  processor, and 

the  processor  gets  the  keyboard  data,  places  it  in  memory,  and  then  returns  to  what  it  was 

doing  before  it  was  interrupted.  Other  common  devices  that  use  interrupts  are  modems,  disk 

drives, and mice.

 

Summary of Contents for DM5816

Page 1: ...BDM 610010027 Rev A DM5816 DM6816 Triggered User s Manual...

Page 2: ...TD 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 sales rtd com techsupport rtd com Web Site h...

Page 3: ...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 trademark...

Page 4: ...ings 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...

Page 5: ...ite 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 Time...

Page 6: ...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 Vect...

Page 7: ...DM5816 DM6816 RTD Embedded Technologies Inc 7...

Page 8: ...ussion 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 eac...

Page 9: ...ir 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...

Page 10: ...se 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 j...

Page 11: ...nterrupt 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 t...

Page 12: ...gure 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 yo...

Page 13: ...lock 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 W...

Page 14: ...l 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...

Page 15: ...DM5816 DM6816 RTD Embedded Technologies Inc 15 Fig 1 7 Base Address Switch S1...

Page 16: ...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 Selec...

Page 17: ...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 t...

Page 18: ...n 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 inclu...

Page 19: ...own 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...

Page 20: ...gerable 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...

Page 21: ...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 locate...

Page 22: ...DM5816 DM6816 RTD Embedded Technologies Inc 22...

Page 23: ...cycle register of the pulse width modulator A write sets the duty cycle to DATA 256 The data will be 0 to 255 BA 3 PWM Control and Digital Output Register Write Only Bit 0 0 disables PWM 0 0 1 enable...

Page 24: ...cycle register of the pulse width modulator A write sets the duty cycle to DATA 256 The data will be 0 to 255 BA 7 PWM Control and Digital Output Register Write Only Bit 0 0 disables PWM 1 0 1 enable...

Page 25: ...cycle register of the pulse width modulator A write sets the duty cycle to DATA 256 The data will be 0 to 255 BA 11 PWM Control and Digital Output Register Write Only Bit 0 0 disables PWM 2 0 1 enabl...

Page 26: ...and a write loads the counter with a new value Counting begins as soon as the count is loaded BA 14 8254 Timer Counter 2 Read Write This address is used to read write timer counter 2 A read shows the...

Page 27: ...interrupt circuit at P14 BA 18 Reserved BA 19 Reserved Programming the DM5816 This section gives you some general information about programming and the DM5816 The module is programmed by reading from...

Page 28: ...n 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 m...

Page 29: ...e Assign bits 3 4 and 5 in a port to 101 bits 3 and 5 set bit 4 cleared First read in the port and clear bits 3 4 and 5 by ANDing them with 199 Then set bits 3 and 5 by ORing them with 40 and finally...

Page 30: ...igital I O 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...

Page 31: ...ammable 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 numb...

Page 32: ...nd remains high until the clock pulse after the next trigger Mode 2 Rate Generator This mode functions like a divide by N counter and is typically used to generate a real time clock interrupt The outp...

Page 33: ...ibed in chapter 1 If you are not planning on using shared interrupts or you are not sure that your CPU can support shared interrupts you should disable this sharing circuit by setting bit 2 at BA 16 t...

Page 34: ...through IRQ7 which has the lowest Many of the IRQs are used by the standard system resources IRQ0 is used by the system timer IRQ1 is used by the keyboard IRQ3 by COM2 IRQ4 by COM1 and IRQ6 by the dis...

Page 35: ...hs study the INTRPTS source code included on your DM5816 program disk for a better understanding of interrupt program development Writing an Interrupt Service Routine ISR The first step in adding inte...

Page 36: ...writing your ISR in assembly language DOS and many floating point emulators are not reentrant Of course there are ways around this problem such as those which involve checking to see if any DOS funct...

Page 37: ...mporarily mask out the IRQ you will be using This prevents the IRQ from requesting an interrupt while you are installing and initializing your ISR To mask the IRQ read in the current IMR at I O port 2...

Page 38: ...vector or use the library routine supplied with your compiler Performing these two steps will guarantee that the interrupt status of your computer is the same after running your program as it was befo...

Page 39: ...nal clock 10 MHz Trigger inputs 3 Output type TTL Isource 8 mA Isink 8 mA Timer Counters CMOS82C54 Three 16 bit down counters 6 programmable operating modes Counter input source External clock 8 MHz m...

Page 40: ...5816 DM6816 RTD Embedded Technologies Inc 40 Environmental Operating temperature 40to 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 15...

Page 41: ...DM5816 DM6816 RTD Embedded Technologies Inc 41 Appendix B Connector Pin Assignments P2 Connector...

Page 42: ...DM5816 DM6816 RTD Embedded Technologies Inc 42 P3 Connector P6 Connector...

Page 43: ...es Inc 43 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 chang...

Page 44: ...beyond the control of RTD EMBEDDED TECHNOLOGIES OR AS A RESULT OF SERVICE OR MODIFICATION BY ANYONE OTHER THAN RTD EMBEDDED TECHNOLOGIES EXCEPT AS EXPRESSLY SET FORTH ABOVE NO OTHER WARRANTIES ARE EXP...

Reviews: