04-08-2008 09:10 AM
In the dioex2.cpp, what does the PFI_Output_Select_(n) mean? n = 1,2,3,4,5,6
If I want to program every pin, should I use PFI function?
Does the board->PFI_DI represent the P0.0~p0.5?
Does the board->PFI_DO represent the P1.0~p1.3?
04-08-2008 02:35 PM - edited 04-08-2008 02:36 PM
Hi David-
The PFI_Output_Select registers are used to determine which lines are routed to the PFI outputs on the STC-II (and which eventually route to the I/O connector of the device).
Each PFI_Output_Select register contains three PFI lines. These are:
PFI_Output_Select_1: PFI2, PFI1, PFI0
PFI_Output_Select_2: PFI5, PFI4, PFI3
PFI_Output_Select_3: PFI8, PFI7, PFI6
PFI_Output_Select_4: PFI11, PFI10, PFI9
PFI_Output_Select_5: PFI14, PFI13, PFI12
PFI_Output_Select_6: PFI15
The layout of the register is three 5-bit enum values, right-justified (i.e. PFI0 is bits 0-4, PFI1 is bits 5-9, etc) with any unused bits being "don't care". The enum values for each PFI line are:
•
0: Default• 1: AI_Start1_PFI
• 2: AI_Start2_PFI
• 3: AI_CONVERT
• 4: G1_selected_SRC
• 5: G1_selected_GATE
• 6: AO_UPDATEn
• 7: AO_Start1_PFI
• 8: AI_START_Pulse
• 9: G0_selected_SRC
• 10: G0_selected_GATE
• 13: G0_out
• 14: G1_out
• 15: Freq_Out
• 16: PFI_DO
• 17: Analog_Trig
• 18: RTSI0
• 19: RTSI1
• 20: RTSI2
• 21: RTSI3
• 22: RTSI4
• 23: RTSI5
• 24: RTSI6
• 25: RTSI7
• 29: CDI_SAMPLE_CLK
• 30: CDO_SAMPLE_CLK
• 31: Logic low
Which M Series devices are you planning to use? In another post you mention the 6230 and 6232. Neither of these are supported by the MHDDK, but they should be easy enough to program. I would recommend setting all of the PFI lines to PFI_DO if you are planning to use the device for static DIO operations. The board will power up with the line directions set correctly as either input or output. Then you can either write data to PFI_DO or read from PFI_DI and mask out values as specified here:
PFI0-PFI5 = input
PFI6-PFI9 = output
Hopefully this helps-
04-08-2008 07:39 PM
Nw I have five kind fo card, they are 6230,6232,6723,7831 and 7811. I have do well with the 78XX seriels cards. but feel comfused with the M serials card. Using the NI ddk. The DAC of the 6230 and 6232 can work properly, but the 6723 doesn’t work.does it not belong to the M serials ? so How can I make it to D/A ? and this morning I will try to use the DIO of the 6230 and 6232 following your words.
Thanks a lot!
04-08-2008 09:47 PM
These are the codes I used to program the PFI lines of 6230 and 6232, but it just can’t work properly:
// Is this necessary to set the directions of the PFI lines ?
board->IO_Bidirection_Pin.writeRegister (0x
// Set all the ten PFI lines as PFI_DO
board->PFI_Output_Select_1.writeRegister (0x4210); board->PFI_Output_Select_2.writeRegister (0x4210);
board->PFI_Output_Select_3.writeRegister (0x4210);
board->PFI_Output_Select_4.writeRegister (0x10);
//now set PFI 6~9 to High
board->PFI_DO.writeLowerPort (0x
board->PFI_DO.writeUpperPort (0x
board->PFI_DO.writeRegister (0xff00); // or the function work?
// ---- Read-back value ----
u16 value;
value = (u16) (board->PFI_DI.readRegister()); // does the function work?
Would you tell why the codes just can’t work? What is the problem?
Can you just tell me the offset of all the registers needed to program the DIO and the sequence to set the registers?
04-09-2008 09:05 AM
11-26-2008 11:47 AM
Hi ,
I am using M series PCI-6221 and the MHDDK code to access Port 0 , 1 & 2 .
Is there a way to bit address the 24 DIO lines ?
Mainly to either a set a single DIO line or read its status ..
Thanks,
Irfan
11-26-2008 12:59 PM - edited 11-26-2008 01:00 PM
Hi Irfan-
Please see my comments about M Series DIO in your other thread, here.