LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FTDIchip FT2232 MPSSE

Hi Adnane,

I'm happy to help, but 

               "I've succeeded to write data over synchronous mode with labview interface.

                I'm trying to use the MPSSE mode to communicate with SPI, but I don't understand the commands I have to send before sending data."

doesn't tell me very much!! Smiley Wink

If you post the code that you have written so far and explain what you are trying to do in a bit more detail then i can help (perhaps spot a problem in your code). I need more information.

Best regards,

Phil

0 Kudos
Message 11 of 31
(5,725 Views)
 
Hi phil,
 
Thanks for your patience. I developped no programme, I just used the labview interface I've downloaded from ftdi site.
you can see it below. I try to work in the MPSSE mode to communicate with SPI, but as you can see in the picture, i read FA in the buffer which is an error reply.
if you had worked with labview for your application, i think you can help me. if not thanks anyway. (if you have any questions feel free.)
 
adnane.
 
0 Kudos
Message 12 of 31
(5,709 Views)
Hello,

There are things I would suggest before we move further. 

1.  Did you install the D2xx driver?  According to the FTDI site, you need this driver to use the LabVIEW example.
2.  Which example are you trying to run?  They have two examples posted on their website.
3.  Are you sure your connections are all correct? 
4.  Can you post your screenshot again?

Also, on a seperate note, National Instrument has the NI-USB-8451 which enables communication from LabVIEW from USB to SPI and I2C.  This seems to be exactly what you want to do.  This may be something to look into in the future.

Have a great day.
O. Proulx
National Instruments
www.ni.com/support
0 Kudos
Message 13 of 31
(5,690 Views)
Do you have your app handy. I'm trying to figure out the magical incantation of function calls in order to read an SPI temperature sensor. Right now I call the following in this order...

FT_OpenDeviceByIndex - returns 0 and a handle
SPI_Read - returns 1, which is a failure for an "invalid handle"

I assume that I need to do some other setup, but I have not figured out what yet. A nice little howto included with the drivers would have been helpful.

Anyway, if you have your app handy, it would be much appreciated.

Thanks,



--

Brian Rose
0 Kudos
Message 14 of 31
(5,566 Views)

Hi brian,

before SPI_Read, you have to call SPI_InitDevice, this function enables the MPSSE mode required to communicate with SPI bus.

so it goes:

SPI_GetDeviceNameLocID - SPI_OpenEx - SPI_InitDevice - SPI_Read - SPI_Close

you can find help at http://www.ftdichip.com/Projects/MPSSE/FTCSPI.htm , there is some code examples.

can you tell us wich software you're using? maybe I can help you more then.

Adnane.

 

0 Kudos
Message 15 of 31
(5,554 Views)
I created an application by lifting the FTDI DLL interfaces into my application directly.

I get a "Pointer to write control buffer is null", Status 35 error back from the read.

The input buffer was a constant array, so I changed that to a control. I also checked to see that the buffer parameter was being passed as an array pointer, but I still get the error. I have a feeling this is a Labview thing and not a FTDI thing. But I am unfamiliar with interfacing with DLLs in this fasion.

Attached is my code.

--

Brian Rose
0 Kudos
Message 16 of 31
(5,544 Views)
Fixed. It turns out the WriteCotrolBuffer did not have anything in it, which caused it to have a null pointer (I guess). So I initialized the first byte and now it is completing the read. The problem is, the chip does not appear to be responding, because notice that all the reads are FF. It could be the chip select in the wrong place or the DI / DO lines reversed.

A question I have is why is there a minimum of 2 bits for the control stuff. I have a device that simply starts putting data on the wire when the CS is low and the clock is running. Is the writing of the control bits going to impact this?





--

Brian Rose
0 Kudos
Message 17 of 31
(5,529 Views)

Hi Brian,

I've tried to investigate your question: "A question I have is why is there a minimum of 2 bits for the control stuff. I have a device that simply starts putting data on the wire when the CS is low and the clock is running. Is the writing of the control bits going to impact this?"  I don't have access to the dll code, so I can't really look into it further.  It sounds like a setup feature in the dll itself though.

You might want to direct your question to the FTDI Support in order to get the answer you want.

Regards,
Kevin Stuart
Applications Engineer
National Instruments

0 Kudos
Message 18 of 31
(5,466 Views)
The response from FTDI is...

The solution would be to use the MPSSE engine directly.

This would allow you to simply start clocking data.

http://www.ftdichip.com/Documents/AppNotes/AN2232C-01_MPSSE_Cmnd.pdf

The dll source code is attached if you want to blend your command into that.


--

Brian Rose
0 Kudos
Message 19 of 31
(5,452 Views)

Hi Brian,

I can try to help you with the LabVIEW side of your project, but the specifics in communicating with the MPSSE processor on the FT2232 is a little bit out of my league.  Perhaps someone who has read your posting can give you some more details on how to do this successfully.

Kevin S.
Applications Engineer
National Instruments

0 Kudos
Message 20 of 31
(5,434 Views)