LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FTDIchip FT2232 MPSSE

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 successful, 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 long for example,

I can see these levels on the scope.

 

Does anybody know, if there is something missing in the configuration?

 

Regards,

Markus

 

 

 

0 Kudos
Message 21 of 31
(6,250 Views)

Hello,

 

You may need an SPI Start? 

 

I tried to look up the SPI documentation on FTDI website, but I could only find the D2xx driver programmer's manual, which does not have the API calls you mentioned.  Also, the only SPI examples they have are in Delphi or VB6, which I can't look at.  I did not find the predefined VIs you mentionned, only those for RS232.  So, my best guess is that you need to call an SPI start, or that you need to set the clock after the SPI init.  You should probably contact their technical support if this does not solve the issue.

 

I also want to mention that NI has a similar USB-SPI solution which works natively in LabVIEW.  

 

Have a great weekend.

O. Proulx
National Instruments
www.ni.com/support
0 Kudos
Message 22 of 31
(6,232 Views)

Hello,

 

there is a programmers guide called "FTCSPI Programmers Guide" available on the FDTI Webpage

 

(http://www.ftdichip.com/Documents/ProgramGuides.htm).

 

I am using the DLLs "FTCSPI.dll" for the Calls from the Labview VI and the "ftd2xx.dll".  In the FTCSPI.dll there is no Sub_function called SPI_Start!

 

I get in contact with the FDTI Support, but they couldn't really solve the problem.

 

I would expect that there is a documentation available, whith an explanation, in which order I have to execute all the SPI commands!

 

Does anybody have an idea?

 

Regards,

Markus

 

 

 

 

0 Kudos
Message 23 of 31
(6,206 Views)

Hello Markus,

 

It does not seem like you have to set the clock, since there is an input for clock divisor in the Open function.  Did you try: Open, Init, Write?

 

It may also be worth trying:  Open, Init, Enable Loopback, write, read.

 

Are you checking for errors at all?  There are many error codes and it may help to check if you are getting one of them.

 

Have a great week.

O. Proulx
National Instruments
www.ni.com/support
0 Kudos
Message 24 of 31
(6,189 Views)

I'm trying to revive this topic since there's plenty time from the last reply here.

 

I suppose to make a interface with Labview with a 2232 chip from FTDI. Unfornately FTDI doesn't provide with a documentation with which functions do we really need to make the project work.

 

I wanto to use SPI transmission for my purpose there's two DLL's for that  D2XX dll and SPI dll.

 

Do someone which functions do I really need to implement to make this transmission?

 

Below there's some link from FTDI.

 

SPI example on labview

 

http://www.ftdichip.com/Support/SoftwareExamples/MPSSE/FTCSPI/LabVIEW/SPI_Example_7.0.zip

 

D2XX dll example

 

http://www.ftdichip.com/Support/SoftwareExamples/CodeExamples/LabVIEW.htm

 

 

0 Kudos
Message 25 of 31
(5,501 Views)

Hi Leonardo,

 

I think you just have to read and learn how to do it. You're going to have to understand how SPI works, how the various commands work and how the FTDI chip works. The LabVIEW driver that FTDI provides seems to work well enough so you should have all you need.

 

Phil

0 Kudos
Message 26 of 31
(5,469 Views)

Hi therealkilkenny thanks for the post.

 

 

I know how SPI transmission ocourrs, I know MOSI, MISO CHIP SELECT and the requirements of it, I don't know how to do this using the FTDI CHIP 2232D on labview.

 

FTDI provides us with two DLL's SPIdll  and D2xxdll  I know that I can configure the SPI requirements on SPIdll but   I don't know if I have to use the D2XX dll.

 

Because on the FTDI site they say to implement SPI transmission first I have to habilitate the MPSSE and other stuff,  my doubt is if the SPIdll have all the functions necessary to make the transmission work or do I need to use the D2XX dll too.

 

 Was I more clear?  Thanks again.

0 Kudos
Message 27 of 31
(5,474 Views)

Hi,

 

I understand better now. Unfortunately i don't have LV on this PC so i can't check, but reading the FTDI website it seems that you just need this: http://www.ftdichip.com/Support/SoftwareExamples/MPSSE/FTCSPI.htm. Have you tried it? Do you get any signals in/out? Sorry i can't be of more help.

 

PHil

0 Kudos
Message 28 of 31
(5,461 Views)

I'm also having this problem: all the reads are FF. I'm trying to make this example work with  MatLab. I did everything as the project documentation and schematic says and it works fine with Delphi source code and executable.Can someone help me?

My vi is attached bellow.

 

Thanks in advance,

Jair

Student at University of São Paulo

0 Kudos
Message 29 of 31
(4,954 Views)

for those who are looking for the driver I2C libMPSSE.dll

follow this link:

https://lavag.org/files/file/282-mpssedll-labview-driver/

0 Kudos
Message 30 of 31
(2,602 Views)