- What operating system/platform are you using with this board?
The system we are using our Linux Based, with the latest kernel.org kernel 2.6.32.13. The h/w is a Intel Based Xeon 3.20GHz CPU with 2 hyper-threads. Our kernel is a real time kernel is a high speed kernel that goes thorough the interrupt handler very fast.
- 1. We also noticed that the three bits needed to be set in order to get an interrupt. This is expected behavior. Is this behavior preventing you from moving forward?
No, this does not prevent me from continuing. This was not a behavior that I would have expected. Consider this issue closed.
- 2. From looking at our driver, there doesn't seem to be any indication about a double interrupt that occurs for each change detection. One difference in our driver is that we write ClearEdge to the Clear Register instead of the blanket 0x7C.
It does not matter what clear bits I use as I still get the spurious interrupt. My official driver only clears bits that are specific to the interrupt that occurred, i.e. it clears only the ClearEdge if the condition occurs. If an overflow occurs, it clears both Overflow and ClearEdge.
I believe the problem appears to be because we are running on a fast processor with a fast kernel and possible doing write posting. I put a delay in the interrupt handler before exiting it and was able to stop the spurious interrupts being generated. Playing some more with the code, I was able to provide a work around by issuing a dummy read of the change_status register after performing the clear of the interrupt. I believe this is forcing the NI-PCI 6509 hardware to clear the spurious interrupt. It is possible that the clear register call is being write posted, with the result that when I exit the interrupt handler, the PCI 6509 has still not cleared the interrupt and returns back to the interrupt handler as a spurious interrupt with a change_status of zero.
With this change, I am able to receive interrupts (both rise and fall edge) at a period of approx. 200 micro-seconds (by using a signal generator – square wave) without any missed interrupts or overflow condition. Anything lower than 150 micro-second period results in errors. I believe this is acceptable.
- Do you have a complete list of register accesses generated from your application so we can better compare the accesses?
Before the workaround, the interrupt handler performed three register accesses: (1) read the master interrupt control register (2) read the change status register (3) based on the results of these two registers, determine which interrupts are pending and issue a clear register with appropriate bits.
The workaround (4th register access) is to issue a dummy read change status register if the clear register is written too.