FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: FT232H and Serial Port  (Read 16070 times)

rajat

  • Newbie
  • *
  • Posts: 3
    • View Profile
FT232H and Serial Port
« on: February 22, 2022, 03:05:13 AM »

I am a newbie to all this.

I am using FT232H as a USB to serial [ SCLK, SDI, SDO] converter.

In Win10 Home, I have used FTD2XX_NET and dotnet 6 framework and managed to talk to USB chip as per C#-example 3 on code examples section on the ftdi website.
I can read the Serial number, description from the USB chip.

However
- this examples does a UART loopback test so set baud rate etc UART related parameters.

I need a sample code which in C# which can set SPI parameters such as clock rate, 16bits/word and the do a block read ot 128 bytes.

Can you point my nose in the right direction.

Thanks in advance
Rajan
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 891
    • View Profile
Re: FT232H and Serial Port
« Reply #1 on: February 22, 2022, 04:27:31 PM »

Hello,

To use I2C/SPI as a master, see AN_135 MPSSE Basics and our existing MPSSE Example projects:
 
https://ftdichip.com/software-examples/mpsse-projects/
 
There are two options to use I2C/SPI modes with the MPSSE engine:
 
a.            Use LibMPSSE libraries. Example code is provided with the download.
b.            Use D2XX drivers direct. Example code is shown at I2C/SPI.
AN_108 Command Processor For MPSSE and MCU Host Bus Emulation Modes provides the necessary information.
 
Option b is the best option to use the D2XX drivers direct (no dependency on libMPSSE library).

Unfortunately in option b above, we only have C++, Delphi and VB examples.
There is a C# example for I2C which you could use for reference.

We do have a C# wrapper which you could use to develop your own software:

https://ftdichip.com/software-examples/code-examples/csharp-examples/

Best Regards,
FTDI Community
Logged

rajat

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: FT232H and Serial Port
« Reply #2 on: June 28, 2022, 02:28:17 AM »

Hello,

 Thanks for the pointers in earlier post. I was able to talk to SPI Slave using libMPSSE and libftd2XX in Linux.

 Seems I am going in the reverse direction and now want to take this to Windows.

 Is there a libMPSSE_NET.dll ?

Thanks
Rajat
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 891
    • View Profile
Re: FT232H and Serial Port
« Reply #3 on: June 28, 2022, 04:52:54 PM »

Hello,

Unfortunately we don't have libMPSSE_NET.dll or C# support for LibMPSSE.

The only option would be to use D2xx drivers direct.
You could take a look at AN_411 FTx232H MPSSE I2C Master Example in C Sharp.
This is for I2C not SPI but it might help you understand what is required.

Best Regards,
FTDI Community
Logged

rajat

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: FT232H and Serial Port
« Reply #4 on: June 29, 2022, 12:01:41 PM »

Hi,

 No worries.
 It managed to get it working using  VisualStudio IDE and a couple of header/library files ftd2xx.h, and libMPSSE_spi.h etc.
 Almost the same code as in Linux executes fine in Windows.

Thanks
Rajat
Logged