USB to SPI

Hi
Can we read USB device using Labview 8. Our application can be better explain with the help of attached block diagram. Please find the attached Document. In this application , we are using a sensor having SPI interface.Then with the help of National Instruments USB to SPI converter we are interfacing it with the PC.
My question is can we read the data from a sensor which is connected to PC using NI USB to SPI converter.
Please reply as soon as possible since it is very urgent.
Thanks & Regards
R
Attachments:
Document.doc ‏19 KB

Hi
In one of our application I have to read the internal register values of the sensors. I am using NI 8451 card.
Pin Details of the sensors are-
SDIO – Serial Port Data Input & Output
XY_LED – Led Control
NRESET – Reset Pin (active low input)
NCS – Chip select (active low input)
VDD5 – Supply voltage
GND – Ground
REG0- Regulator Output
SCLK – Serial Clock Input
My question is NI 8451 is having separate pins for SDO & SDI But sensor is having one pin for SDIO. How to connect them  ,I have to read the register values & some registers are read/writable.??
Please reply as soon as possible, it is very urgent
Regards
R

Similar Messages

  • USB to SPI Converter

    HiI'm trying to use USC-216 Isolated USB to SPI Converter with Labview.But I can't communicate with the unit Is someone familiar with this converter?Best regardsGuy  
    Solved!
    Go to Solution.

    Sorry about the late response
    I don’t have sample code but after I created inf file with NI driver wizard I managed to see the device by using VISA.
    Now my problem is that there is no response from the device
    The device is in bulk mode using endpoint 0 for enumeration, endpoint 1 for reception (IN endpoint) and endpoint 2 for transmission (OUT endpoint) Can you help me?
    Thank's
      Guy

  • USB-8451 SPI

    I have a an ADC chip want to control/acquire data using USB-8451 SPI/I2C module.
    I have setupped initial SPI settings (clock edge, polarity, speed etc).
    If i passed SPI command 3F; the ADC will output data continously...
    How can i read this data continously in LV8.5?
    how does the program looks like?
    I tried while loop. but in while loop I am continuously sending commands isnt it?.
    what is the best way to do?
    can some one help me on this?
    naushica

    Bonjour Jerome,
    Malheureusement, cette carte ne peut pas être utilisé en mode esclave.
    Concernant l'utilisation des signaux MISO et MOSI je pense que vous possédez déjà la doc de la carte. Sinon la voici :
    http://www.ni.com/pdf/manuals/371709b.pdf
    Par ailleurs, je vous invite à consulter cette article qui pourrait peut-être vous aider :
    http://zone.ni.com/devzone/cda/tut/p/id/8359
    N'hésitez pas à nous répondre si vous avez encore des questions en précisant quel logiciel vous utilisez (LabVIEW...) et avec quel microcontroleur vous souhaitez dialoguer.
    Cordialement
    Jean-Philippe
    Jean-Philippe C.
    National Instruments France

  • NI USB-8451 SPI clock release

    Is it possible to release the SPI clock signal so it reamins high immediately after sending data on the SDO line? Currently, SCLK is held low for a significant period of time after transmission of the final data bit before it is released to a logic high state. Is there a way to configure this? Is there also a way to configure DIO signals independent of the SPI using scripting?

    Hi John,
    I believe you are referring to the clock polarity and phase.
    Where Can I Find More Information About the SPI Clock in a USB-8451?
    http://digital.ni.com/public.nsf/allkb/4FB0A184E545AC1586257609007537EF?OpenDocument
    The information is found here in the NI-845x Hardware and Software Manual:
    http://www.ni.com/pdf/manuals/371746e.pdf#page=26
    Additionally, beyond using SPI scripting, we can use the basic SPI and basic DIO examples installed with the 845x driver in Help > Find Examples.
    Joey S.
    Software Product Manager
    National Instruments

  • USB-8451 SPI interface with analog devices isensor

    Does anyone has example VI using USB-8451 with analog devices isensor? I am new to SPI interface and very slowly learning how to use labview in conjunction with USB-8451 to do SPI sensor reading.
    Any help would be appreciated. I'm using labview 8.5. 

    elpiar wrote:
    It's working!
    Well, I realized I made a small mistake in the example. The number of bytes in the array constant should be 4, not 2. The device is full duplex, meaning you can write and read from it at the same time. The NI-845x SPI Write Read VI returns the same number of bytes as the number of bytes that were written. Thus, with just 2 bytes you will not actually get the current value of the register. You would get the values from the previous command. See attached mod.
    Now if I read the data is burst mode, will the output be automatically be arranged in an array of 8-bit length words? You mention something about send out out 8 clock burst. I'm not sure how I do this. 
    For burst mode you have to send out more bytes so you get clocks generated for the read to occur. The burst mode command is 3E00. That needs to be followed by 12 16-bit numbers for the device to return all the registers from SUPPLY_OUT to AUX_ADC. The actual bytes after the 3E00 are irrelevant for a write. The NI-845x SPI Write Read VI should then return 26 bytes (2 bytes that line up with the 3E00 command, followed by 2 bytes per register, for 12 registers). You can convert this into an array of U16 values and do the conversions based on which register you're actually reading. I've attached a VI to get you started. The example converts the SUPPLY_OUT register and each of the GYRO_OUT registers. You can finish the VI. Note that you should make the 14-bit to 16-bit extension a subVI so you're not duplicating code. 
    NOTE: As with all example code that is provided you should verify that the numbers you get are correct. We don't have the hardware, so we can't verify correct operation. 
    Attachments:
    ADIS16400 XGYRO_OUT v2.vi ‏29 KB
    ADIS16400 Burst Read Example.vi ‏36 KB

  • USB 8451 SPI Communicat​ion

    Hi All,
    I am tring to write SPI 16 bits command to TI TLV5638 DAC.
    Labview examples are for 8 bits only. can anyone help me?
    Thanks,
    Eliran. 
    Message Edited by Eliran11 on 06-29-2008 02:44 AM

    Hi Eliran,
    The USB 8451 supports only 8 bit communication.
    This KB has a suggestion on how to implement 16 bit commands. "The approach you would take when writing or reading a 16 bit number is
    to write or read a byte array of length 2. You can use a Type Cast to
    convert back and forth between arrays of 8 bit integers and arrays of
    16 bit integers."
    Hope this helps!
    Warm regards,
    Karunya R
    National Instruments
    Applications Engineer

  • Looking for USB-8451 SPI example

    Does anyone have a typical SPI example VI for the USB-8451 Interface. I want to program a VI for a SPI device, but I don't know how. This example should include DIO Line programming as well, if possible.

    Hello thmsfrst,
    http://zone.ni.com/devzone/conceptd.nsf/webmain/B380E99DAAD898B38625710F007003C5?OpenDocument
    This link shows an example how to the USB8451 and the SPI  Interace to evaluate a TI  ADC
    The example download does not work so i have attached an example for LV8.0 and one for 7.1.
    If you have further questions don't hasitate to ask
    Stefan
    Attachments:
    example.7z ‏92 KB

  • USB-8451 SPI Read/Write MOSI

    I have a USB-8451 that I am using for SPI communications. The USB-8451 is the master device, and I have no problem sending and recieving data. The problem is that I cannot send what I want to with the USB-8451. When I execute a read command for 16 bit data, the USB-8451 sends 0x0300. I need to send certain commands over SPI in order to get the correct response; ie - send 0x1000, 0x2000, 0x3000, etc. I have not found a way to do this, and it is very critical that I am able to for this project to work correctly. Any suggestions?  

    Hello Johu,
    The SPI Read Write vi has a data write input which takes in an array of bytes.  If you want to ONLY read 16 bit, you have to put an array of 2 bytes which are 0.  Since SPI is a full duplex protocol, it will send 0x00 0x00 and receive 16 bits at the same time.  
    Usually, you send a command before reading.  So, you would send a total of three bytes, the first one being your command.  The first byte returned would not contain any data, since your device is reading the command.  The 2 last bytes would contain your data.  So:
    Bytes Sent         Bytes Read
    CMD                           0 (or should be 0)
    0                                 Data1
    0                                 Data2
    You can download these test panels and try to using them to send your commands and read your data.  
    Please let me know if any of this is not clear or if you need more help with this.  Have a great day.   
    O. Proulx
    National Instruments
    www.ni.com/support

  • USB 8451-SPI AD7904

    Hi,
    I am using SPI 8451 Module to send commands to AD7904 (4 input multiplexer ADC).  
    I have set up the VI to read/write from 1 channel only. I have a constant voltage on my input but the read data is constantly varying. 
    i think the problem I am facing is that SPI 8541 can only write 8 bit word and I am writing 16 bit word to my AD7904.
    If someone knows how to make the usb spi 8541 to write/read 16 bit word, then my issue is resolved.
    Thanks
    Allan

    Hi,
      for 16 bit, it should be a case of writing / reading 8 bits twice so using the array of data itself..
    You may need to re-order the either the bit order, or the byte order to match you device though. You can split and join two 8 bit numbers from/to a 16 bit one using the inbuilt vi's on the data manipulation palette.
    For the AD7904 I believe the MSB is the first one in the stream, so you may need to re-order the data to match correctly and since the AD7904 is only actually expecting 12 bits of data, but requires 16 clocks, then you need to make sure you've pushed the data to the correct end of the two 8 bit numbers.
    The timing performing this however might not match to the AD7904 if it introduces a SCLK setup time delay in between each byte (hence an array of them shouldn't generate the delay).
    Have a look at the shipping Atmel AT25080A Read.vi (and the matching write one) under the example finder - search for SPI.
    You should find that there's a 16 bit number split into 2 8 bits for transmission before going into a build array with the 0x3 read command on the front.
    Hope that helps
    Thanks
    Sacha Emery
    National Instruments (UK)
    // it takes almost no time to rate an answer

  • Labview - USB- FT2232 - SPI

    Hi,
    I would like to build an application with the FTDI FT2232 Chip which should communicate over SPI with an external device.
    I am using Labview and have implemented predefined VIs from the FTDI Webpage.
    I
    think, i have configured all important parameters, but my problem is,
    that I can't see a clock signal on the scope at the CLK-Pin during a
    read/write operation.
    I am not sure, if I have done all
    the configuration which are necessary for SPI communication, perhaps I
    have forgotten somethink or have made a mistake in the
    configuration and somebody has an idea what went wrong:
    1)
    Set the chip into MPSSE mode to activate SPI functionality (Clock, Data
    Out & CS are defined as OUTPUT, Data In is defined as INPUT)
    2) SPI Open
    3) SPI Set Clock
    4) SPI Init
    5) SPI Write
    I can execute all these Subfunctions successfully, but the clock doesn't work!
    In
    the SPI_Write subfunction I can change the Idle Level of the CLOCK,
    DATA OUT and CS Pins. When I play with these parameters, and change
    them from high to low for example,
    I can see these levels on the scope.
    Does anybody know, if there is something missing in the configuration?
    Regards,
    Markus

    @NN70,@Wetzer The only way this program may run for a longer period is to use the continuous run button. In labview that is a BIG NO-NO.
    And also NN70 you use a frame as a tool to "clean" up a diagram so it do not get so big. In fact the frame is not needed. And by doing some cleaning up. The diagram could easily be fitted in one screen. And we also have the concept of using sub VIs. So all in all NN70. You are in the process of developing some very very bad programming habits. That will cause you severe problems if you do not do anything about it. I am sure Wetzer can point you to some good free Labview lessons.
    If you do not know it NN70. Labview is shipped with a lot of good examples. Go to help in the toolbar. Select help and find examples. Then search for DAQmx. This will give you a long list of examples. Then locate the "Cont Acq&Chart Samples-Int Clk.vi" and take a look at it. This program is nice and compact. And it do much the same as your program do. Note how it is done. The setup and closing. Are done only ONCE. Then the part that is repeated is placed in a loop. This is the correct structure of any program made in Labview. The continuous run button is a tool ONLY for debugging.
    I suggest you use the structure in the the example I pointed you to. Then you also clean up your program and get rid of the frames. Post it here for comments if you feel for it. If not your problem is gone (which I am quite sure will be the case). We will at least have something sane we can work on.
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • NI USB 845x SPI communication with Max1108

    Hi,
    I'm trying to communicate with the Max1108 (datasheet attached)
    when using 8451 Test Panel I get random results,only once i got expected results and i captured this moment(i cant reproduce it somehow)
     I followed this code,
    http://forums.ni.com/ni/attachments/ni/170/283809/1/MLX90316%20Read.c
    which was published by NI in forums..and got same results when I use script functions(code1), and empty read buffer when using regular spi API's (code2)
    Please  ignore the c# adjustments ..
    what am i doing wrong ?
    Thanks,
    Ori
    Attachments:
    MAX11008 DS.pdf ‏646 KB
    code2.txt ‏9 KB
    code1.txt ‏3 KB

    Solved, thanks for your "help"

  • Usb 8451 SPI slave mode

    Bonjour,
    peux t on configurer le module USB 8451 en mode Slave.
    comment utiliser les sorties MISO et MOSI
    je cherche a recuper les informations d'un microcontroleur en mode maitre qui envoie des donnees 8 bits ( il fournit la clock , le cs et les donnees )
    merci pour votre aide
    salutation

    Bonjour Jerome,
    Malheureusement, cette carte ne peut pas être utilisé en mode esclave.
    Concernant l'utilisation des signaux MISO et MOSI je pense que vous possédez déjà la doc de la carte. Sinon la voici :
    http://www.ni.com/pdf/manuals/371709b.pdf
    Par ailleurs, je vous invite à consulter cette article qui pourrait peut-être vous aider :
    http://zone.ni.com/devzone/cda/tut/p/id/8359
    N'hésitez pas à nous répondre si vous avez encore des questions en précisant quel logiciel vous utilisez (LabVIEW...) et avec quel microcontroleur vous souhaitez dialoguer.
    Cordialement
    Jean-Philippe
    Jean-Philippe C.
    National Instruments France

  • USB 8451-how to set a chip select value

    I need some help on USB-8451 SPI programming using LabVIEW. On the USB-8451 device, there are 8 physical chip select (CS) lines. I will need to program or use all of these CS lines to select one of the 13 SPI slave chips on the circuit board. I know I will have to use the SPI Configuration Property Node to program CS state. What value should I use to set the CS property if need the following CS line states to select one of our chips?
    CS0 = 1; CS1 = 0; CS2 = 0; CS3 = 1; CS4 = 1; CS5 = 0; CS6 = 1; CS7 = 0
    Thanks, Min.

    FYI: VI referenced is attached.
    Chris R.
    Applications Engineer
    National Instruments
    Attachments:
    845x CS Lines Set_modified.vi ‏28 KB

  • LabVIEW 2011 and the USB-845x

    Hello there,
    I was curious to see if anyone else had the same problem and a resolution to my issue. I have Windows 7 x64 and recently did a clean install of LabVIEW 2011 x64. I have a USB-8451 SPI/I2C card that I am trying to make available to use in LabVIEW. The newest drivers (2.0) say in the readme file that Windows 7 x64 is supported and that LabVIEW 2011 x86 is supported but not x64. I installed and tried it out to no avail. However upon copying and pasting from the Program Files x86 to the Program Files (64-bit) LabVIEW folder, I now have the 845x palette available under the Instrument I/O main palette but everytime I choose one for the block diagram it asks for the location for the ni845x.dll shared library file. The only one I found on the whole system was in C:/Windows/SysWOW64 and I link to that file and now the VI's error out saying the library wasn't found/loaded and am just stuck now. Any help would be greatly appreciated.
    Thanks

    The issue has to do with being able to (or rather not being able to) load 32-bit DLLs into a 64-bit process. While the driver readme says that it's compatible for both Windows 7 32-bit and 64-bit, that's not the same thing as saying the DLL is 64-bit. And in order to be able to use it from LabVIEW 64-bit you need a 64-bit DLL. This is an operating system limitation, not a LabVIEW one. Thus, you have to use LabVIEW 32-bit. Your license allows you to install both 32-bit and 64-bit, so unless you have a specific reason to use 64-bit LabVIEW (like you're trying to manage gobs of memory), stick with 32-bit LabVIEW for now.

  • NI8451 SPI data transfer speed and SCLK setup time adjustment

    I'm using NI USB-8451 SPI bus to do communication. I can not reach the speed of communication 4MHz (NI USB-8451 module advertises speeds up to 12MHz). Actrually the data transfer speed is much slower than 4/8 Mb/s. The 16k*16bit data cost around 800ms while it should be 128ms if the data transfer achieves 4Mhz speed. In the manual there is a SPI timing clock figure like this:
     In the 4Mhz communication case,  the t2 should be 0.25us. I wonder whether the low data transfer speed is due to t1,t3 and t4 since they occupy too much "dead time". If my guess is right, is there any method to reduce the t1,t3 or t4, espetially t3? I know that in the advanced API there is a way to add delay while I did not figure out how to reduce delay(t3).  If my guess is wrong, what is the exactly maximum data transfer speed NI8451 can support? (not the clock rate)
     Thanks for help.

    Hi everyone. Im using the SPI communication with 8451 and Im having the same situation., since the serial flash memory I need to program is big enough, t3 (SCLK Setup time) and other "dead time" which I think is the time when buffer on the 8451 needs to be re-filled those are killing my expectation on the final results. I can't see a way to decrease t3 (~10uSec) and in the same way Im seeing something like buffering up to 100~110 bytes then, a ~1.5mSec delay appears on the signal waveforms. Did somebody have good results trying to avoid this?
    Thank you.
    Javier
    Attachments:
    t3 - SCLK setup time.jpg ‏156 KB
    Data byte Transfer_109.jpg ‏137 KB

Maybe you are looking for

  • Getting space at the bottom in the pdf output

    I'm designing a pre-printed Invoice report using BI Pub. The template is in word and when I take pdf output I get space at the bottom, even though there is no space at the bottom in template(rtf). The template fits propely in pre-printed paper, but w

  • I can't open final cut pro

    I can't open final cut pro. I tried many times but always same message. During reading audio filter "GSP-1101" then stop and error message shows. GSP-1101 is digitech guitar multi effect for.  I erase that app but still same. It says Process:        

  • OWA CSS11501 and ssl termination

    Hi, Is it possible to use the css to load balance for OWA and offload SSL ? have tried this and it appears to break OWA even though other web apps work ok through same CSS. When removing ssl termination could only make load balancing work when incomi

  • Intrastat - export declaration

    HI, I have one intrastat business scenario: This process involves b/w three  countries: Step1: Germany sales org. (G100)(Comany code for germany: GA00)create orders from Austria customer. Step2: Delivery is made from plant 9000(France Plant) (Company

  • Some Directories Aren't Recognized

    For some reason, when I choose to "Add Folder to Library," it doesn't read all the files in the directory. Instead, I have to go through each individual sub-directory to make sure the files in them are put into the library. Anyone else have this prob