Jump to content

[CR] MPSSE SPI


Recommended Posts

MPSSE SPI


For a personal project, I needed to communicate between my computer and a SPI device slave device. So, I use a FTDI chip FT232h.

I have adapted the library MPSSE I2C already available on this website to make it works for SPI.

Warning ! VI are not 100% tested (especially Read functions), I provided it as it is.


 

Link to comment
  • 3 months later...

Hi RomainP,

Thank you very much for these drivers. 
I am using them successfully with a FT232H (inside a UM232H module) and MPSSE-SPI running at 30Mbps to get familiar with the MPSSE operation via LabVIEW so I can communicate with PC via SPI slave device as you did.

I have a couple of questions I'm hoping you or someone can help with.

I am currently running a LV loop to write 50kbytes, then read 50kbytes to the SPI, at full speed...and this works... but it is half-duplex.

How would I go about implementing duplex..so I can have read & write simultaneously ? Is there a SPI read-write.vi ? Or could I perhaps write my own ?..if so could you make some suggestions...or is it not possible due to dll limitations ?

Secondly, are there some examples which show how to use the FT232H GPIO pins via LabVIEW whilst using your drivers ?

Regards,

tech1962

Link to comment
  • 1 year later...
  • 2 months later...
  • 1 year later...

Hi,

I am attempting to use your vi.s to communicate to a adafruit BMP388 module via SPI. Thank you BTW! I seem to be getting hung up on reading from the data registers on the BMP388. I'm not sure if I need to implement the SPI write read function to do so. I've implemented it and still see no activity on MISO line? But unsure I'm using the functions properly?I believe I have the configuration data sent properly with SPI write. In theory i just need to read from the registers. It seems I would need to specify somewhere what registers I want read to get the data? Any guidance would be appreciated. Thanks Marty

Link to comment
  • 1 month later...
  • 6 months later...

HI

I downloaded the MPSS SPI. I plug the cable in and that is working fine according the windows device manager. But when I open the labview project and the test.vi I have an broken run arrow. when i look in to the sub vi's I find this error "The library specified for this node cannot be found or cannot be loaded. Right-click the Call Library Function node and select Configure, then choose the correct library name or path"

when I select configure an change the path to the MPSS.DDL included in the download i get "the library selected is not valid for the current platform. For example, you are running 64 bit labview and the library might be a 32 bit library"

I try both the 32 and the 64 bit labview but both the same error. 

Do someone know what is going wrong?

Link to comment
On 3/19/2021 at 2:58 PM, RDUV said:

HI

I downloaded the MPSS SPI. I plug the cable in and that is working fine according the windows device manager. But when I open the labview project and the test.vi I have an broken run arrow. when i look in to the sub vi's I find this error "The library specified for this node cannot be found or cannot be loaded. Right-click the Call Library Function node and select Configure, then choose the correct library name or path"

when I select configure an change the path to the MPSS.DDL included in the download i get "the library selected is not valid for the current platform. For example, you are running 64 bit labview and the library might be a 32 bit library"

I try both the 32 and the 64 bit labview but both the same error. 

Do someone know what is going wrong?

The MPSSE.DLL is only a high level DLL driver that depends on the low level D2XX driver from FTDI. You need to have that installed too, and it needs to be present in a location where the Windows DLL Loader can find it. If you download and install the standard driver from the FTDI site, this should be taken care for you. https://ftdichip.com/drivers/d2xx-drivers/

Link to comment

Thanks for the Reaction.

I did install the D2XX driver. but this morning i reinstalled the D2XX driver as admin (I didn't install it the first time as admin). But noting is changed. 

I'm running labview 2018 64bit on a virtual windows in VM ware. If i look at de device manager i can see the USB Serial Converter under the Universal serial Bus Controllers, and i see the USB serial Port (Com3) under Ports(Com&LTP). When i look at the properties of the com3 or the USB Serial Converter i see the the device  is working properly. in the driver Details is can see that the ftd2xx drivers are installed (see picture 4).

in Labview i have the error showed the 3th picture. when i look at the path of the library I see the picture 2. I redirected the path to the dll in the LabVIEW directory that I downloaded from this forum. but that give me the the error from the 1th picture. Is there something that I miss? do I need to do anything with the dll or do anyone have a idea about whit is going wrong?

 

thanks

redirect.png

labview MPSSE.png

labview error.png

ftdi Drivers.png

Edited by RDUV
Link to comment

Well you installed the 32-bit version of the the DLL (syswow64 is despite its name NOT for 64-bit DLLs but the 32-bit versions of  DLLs on a 64-bit Windows system). Same accounts possibly for the MPSEE.DLL. They all need to be 64-bit in order to be loadable in 64-bit LabVIEW!

 

Best is probably to download the actual MPSEE driver directly from the FTDI site here and use the 64-bit version of the DLL inside under: libMPSSE.zip\libMPSSE__0.6\lib\windows\visualstudio\x64\Release\libMPSEE.dll

Link to comment
  • 10 months later...

I have downloaded, configured and got the MPSEE SPI interface LV SW working for my application, thank you. But I also need a single pulse output on a separate IO line, syncronous to the SPI clk. I am unsure how I could configure to cause (for example) the first clk rising edge of any SPI word to trigger the separate pulse from one of the unused lines e.g. the next line above the CS line, AD4? The pulse is reqd to trigger/sync a piece of external equipment and I have the ability on that equipment to delay from the trig pulse, so the PW of the trig pulse is not really important. The important thing is that the timing wrt to the SPI clk is constant. An help gratefully received.      

Link to comment
6 hours ago, CMT said:

I have downloaded, configured and got the MPSEE SPI interface LV SW working for my application, thank you. But I also need a single pulse output on a separate IO line, syncronous to the SPI clk. I am unsure how I could configure to cause (for example) the first clk rising edge of any SPI word to trigger the separate pulse from one of the unused lines e.g. the next line above the CS line, AD4? The pulse is reqd to trigger/sync a piece of external equipment and I have the ability on that equipment to delay from the trig pulse, so the PW of the trig pulse is not really important. The important thing is that the timing wrt to the SPI clk is constant. An help gratefully received.      

I would not know if this type of low level control is even possible with the MPSSE controller in the chip. That is something you will have to take up with FTDI customer support as that is really very deep down in the belly of MPSSE.

Link to comment

Rolf, thank you for your reply. After scouring the FTDI site and elsewhere I think you are correct that it would not be possible using the MPSSE library/controller. I have instead started using the D2XX LabVIEW vi functions and have been sandboxing the synchronous bit-bang mode on my FTDI board HW. It looks fairly straightforward to make a pseudo SPI interface and include the additional sync pulse I need assigned to the next available OP line. I just cant run at the clk rate intended, but for my proof of concept its fine for me at this time.

Link to comment
  • 1 year later...
1 hour ago, Naoyuki Matsumura said:

Is this LabVIEW library compatible with FT4222H?

Doesn't seem to have an MPSSEngine. Which is not so surprising. The MPSSEngine is a Multi Protocol Synchronous Serial Engine. There is nothing truly multiprotocol about the FT4222H chip, it's simply an I2C/SPI interface chip without support for other GPIO, RS232, and similar interfaces. https://www.ftdichip.com/old2020/Products/ICs/FT4222H.html

You can use it through the FTD2xx driver though. there is also a LibFT4222 DLL which sits atop the FTD2xx driver and implements the FT4222 specific stuff. You would have to create LabVIEW Call Library Node wrappers for this DLL if you want to use this driver.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.