![background image](http://html1.mh-extra.com/html/national-instruments/daqcard-dio-24/daqcard-dio-24_user-manual_709163065.webp)
Appendix B
Register-Level Programming
DAQCard-DIO-24 User Manual
B-24
©
National Instruments Corporation
/* EXAMPLE 3–Set up interrupts for mode 1 output for port A. Enable the
appropriate interrupt bits. */
wrt(cnfg,0xA0);
/* Port A is an output in mode 1. */
wrt(ireg1,0x01);
/* Set IRQ0 to enable port A interrupts.*/
wrt(cnfg,0x0D);
/* Set PC6 to enable interrupts from */
/* 82C55A. */
wrt(ireg2,0x04);
/* Set INTEN bit. */
/* EXAMPLE 4–Set up interrupts for mode 1 output for port B. Enable the
appropriate interrupt bits. */
wrt(cnfg,0x84);
/* Port B is an output in mode 1. */
wrt(ireg1,0x02);
/* Set IRQ1 to enable port B interrupts. */
wrt(cnfg,0x05);
/* Set PC2 to enable interrupts from */
/* 82C55A. */
wrt(ireg2,0x04);
/* Set INTEN bit. */
/* EXAMPLE 5–Set up interrupts for mode 2 output transfers. Enable the
appropriate interrupt bits. */
wrt(cnfg,0xC0);
/* Mode 2 output */
wrt(ireg1,0x01);
/* Set IRQ0 to enable port A interrupts. */
wrt(cnfg,0x0D);
/* Set PC6 to enable interrupts from */
/* 82C55A. */
wrt(ireg2,0x04);
/* Set INTEN bit. */
/* EXAMPLE 6–Set up interrupts for mode 2 input transfers. Enable the
appropriate interrupt bits. */
wrt(cnfg,0xD0);
/* Mode 2 input */
wrt(ireg1,0x01);
/* Set IRQ0 to enable port A interrupts. */
wrt(cnfg,0x09);
/* Set PC4 to enable interrupts from */
/* 82C55A. */
wrt(ireg2,0x04);
/* Set INTEN bit. */
}
Interrupt Handling
To enable interrupts from the DAQCard-DIO-24, set the INTEN bit of
Interrupt Register 2. First, clear this bit to disable unwanted interrupts.
After all sources of interrupts have been disabled or placed in an
inactive state, set INTEN.
To interrupt the host computer using the 82C55A, program the 82C55A
for the I/O mode desired. In mode 1, set either the INTEA or the INTEB
bit to enable interrupts from port A or port B, respectively. In mode 2,
set either INTE1 or INTE2 for interrupts on output or input transfers,
respectively. The INTE1 and INTE2 interrupt outputs cascade into a
Содержание DAQCard-DIO-24
Страница 68: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 2 National Instruments Corporation ...
Страница 69: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 3 DAQCard DIO 24 User Manual ...
Страница 70: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 4 National Instruments Corporation ...
Страница 71: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 5 DAQCard DIO 24 User Manual ...
Страница 72: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 6 National Instruments Corporation ...
Страница 73: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 7 DAQCard DIO 24 User Manual ...
Страница 74: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 8 National Instruments Corporation ...
Страница 75: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 9 DAQCard DIO 24 User Manual ...
Страница 76: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 10 National Instruments Corporation ...
Страница 77: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 11 DAQCard DIO 24 User Manual ...
Страница 78: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 12 National Instruments Corporation ...
Страница 79: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 13 DAQCard DIO 24 User Manual ...
Страница 80: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 14 National Instruments Corporation ...
Страница 81: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 15 DAQCard DIO 24 User Manual ...
Страница 82: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 16 National Instruments Corporation ...
Страница 83: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 17 DAQCard DIO 24 User Manual ...