General Category > Discussion - Drivers

FT232H and Serial Port

(1/1)

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

FTDI Community:
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

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

FTDI Community:
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

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

Navigation

[0] Message Index

Go to full version