Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

interrupt programming on 6254

Hi, I'm writing a card driver using RTX, DDK and the NI PCI-6254,
 
I've managed to init the card and can read channels fine as long as I enter a loop, i.e.
 
m = 0
while (!board->AI_Status_1.readAI_FIFO_Empty_St())
{
        ... read FIFO data
}
 
 
this works perfectly, however, For my particular application I need to use interrupts because the response to an event
has to be very very fast. the problem i'm having is I can register the interrupt on the correct pin, however cannot get the
card to generate any interrupts. the provided examples by NI don't have any that use interrupts.
 
Does anyone know how to set up the registers for FIFO_NotEmpty interrupts on an M Series card?
 
Thanks
 
 
John
0 Kudos
Message 1 of 6
(8,797 Views)
Hi John,

try this:

// sert FIFO mode to not empty.
board->AI_Mode_3.writeAI_FIFO_Mode (tMSeries::tAI_Mode_3::kAI_FIFO_ModeNot_Empty);

// Enable FIFO interrupt
board->Interrupt_A_Enable.writeAI_FIFO_Interrupt_Enable (1);

// Enable Interrupt A group
board->Interrupt_Control.writeInterrupt_Group_A_Enable (1);

Diego
Message 2 of 6
(8,765 Views)

Spot on DiegoF thats got it sorted.

It sort of partically worked at one point but for anyone else who comes accross this problem, make sure you convert the windows driver (even if its not installed, i.e. Unknown Device) to a RTX driver. Reason is, the allocated IRQ that gets given to the device cannot be accessed in RTX unless its an RTX device.

 

 

Now that that problem's been solved. Ive ran into another. The problem is when I poll the inputs via taking data from the FIFO buffer, the data appears to all be zero, or in a bipolar setup, -10.0 V. It doesnt matter what I put on the input lines into the card, they still always show zero. Any ideas?

 

 

Thanks

 

John

0 Kudos
Message 3 of 6
(8,743 Views)

Any help on this?

 

 

Thanks

John

0 Kudos
Message 4 of 6
(8,708 Views)
Hi John,

If you are using the adcReset() function in the mseries examples, the static_AI_control line is active low.  The function originally used:

    board->Static_AI_Control[0].writeRegister (1);
    board->Static_AI_Control[0].writeRegister (0);

when it should be:

    board->Static_AI_Control[0].writeRegister (0);
    board->Static_AI_Control[0].writeRegister (1);

Also, make sure the convert polarity is set correctly for 625x devices:

    aiPersonalize (board,tMSeries::tAI_Output_Control::kAI_CONVERT_Output_SelectActive_Low);

Let me know if that works.
Diego
Message 5 of 6
(8,688 Views)
Spot on!!!!!!!
 
 
You don't know how happy thats made me! If you were here I'd shake your hand and buy you a drink. I spent in excess of 20 hours trying to fix that.
 
It now reads all the inputs perfectly.
 
Thanks buddy.
 
 
John
0 Kudos
Message 6 of 6
(8,678 Views)