Jump to content
Tuts 4 You

Basic hardware question


Recommended Posts

Wanted to ask a question before I wasted 20 bucks trying it myself on a fun project.


I have some SPI sensors I want to get info from. A friend gave me a linux eval board w/SPI sensor soldered to the eval board, and I could see the SPI device in /dev, open it up and get any info I needed from the resigters on the SPI sensor.


I'd like to know if I can take a device like this - http://www.ftdichip.com/Products/ICs/FT220X.html


Plug the SPI sensor into the USB stick, then plug the USB stick into a Rasberry PI or other device that accepts USB...


And using the free USB drivers, open a Windows COM port or linux open() function & talk directly with the registers on the SPI device like I did on the eval board, but through USB and not directly through SPI.



Link to comment

Are you talking about a usb to serial (RS232) converter? If you can use Prolific’s PL-2303 drivers, you can pick up a really cheap nokia phone cable.  This has a usb to serial converter chip built in and very cheap.  Shipping may cost more than the cable.   You would then just wire on a connector to the cable that can connect easily to the SPI interface.  

I've used that chip to painfully flash bricked BIOS' through the SPI interface over USB.  Took a little tweaking to get the drivers, chip ids, ports and data rates setup.  JFYI if drivers are issue and have LPT port, you can fabricate a cable using the LPT port for the connection.



edit late add on
Found a site from my bookmarks.  http://www.nslu2-linux.org/wiki/HowTo/AddASerialPort
I've used a MAX232 based chip to connect to a SPI header over USB also. 

Edited by redblkjck
  • Like 1
Link to comment

hey jack man thanks for the help. I'm no hardware engineer so forgive my trouble explaining myself.


i'm looking for a way to be able to use various devices w/out having to solder or use bread boards. for example, the way I do it now is like for the tc77 spi thermal sensor, first I have to bring it to my friend who solders, then he has to solder it to a board, make the connector from the board, then wires it directly to some pins on the boards w/linux. so i can't put it on a windows desktop either. sometimes probs come up and it takes weeks.


what i search is a generic way, that say I want to mess with a temp spi sensor, or a gps spi chip or any spi chip, I can just plug it into the spi connector then plug the USB in, and same net result as before but no need for soldering, reading electronic diagrams, flashing mcu's, writing usb drivers, etc, Just plug spi chip into the cable and plug the USB in and read the registers and could then go on to make a driver for any spi device connected. so yes I think what I need is like what you linked and I will try to build that even though i solder like a monkey. i think your 1st link is a diy version of the ft220x though right?

Link to comment

I'm no expert either, just learned enough so I could unbrick some hardware.  So the thermal sensor is sitting on it's own bread board with pins for a 4 pin spi interface?  Then yeah you just need to create a com port to connect to the spi header.   LPT ports can be used instead of a USB emulator but you need to wire up external power source and terminate the pins with small resistors.  Kind of an ugly job because the cables are so thin to solder.  The USB cables with the RS232 emulators can provide a 3V or 5V power source to the SPI connector if needed.  Where I had issues connecting with USB com port, much of the software wasn't supporting different chip id's.  So the application wouldn't know how to talk to the device.


If the device doesn't have a SPI header then you are reading the diagrams looking for test points to solder to.  This is really no fun at all.  What I was looking at doing was very specific for the type of chip.  There are some test point connectors you can get that 'slip' over top a microchip and clip on it so to speak by tension.  This allows you to make a connection direct spi connection to the microchip and no soldering.  You just slide the wires on the pins you need to connect to.  You can check out a site called Grains BIOS Repair.  He has some hard to find parts from time to time, without running into purchase limits of big companies.  Ships internationally, ordered a few items from there without ever a problem.


Like I said, my experience was just enough to get something working.  I am sure there are AVR programmers here that can probably answer with better info.  Cheers  - jack

Link to comment

dunno bro u don't sound like a beginner to me.


hopefully clearer example here.. if i want to attach a uart gps chip to my desktop computer, i think many mobos will have uart so I can get it soldered directly to the mobo, but not good for shaky hands and I don't think a clip solution will work for me


instead, can i take that same uart gps chip and plug it into a ft230x aka "usb - uart breakout dev board" and then use the "virtual com" driver to directly access any registers of whatever uart device is in there via USB from a host? it's the same thing as my previous spi example but instead of spi it's uart and the spi didn't have a good picture but nearly the same. so like this - http://www.futureelectronics.com/en/technologies/development-tools/development-tool-hardware/Pages/4018884-UMFT230XB-01.aspx?IM=0 all i would do is plug uart gps (http://www.maestro-wireless.com/a2100) into ft230x uart connector then plug ft230x into computer via usb? now i have a usb gps w/out soldering right?


But the ft230x says it does iic to usb also. does that mean i can plug any iic device to it, and use the virtual com driver to access the registers of the iic device?


again thank u jack. have asked this to several hardware manufacturers w/no luck, they say no one does this because it's 10x more expensive than wiring directly to host but it's for fun!

Edited by simple
Link to comment

Yeah the slip on is more for systems without any spi interface to plug into.  It's best for connecting just when needed to get the job done.


If you are soldering a circuit to the pc, you would need to have power and ground at the bare minimum.  In order to communicate with anything, you would need two data pins for receive and transmit.  That there is enough to open a basic connection to the device through a terminal client on 4 pins (pwr, gnd, tx, rcv).  If you want to communicate directly from the same PC it's connected to, it would probably be best to connect directly to a comm port on the board, soldering or use of header pins.  No external cable needed, power and data are provided. This would be similar to installing a mod chip.


A USB connection, provided the chip supports communicating on USB protocol you could wire directly to a USB header on the board.  Several boards have available USB headers that may connect to the front panel of the PC.  Drivers could become an issue. USB uses the same basic connection, power, gnd, tx, rcv. One thing to be concerned about is the power.  If the device is getting it's power from the USB connection, it shares 500mA with all other devices on the same port.  Also stand-by voltages might be an issue if power is active when shut down or stand-by.  I've hot wired a usb based web cam this way and works fine.


The data cable that I mention is a converter/emulator so to speak.  This provides a USB device id that creates a comm port for the OS that can communicate over the two data pins, tx and rcv. Once configured you can use a comm port over a terminal connection and communicate with what ever is physically connected to the two data pins.  The transfer speed is much slower and needs to be a clean connection.  Any 'noise' or cross talk will degrade the signal and speed badly.  Remember dial up modems... The data cable can also provide 5V or 3V (depending on the chip) and the ground.  Like for flashing a bricked BIOS, the BIOS chip needs to have a steady power supply coming from the USB cable to power the chip so data transfer can happen over the two data pins.


So IMO how you supply power/gnd will determine which way is best to communicate with the circuit over the 2 data pins.  You could fabricate a cable as needed.  


Maybe you would find the Microduino project more of interest.  These have their own programmable firmware running and can be connected via a micro usb cable.  Suport for gps, lan, led, rtc, controls, etc...  Compact and stackable modules.


- jack
edit that link may give you a 404. if it does, try copy paste into browser or search for Microduino and the link will pop up. dunno why.

Edited by redblkjck
Link to comment

Thank u jack that answers it, I just need to connect the 2 data pins from whatever device to the tutorial link for the cable and all is good. Hopefully I can get pwr from the cable to the chip w/out probs but I think I'll need a solder iron haha


I checked out the arduino link but those boards are a bit expensive compared to other stuff like rasberry pi, etc


thx again jack appreciate all the help

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...