I have a chip that uses SPI for communication and would like to connect it directly to the USB port on my computer. Does anyone have experience with using a USB to SPI converter? How would I design a circuit to convert USB to SPI? http://www.robotshop.com/devantec-usb-i2c-spi-serial-interface.html
5 Answers
If you just want to do some experiments, then take a look at the Bus Pirate, it speaks tons of serial protocols at one end and USB on the other.
-
1\$\begingroup\$ I found the BusPirate too slow and buggy to be a useful SPI converter, even in binary mode. I moved on to programming a TI launchpad with the logic to control the device and sending out the results via serial. \$\endgroup\$– AndreKRCommented Feb 11, 2011 at 23:58
Some of the FTDI USB chips have a MPSSE (multi protocol sync serial engine) mode, which allows all sorts of serial protocols, including SPI, to be implemented very easily (and at high speeds to 30mbit/sec if necessary with FT2232H).
I've used Total Phase Aardvark USB/I2C/SPI interfaces in my professional career. They're fairly cheap and work great.
-
2\$\begingroup\$ $250 is cheap?! totalphase.com/products/aardvark_i2cspi \$\endgroup\$– JYeltonCommented Sep 22, 2012 at 6:13
-
\$\begingroup\$ "Fairly" cheap, when compared to other pro-grade test equipment (considering it also does I2C and has GPIO capabilities). It's a tad pricey for an occasional hobbyist. \$\endgroup\$ Commented Sep 22, 2012 at 18:09
I draw a schematic and posted example code to run a chain of '595s off of a humble FTDI cable: How can I control 128 (or more) solenoids?
'595 are essentially SPI. The code bacomes a bit more complicated if you need to read data as well as write it. But it is still not bad.
The first unit is the neatest solution, and uses a PIC with USB, SPI and I2C interfaces. It also offers async serial. It also has a bootloader so you can update the code easily, or add your own code.