From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

SPI device with NI USB-6009

Hi everybody,
 
Is it possible to use the NI USB-6009 to send and read messages from a SPI slave device?
 
Since now thank you for any answer.
 
Guilherme
 
0 Kudos
Message 1 of 9
(6,738 Views)
hello Guilherme,

a USB-6009 is not the adequate device for SPI communication.
you could use for the example the NI USB-8451, which is designed for this kind of communication.

kind regards,
Robert H
NI germany
Message 2 of 9
(6,720 Views)

Hi Robert,

Ok, I understand that the USB-6009 is not the best hardware for this kind of application, but the fact is that this is the only device I have in the moment, and therefore I would like to ask you for some help in trying to find a way to use the USB-6009 with the SPI device anyway.

The main problem I have in the moment is to synchronize a reading loop with an external clock (which, in turn, controls the rate at which the SPI device sends its bits to one of the digital lines of the USB-6009). The USB-6009 does not support timing through "change detection", so it is not possible to input my external clock signal in another digital line and detect its rising and/or falling edges to control the sampling rate of a reading loop.

I do not have to much experience with Labview and also with this interface USB-6009, and therefore I cannot think in any other solution to this problem, given this resource limitation of the interface I am using. Is there any other way to synchronize the reading sampling rate with an external clock source using the USB-6009? Are there Example VIs that could be interesting for this case?

Thank you in advance for your answer.

Regards

Guilherme

0 Kudos
Message 3 of 9
(6,694 Views)
hello Guilherme,

the USB-6009 has static digital I/Os. this means the can only be timed by software. you cannot synchronize them with an external clock. therefor you would need a M-series or a digital device with clocked I/Os.

kind regards,

robert h

Message Edited by RobertH on 11-05-2007 01:50 AM
0 Kudos
Message 4 of 9
(6,687 Views)

it's not possible to build clk signal by software? put clk at 1 and then at 0 with time wait sequence and while loop in labview???

0 Kudos
Message 5 of 9
(5,604 Views)

It's not that it's "not possible to build clock signals", it's the accuracy of the signal you build. 

 

The timing in a software-timed board is dependent on a lot of factors - what the op system's doing, USB traffic, if the DAQ's doing other I/O, etc.

If a couple ms jitter between bits is acceptable, then the 600x is fine (like toggling relays or flashing an LED for an operator).  For SPI (or most other digital comms), that jitter is unacceptable and the system simply won't work.

 

600x's are great DAQs for the cost, but when you need performance, you need to look at other options.

0 Kudos
Message 6 of 9
(5,590 Views)
OK thanks for these clear response. Finaly I decided to take the NI USB 8451to use SPI. But I have one question : is it possible to use USB 8451for sdio protocol (4bits mode) by using the pin dedicated to SPI and complete with other digital IO pin? Or it's the same problem as in the 600x DAQs?
Thanks in advance.
0 Kudos
Message 7 of 9
(5,585 Views)

It seems worth noting that you can use the 6009 board for some SPI communication quite well. I had the same question as the OP, and I agree with other comments that one shortcoming of the 6009 is that you can't sync with an external clock, however you can bit bang SPI really easily, and as long as you don't need a fixed/stable clock speed, that will be just fine. I was able to program a digital potentiometer by using three digital I/O lines on a 6009, giving each one a button in labview, and manually entering each bit as per the device's spec. A few simple loops and logic would automate this and should give me a decent enough clock speed for what I want. Of course I won't be able to hit the 20MHz top clock speed the chip allows, but that's fine by me at this stage of the game and for using a USB controller that I have laying around.

 

I included my VI as an attachment, written in Labview2011.

 

My understanding is that you could also do this for I2C (though it will be more complicated) <Ref: http://electronics.stackexchange.com/questions/44670/what-is-bit-banging >

 

EDIT: In my code, the button "Data Byte" should be labeled "Data Bit", fyi.

Message 8 of 9
(5,347 Views)

Hello,

 

I am attempting to do something similar, trying to connect my USB-6009 to an Adafruit MAX31856 Thermocouple Amplifier to read a K-Type thermocouple. I am trying to code this in Python. I was wondering if A) you think this is possible through bit banging the SPI, and B) you had any ideas on how to format the loop to do so. Please let me know if I can provide more details. 

0 Kudos
Message 9 of 9
(2,033 Views)