6-7
Before you install your ISR, temporarily 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 21H for IRQ0-IRQ7, or at I/O port A1H for IRQ8-IRQ15 and
set
the bit that corresponds to your
IRQ (remember, setting a bit disables interrupts on that IRQ while clearing a bit enables them). The IMR on
8259A is arranged so that bit 0 is for IRQ0, bit 1 is for IRQ1, and so on. The IMR on 8259B is arranged so that bit
0 is for IRQ8, bit 1 is for IRQ9, and so on. See the paragraph entitled
Interrupt Mask Register (IMR)
earlier in this
chapter for help in determining your IRQs bit. After setting the bit, write the new value to I/O port 21H (IRQ0-
IRQ7) or I/O port A1H (IRQ8-IRQ15).
With the startup IMR saved and the interrupts on your IRQ temporarily disabled, you can assign the interrupt
vector to point to your ISR. Again, you can overwrite the appropriate entry in the vector table with a direct
memory write, but this is a bad practice. Instead, use either DOS function 25H (set interrupt vector) or, if your
compiler provides it, the library routine for setting an interrupt vector. Remember that vectors 8-15 are for IRQ0-
IRQ7 and vectors 70H-77H are for IRQ8-IRQ15.
If you need to program the source of your interrupts, do that next. For example, if you are using the program-
mable interval timer to generate interrupts, you must program it to run in the proper mode and at the proper rate.
Finally, clear the bit in the IMR for the IRQ you are using. This enables interrupts on the IRQ.
Restoring the Startup IMR and Interrupt Vector
Before exiting your program, you must restore the interrupt mask register and interrupt vectors to the state
they were in before your program started. To restore the IMR, write the value that was saved when your program
started to I/O port 21H for IRQ0-IRQ7 or I/O port A1H for IRQ8-IRQ15. Restore the interrupt vector that was
saved at startup with either DOS function 25H (set interrupt 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 before your program started running.
Common Interrupt Mistakes
Remember that hardware interrupts are numbered 8 through 15 for IRQ0-IRQ7 and 70H through 77H for
IRQ8-IRQ15.
The most common mistake when writing an ISR is forgetting to issue the EOI command to the appropriate
8259 interrupt controller before exiting the ISR.
Remember to clear the IRQ circuit on the DM6210 at BA + 6.
Содержание DM6210
Страница 2: ......
Страница 9: ...i 1 INTRODUCTION...
Страница 10: ...i 2...
Страница 14: ...1 2...
Страница 22: ...1 10...
Страница 24: ...2 2...
Страница 28: ...2 6...
Страница 30: ...3 2...
Страница 34: ...4 2...
Страница 44: ...5 2...
Страница 48: ...5 6...
Страница 50: ...6 2...
Страница 56: ...6 8...
Страница 57: ...7 1 CHAPTER 7 TIMER COUNTERS This chapter explains the 8254 timer counter circuits on the DM6210...
Страница 58: ...7 2...
Страница 61: ...8 1 CHAPTER 8 DIGITAL I O This chapter explains the digital I O circuitry on the DM6210...
Страница 62: ...8 2...
Страница 65: ...9 1 CHAPTER 9 EXAMPLE PROGRAMS This chapter discusses the example programs included with the DM6210...
Страница 66: ...9 2...
Страница 68: ...9 4...
Страница 70: ...10 2...
Страница 74: ...10 6...
Страница 75: ...A 1 APPENDIX A DM6210 SPECIFICATIONS...
Страница 76: ...A 2...
Страница 78: ...A 4...
Страница 79: ...B 1 APPENDIX B CN3 CONNECTOR PIN ASSIGNMENTS...
Страница 80: ...B 2...
Страница 82: ...B 4...
Страница 83: ...APPENDIX C COMPONENT DATA SHEETS C 1...
Страница 84: ......
Страница 85: ...Intel 82C54 Programmable Interval Timer Data Sheet Reprint...
Страница 86: ......
Страница 88: ...D 2...
Страница 90: ...D 4 RTD Embedded Technologies Inc 103InnovationBlvd StateCollegePA16803 0906 USA Ourwebsite www rtd com...
Страница 91: ...DM6210 User Settings Base I O Address hex decimal IRQ Channel...