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)

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 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

  • 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

  • How can I get a new FRC rookie Labview USB Flash drive? Ours is defective.

    Hello, we are a rookie FRC team. We have already sentin our missing parts list prior to attempting to install labview on the new classmate PC they gave us. The Labview USB/Flashdrive they gave us is defective. No matter what computer we plug it into, we get asked if we want to format the USB. If we select "NO" we can not open it. And if we select "Yes" re-formatting it will just erase the USB.
    How or who can we contact to get a new USB?? We do not have any existing Labview program to work with until this situation is resolved.....!!!
    Thank you.

    I would recommend that you contact your local sales representative.
    At the top of the page, you will notice two grey boxes:  MyNI & Contact NI
    Click on "Contact NI" and it should provide you with contact info.  Explain your situation and they may be able to get you an installer by FTP or some other rapid means.

  • 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

  • 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 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

  • 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

  • Labview USB

    I’ve been using Labview ver 5 for serial applications using the built in serial VI. with a laptop that has a serial port. I am looking to purchase a new laptop, but the new laptops have a USB port.
    How can I use my existing serial VI applications with the new laptop that has a USB port?
    Can anything be done to Labview 5 so that I may use the existing applications with the USB port?
    Please elaborate on this.
    Thank You

    Yes, you need a USB to serial adapter to do the trick.
    Search for "USB RS232 adapter" with google and choose the one you like most (just make sure that the driver will allow you to see the device as a normal serial port). Find this one as example, but look for a better one because I didn't search too much.
    Good Luck

  • Labview USB with VISA on Mac OS X

    Hi-
    I have a 3rd party USB DAQ device that I'm trying to make work within labview 7.0. I've gone through the device tutorial on creating a driver with Windows2000. With Windows 2000 after using the VISA driver wizard the subvi "visa find resources" finds the DAQ device and I can talk to it
    with a bulk transfer with VISA write.
    With a Mac OS X (10.4), the system profiler sees the DAQ but I the VISA driver wizard won't allow me to check the usb button. The labview subvi "visa find resources" doesn't find the
    DAQ. What equilivent steps do I need to do with OSX so that the find resources vi finds my DAQ?

    Finally fixed the PermGen errors. I can run all day now without crashing. It turns out the eclipse.ini file is very tricky! You have to have carriage returns in the right places. Run the jmap -heap <pid> on the eclipse process id. It will tell you if your PermGen memory is actually setup how you thought it was supposed to be.
    Here's my final eclipse.ini
    -showsplash
    org.eclipse.platform
    --launcher.XXMaxPermSize
    892m
    -vmargs
    -XX:PermSize=128m
    -XX:MaxPermSize=892m
    -Dapple.awt.graphics.UseQuartz=true
    -Xdock:icon=../Resources/Eclipse.icns
    -XstartOnFirstThread
    -Dosgi.requiredJavaVersion=1.5
    -Xms40m
    -Xmx892m

  • 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-6366 sample 2 AI and Encoder Value triggered with X1-Encoder (not with sample clock) - Help needed, please

    Hello World,
    after 10 years of LabVIEW experience I'm totally lost.
    This is my first project with DAQmx and I don't know how to handle it.
    My setup: Windows7; LabVIEW 2012 DevSuite; X-Series USB-6366
    My goal: Trigger the encoder value and 2 Analog Inputs
    I would like to get one result for the encoder value and each of the two analog inputs for each change of the encoder value (not more!!! I don't want to sort a huge amount of data afterwards)
    I've been able to configure it with the Measurement and Automation Explorer, but have no clue how to get this in a LabVIEW configuration.
    All examples I could find are reading the analog Inputs and the Encoder with SampleClock. That's not what I'm looking for.
    I would greatly appreciate if someone could guide me to my solution.
    I've attached the exported confiuration of the Measurement and Automation Explorer.
    Thanks in advance, best regards,
    Balze
    P.S.: Sorry I had to ZIP the *.nce file, because NI doesn't allow to attach *.nce files
    Solved!
    Go to Solution.
    Attachments:
    configData.zip ‏290 KB

    Hi RupiDo, hi Kevin P.
    thank you for your effort and your willingness to help me. I aprreciate it!
    @ RupiDo:
    I'm aware of the DAQmx Timing.vi but where do I find I/O filtering (which context menue?)
    DAQmx is a Monster for me. It's for sure felxible and powerfull but how to configure it is not obvious for me. Also the dependencies are unclear to me. I tried things and get an error at run-time that this or that is not supported, reserved, ....
    Nyquist Shannon doesn't matter very much for my task. I measure DC voltages with litlle changes. But thank you for pointing this out.
    Retriggerable property node?? Where's that? (This maybe not obvious for me, because it's a german LabVIEW I've got to work with)
    @ Kevin P.:
    Yes, it's a quad-encoder with A,B and Z but Z is still unused (and will be unused for now)
    I've got similar problems to setup your solutions.
    When I try to configure "Change Detection" I get error messages, that it's not supported. "allow buffer overwrites"??? I seached for it very thoroughly,but without success.
    I looked at a lot of examples but always found solutions with buffered aquisition. I'm already willing to use buffered aquisition, but I even can't setup this.
    I FEEL SO STUPID Over 10 years LabVIEW experience and the first DAQmx project let's me stumble.
    I tried a buffered aquisition based on an NI example. But it only works for one analog input channel. The other brings up en error (-50103). Which one of the two analog channels brings the error is randomly.
    Maybe someone could explain me, what leads to this error, that I could start understanding DAQmx.
    I've attached the VI (LV2012) and screenshots of the frontpanel and the blockdiagram.
    Thanks in advance, best regards
    Balze
    Attachments:
    Meas Angular Position-Buffered-Cont-CtrClk-1.vi ‏72 KB
    vi_panel.png ‏95 KB
    vi_block.png ‏87 KB

Maybe you are looking for