Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Question regarding SPI/DIO use for USB-8451

Hello,

I was wondering if someone could help me understand the USB-8451 device a little better. I have been attempting to use the SPI write command as well as the DIO line write command within the same program (Note: I am not using the SPI DIO line write command as, for some reason, this does not seem to work. Also, the purpose of the DIO line write command is to send a pulse to an external flip-flop to signal that the data has been sent), but when the SPI write command executes it seems as though the DIO line floats high, producing undesirable effects in my design. I have attached a copy of the Labview program I have been using to test my design, as well as a test file. Could someone offer an explanation as to why I am encountering these effects, or possibly even suggest some improvements for the program. Thanks.

Andre


Download All
0 Kudos
Message 1 of 10
(4,690 Views)
Sorry, I misunderstood your code and answered to fast.


Message Edité par JB le 03-28-2008 09:31 AM
0 Kudos
Message 2 of 10
(4,677 Views)
Please test attached modified version and let me know if it works.
0 Kudos
Message 3 of 10
(4,670 Views)
Hello,

Thank you for the response, however I cannot view the modified program as I only have LabView 8.2, and it seems you are using LabView 8.5 (from the error message). Is there any way you can save this program in a different format so that I can view it. Thanks.

Andre
0 Kudos
Message 4 of 10
(4,656 Views)
Here is it in LV 8.2. I could successfully change the state of the DO.
0 Kudos
Message 5 of 10
(4,648 Views)
Hello,

Sorry for the long wait in response, I am an undergrad student and have just finished exams. Thanks for the program, it worked well. I do have a follow up question however, I attempted to extend the program to accommodate 4 consecutive SPI writes (to transmit 32 bits in total) and the program no longer worked. I am having a hard time understanding how Labview works as things only seem to work when I construct the program in a certain order. To solve my problem I simply reversed the levels on the DIO write VI and ran my circuit using low level logic. Could you show me how to modify the program to work using high level logic? Thanks. I have attached a copy of my latest program, along with a sample text document to use with it.

Andre
Download All
0 Kudos
Message 6 of 10
(4,562 Views)
Attached VI is a simplified version of your code. Please try it and let me know if it works. After that, we will see how to solve the high/low logic level problem.
0 Kudos
Message 7 of 10
(4,551 Views)
Hello,

Thank you for the improved VI, it seems to work as expected. How did you write 4 consecutive bytes using a single SPI read/write VI? Now what do we do about high/low level logic problem? Thanks

Andre
0 Kudos
Message 8 of 10
(4,543 Views)
As you have noticed, the input type of the VI is an array. Instead of writing 4 arrays with 1 element, the code writes now 1 array with 4 elements.

Back to the logic levels. Could you please explain with more details what you are trying to do ?
0 Kudos
Message 9 of 10
(4,537 Views)
I am trying to send the 32 bits into a serial in-parallel out shift register. From there I have a second parallel-in, parallel-out shift register that reads from the first one on a different clock (faster than the USB-8451). However, to pass the 32 bits into the second shift register I have to make it wait until the SPI write has completed, so I have connected the DIO line to a D-type flip flop that is ANDed with the clock to the second shift register. What I want is that when the DIO line goes high, the clock on the second shift register begins to shift in the 32 bits from the first shift register. However, when I use this high level logic the second shift register seems to load with intermediate values as the first shift register is being loaded, almost as though the DIO line is floating high or something as the SPI write is executing. I have tested the circuit replacing the DIO line with a manual operated pulse generator (push button) on a bread board and it seems to work as expected, but the DIO line only works when I use low level logic. Any ideas why? Thanks.

Andre
0 Kudos
Message 10 of 10
(4,527 Views)