Giter VIP home page Giter VIP logo

comspi's Introduction

COMSPI

A hardware developer utility that allows you to control an FT2232H - turned - SPI master through a serial connection. Send binary data, receive a matching number of bytes.

Once set up using FT_PROG, an FTDI chip with one or more Multi-Protocol Synchronous Serial Engine ports can act as an SPI master USB peripheral, which at its core would otherwise involve the use of libMPSSE or its higher-level wrappers, like libMPSSE_SPI.

A particularly convenient way to use COMSPI during the development of SPI slave devices turned out to be defining Sequences in HTerm - with both HTerm and COMSPI connected through a com0com bridge.

For more advanced projects, please consider using devttys0/libmpsse, which is based on libFTDI. See also FTD2XX vs. libFTDI.

Setup

You'll need an FTDI device that features one or more MPSSE ports (FT2232H or similar).

Download / install the the following applications and drivers:

Find your device and read its EEPROM. For a given Port, select

  • Hardware: 245FIFO
  • Driver: D2XX

Subsequently, write back the updated configuration.

It may be necessary to deactivate the VCP driver in devmgmt.msc for a given port that has already been installed and won't go away even when the FT_PROG tool has been used to change the driver mode. I guess that is because The Vendor ID: Product ID of the enumerated USB device is already registered and drivers are loaded.

Use

The following parameters are currently supported:

COMSPI flag mandatory?  default value  description
-COM yes - com0com virtual COM port to connect to
-CHAN yes *) - an available MPSSE channel. Start COMSPI without parameters to get an enumeration.
-ID yes **) - VID:PID identifier (see enumeration), e.g. 0x04036010. You can also modify these values in FT_PROG.
-LOCID yes **) - see -ID, e.g. 0x0821
-MODE 0 one of {0, 1, 2, 3}. See AN178, Mode1 and Mode3 are not fully functional
-CSEL active low (0) one of {0,1}, "0" for Active Low mode
-READ 1 (Byte) number of bytes to be read after a write operation
-CLK 5000 (Bit/s) serial clock speed in bit/sec.
*), **) Note: you must either specify a channel (may vary with number of devices connected) or an -ID 0x... -LOCID 0x... pair. to identify the channel to which to connect.

Example

For use with FT2232H (VID 0x0403 PID 0x6010):

@START comspi.exe -COM 20 -CHAN 1 -MODE 0 -READ 10 -CLK 6000
@START comspi.exe -COM 20 -ID 0x04036010 -LOCID 0x0822

There is also a pair of numbers in the window title expressing | to show info when minimized. To just send out data you may want to set -READ 0.

  • com0com COM20 <-> COM21
  • MISO connected to a signal generator producing a square wave
  • "hey, SPI!" -> 9 bytes read back

Links

comspi's People

Contributors

misterhw avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.