Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

Register level programming of interrupts for PCI 6503

Hi all,

I'm basically trying to get an interrupt from the card upon a change in the data of one of the ports (for instance port A) so I can catch pulse signals without having to poll the pins manually at a high rate. I can't figure out from the documentation and examples whether this is actually possible using register level programming (can't use the DAQmX libraries because I use InTime OS). I can set the appropriate bits of the Interrupt Registers in order to enable the two interrupts (A and B), but I'm not sure what condition generates these interrupts.

Additionally, I want to be able to send out a pulse on a pin and have it automatically cleared by the board.

As far as I can tell both of my requirements mean using the card in strobed mode, but the code examples don't give enough information how to work in this mode. Do i have to use the handshaking mechanism somehow and if so, how is this better for me over using static i/o and manually checking pin values?

Any help or referrence would be greatly appreciated.

Thank you in advance

Orr

0 Kudos
Message 1 of 12
(7,857 Views)

Hi Orr,

The best source of information for this device is its user manual [1], and Appendix B discusses the register map and programming considerations.

Speaking specifically to interrupts, please refer to PDF page 43 (B-2), emphasis mine:


Two software-controlled registers determine which devices, if any, generate interrupts. Each of the 82C55A devices has two interrupt lines, PC3 and PC0, connected to the interrupt circuitry. On the PCI-DIO-96 and PXI-6508, the 82C53 device has two of its three counter outputs connected to the interrupt circuitry. Any of these 10 signals can interrupt the computer if the interrupt circuitry is enabled and the corresponding enable bit is set. Refer to the Programming Considerations for the 82C53 section for more information. Normally, the handshaking circuitry controls PC3 and PC0 of the 82C55A devices; however, you can configure either of these two lines for input and then use them as external interrupts. An interrupt occurs on the signal line low-to-high transition."

The pages following that section describe the interrupt control registers and give pseudo-code examples for configuring them.

 

Once we clear this obstacle, let's move on to your output questions.

[1] PCI-DIO-96/PXI-6508/PCI-6503 User Manual
http://digital.ni.com/manuals.nsf/websearch/6E8329494F3955528625758300678D55

Joe Friedchicken
NI Configuration Based Software
Get with your fellow OS users
[ Linux ] [ macOS ]
Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
0 Kudos
Message 2 of 12
(7,817 Views)

Hi ,

 

I succeeded to generate  interrupts with pci6503 but the interrupts occurs when signal is on high, not in low-to-high transition as I expect, (and understand from the user manual)

 

Thanks

Ruth

0 Kudos
Message 3 of 12
(7,787 Views)

Hello Ruth,

 

I need a little more information to understand what is happening here.  What is making you think that the interrupt behavior is differetn from the manual?

 

Additionally...

Which interrupt are you enabling for your test?  What are your methods to generate the interrupt?

Is your interrupt service routine getting called as you expect?

What bits is your interrupt service routine checking?  Does it write any bits to acknowledge or disable the interrupt?

After exiting the interrupt service routine does it immediately get called again? (perhaps you can share the values read/written on each call of the ISR)

 

Thanks,

Steven T.

0 Kudos
Message 4 of 12
(7,727 Views)

Hi Steven T,

 

I understood that the ISR should be called only when there is a change from low to high in the interrupt line that is enabled. Is it true?

In fact the ISR is called immediately again and again while the input to the interrupt line is high.

If the interrupts in the PCI-6503 are received on high signal a not on the change of the signal (as it is written in the manual), Can you suggest us another PCI card that can make an interrupt only when the external signal changes?

The PCI 6503 has two interrupt lines PC0 and PC3 and I tried both, I connected a pulse generator to one of them and enabled the appropriate interrupt.

When the pulse connected to the interrupt line is high the interrupt is called again and again.

The ISR xor an output bit : *(PORTB_ADDR) = *(PORTB_ADDR)^0x01,

This output bit has been connected to a scope, so that we could see when the ISR was called.

 

Thanks

Ruth

 

 

0 Kudos
Message 5 of 12
(7,722 Views)

Hello Ruth,

 

The interrupt line of any PCI card will remain asserted for as long as the interrupt condition exists.  Most systems will continue to get interrupts as long as the interrupt line is asserted on the PCI bus.  The majority of ISRs will check the interrupt, acknowledge the interrupt, and perform some work if needed.

 

If the ISR never acknolwedges the interrupt, then the ISR will get called immediately after it exits (over and over) until the interrupt condition goes away.  The Interrupt Clear Register will clear the interrupt condition from the PCI card (although, the manual says that the PCI-6503 doesn't have this register).

 

Does your ISR keep getting called after the PC0 or PC3 lines go low?

Does the Interrupt Clear Register clear the interrupt condition and prevent the ISR from getting called again (at least until the next low to high transition)?

 

Thanks,

Steven T.

0 Kudos
Message 6 of 12
(7,709 Views)

Hello Steven,

 

  1. When the signal in the interrupt lines is  low, the ISR isn’t called.

2. I tried to clear the interrupt with the interrupt Clear Register it doesn’t help. (I didn’t do it before because the manual says that the PCI-6503 doesn't have this register).  I tried to clear Port C it neither helps                      

 

Thanks                                                                                  

Ruth

0 Kudos
Message 7 of 12
(7,701 Views)

I would have to recomment another card based on the behavior you are seeing.  The X Series cards are better behaved in that the interrupts can be cleared in the ISR.  These cards have a change detection interrupt for the DIO lines (some of the boards have 32 dio lines).

 

The X Series are PCIe and also come with analog input, analog output, and counter/timer functionality.

 

Thanks,

Steven T.

0 Kudos
Message 8 of 12
(7,698 Views)

Hello,

 

Can you recomment a  PCI card ? Can I use PCI-6528 for this purpose? 

0 Kudos
Message 9 of 12
(7,690 Views)

Hello,

 

Can you recomment a  PCI card ? Can I use PCI-6528 for this purpose? 

0 Kudos
Message 10 of 12
(7,689 Views)