09-22-2010 12:31 PM
Hello,
I'm testing 6224 card digital I/O as per dioex2.cpp under VxWorks. My goal is to set P1 as output, P2 as input. So, based on dioex2.cpp, I set the register DIO_Direction = 0x00ff (actually, it's not correct as Tom W pointed out, DIO_Direction register is 32-bit corresponding to P0, but how to set P1/P2, he didn't mentioned), PFI_Output_Select_1 = 0x4210, PFI_Output_Select_2 = 0x4210, PFI_Output_Select_3 = 0x410, PFI_Output_Select_4 = 0, PFI_Output_Select_5 = 0, PFI_Output_Select_6 = 0, and PFI_DO = 0x55, however, the values are not written into the registers, they always keep power-up values (DIO_Direction = 0xffffffff, the others are 0). Seems BAR1 registers can't be written, but in the driver, the MITE is enabled BAR1 as per bar0.write32(0xC0, (physicalBar1 & 0xffffff00L) | 0x80).
Any suggestions are appreciated.
Zimin
Solved! Go to Solution.
09-30-2010 02:07 PM
Hello Zimin,
Sorry for the delay. After reformatting your post, I realized that you are describing almost the exact dioex2.cpp example found here.
There may have been some typo's or other errors in your message, but I did find some problems.
1. DIO_Directino = 0x00ff....This register is for configuring port0, in the dioex2.cpp example we use IO_Bidirection_Pin.
2. PFI_Output_Select_3 = 0x410....I think this should be set to 0x210 like the dioex2.cpp example.
I think that with these modifications your example will work for you. If it doesn't work, I would recommend going through the dioex2.cpp example for more information.
Thanks,
Steven T.