Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

interrrupt removal

we're working on a LabVIEW real time driver for one of our older cards.

 

there are several registers in the card that deal with interrupts. there is one register that has some bits that get set when an interrupt is active. there is another register with a bit to reset the interrupt. and there are a couple of registers with bits to indicate which interrupt was generated.

we use the Visa Driver Wizard to generate the ini and inf files.

 

when we specifiy the register/bit for detection and specify the register/bit for interrupt removal, when our ISR code is called and we check the status registers, they are all zero because we have reset the interrupt.

 

if we don't specify the register/bit for interrupt removal, the CPU utilization goes to 100% on the target computer that is running RT and our ISR never gets called.

 

the code that we are using is being ported from our VxWorks driver. it seems that in that operating system, the ISR get called, we get a chance to read the status registers, and then we/the driver, resets the bit for the interrupt in the card's register.

 

i was wondering if you knew of a work around. thanks.

0 Kudos
Message 1 of 4
(6,684 Views)

Hi Chucky,

 

As you may already know, NI doesn't officially support custom board development.  With that being said, I'll definitely try to help.  First off, what kind of board are you using?  Also, please attach your .inf file if possible.

0 Kudos
Message 2 of 4
(6,637 Views)

hello. we make MIL-STD-1553 and ARINC 429 protocol boards and componets.

 

this particular board is a 4 channel card. when an interrupt occurs, one of four bits in a register at BAR 1 offset 0x800 will be set. in this case, our sequence is checking 4 bits, one for each channel. to reset the interrupt, we then have to set a bit in another register in BAR1. the offset depends on the channel.

 

the problem is that when the ISR is called, we need to check the contents of a couple of other registers to see which interrupt occured in a channel. but because the interupt has been reset by the ini file, the contents of these registers has been zeroed out. there is no way to change the operation/hardware of the board at this time.

 

if we don't reset the interrupt, the CPU utilization goes to 100% and our ISR never gets called.

 

so, is there anyway to edit the files so that our ISR gets called and not resetting the bit? or, is there any way to tell the ini file to read our status registers before clearing the interrupt and caching them some where so our ISR can read them?

 

thanks.

Download All
0 Kudos
Message 3 of 4
(6,627 Views)

Hey chucky,

 

So if I understand correctly, you only need to read those status registers to determine which interrupt occured? If so, I think this can be done with the PCI Received Interrupt Sequence attribute.

 

It looks like your .inf file already has an individual detection sequence for each of your four interrupts. Once you receive an interrupt, your ISR can look at the PCI Received Interrupt Sequence (in C: VI_ATTR_PXI_RECV_INTR_SEQ) value returned to determine which sequence detected the interrupt. From here you can use some logic in your code to match the sequence value with what interrupt occured. I've attached a screenshot of the LabVIEW property node you can use for this. 

 

More details about this attribute can be found in the VISA help. Let us know if this works for your application, thanks!

Justin E
National Instruments R&D
0 Kudos
Message 4 of 4
(6,550 Views)