Chapter 3
Programming
©
National Instruments Corporation
3-7
6527 Register-Level Programmer Manual
Change Notification
This section describes how to configure the change notification interrupt feature, handle
interrupts using the 6527 device registers, and unconfigure the change notification interrupt
feature.
As mentioned at the beginning of this manual, you need to know how to write, install, and
uninstall interrupt service routines to use change notification with register-level
programming. This manual does not cover interrupt service routines.
Configuring Interrupt Generation
This example generates an interrupt if certain lines of Input Port 0 change. As illustrated in
Table 3-1, a fall on line 0, a rise on line 1, or any change on line 7, 6, 5, or 4 generates an
interrupt.
Tip
It is recommended that you enable input filtering to prevent a brief glitch or noise
pulse from generating a false interrupt. Filtering also helps protect your computer from an
excessive interrupt rate in case of rapidly changing inputs. This example includes input
filtering.
Follow these steps to configure interrupt generation:
1.
Enable input filtering (optional, but recommended).
Set up filtering with interval of 10 ms.
Write (Filter In 2,0x00)
//Set most significant bits of filter interval
Write (Filter In 1,0xC3)
//Set the intermediate bits of filter interval
Write (Filter In 0,0x50)
//Set least significant bits of filter interval
Table 3-1.
Change Notification Example
Bit
7
6
5
4
3
2
1
0
Changes to detect
—
—
Enable rising-edge
detection
yes
yes
yes
yes
no
no
yes
no
Enable falling-edge
detection
yes
yes
yes
yes
no
no
no
yes