Handling Interrupts; Disabling Change Notification - National Instruments 6527 Series Programmer's Manual

Register-level
Hide thumbs Also See for 6527 Series:
Table of Contents

Advertisement

Chapter 3
Programming
Write (Clear Register,0x03)
Write (Port 0 Filter Enables, 0xFF)
2. Set the Edge Detection Enable bits for the lines and edges you want to detect.
Write (Port 0 Rising Edge Detection, 0xF2) //Rises to detect: lines 7 down to 4 and line 1
Write (Port 0 Falling Edge Detection, 0xF1) //Falls to detect: lines 7 down to 4 and line 0
3.
Write to the Clear Register to clear any existing interrupts before you begin.
Write (Clear Register, 0x0F)
4.
After all other configuration, write to the Master Interrupt Control Register to enable
interrupt generation.
Write (Master Interrupt Control, 0x01)

Handling Interrupts

Inside your interrupt service routine (ISR), use the Change Status Register to verify that a
change occurred using the following pseudocode example:
Read (Change Status)
Then read the value of the input lines from the Port Register:
Read (Port 0)
The value you read from the Port Register indicates the present state of the input lines at the
time you execute the read. The state you read may not be the state that caused the interrupt
because the inputs may have changed after the interrupt was generated. The Port Registers do
not indicate which line changed, how many times a line changed, or whether a line rose or fell.
To clear a change notification interrupt, write to the Clear Register:
Write (Clear Register,0x08)

Disabling Change Notification

To disable change notification, write to the Master Interrupt Control register:
Write(Master Interrupt Control,0x00)
After disabling interrupts, you can write to any other configuration register that you want to
reprogram.
6527 Register-Level Programmer Manual
//Clear filters and filter interval clock
//Enable filter for eight bits of Port 0
//Clear any previously set interrupt flags
//Enable Interrupts
//Read status to verify change occurred
//Read the present state of input lines
//Clear change detectors
//Disable interrupts
3-8
ni.com

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pci-6527Pxi-6527

Table of Contents