(SPI equipped) Sensor Data to PC

Hello, I'm new in this group, and I hope this is the right one to place my question. I am trying to connect a tilt sensor to a pc. The sensor device (Analog Devices' ADIS16201) is accessable via spi. Unfotunately, I'm not very conversant with programming Micros not even with programming serial communication. But since SPI is such a simple protocol I tried it using FTDI's FT2232C. That did not work, or lets say I'm still trying. I read that SPI Slaves can easily be accessed without any kind of extra hardware like FT2232, using serial or parallel port. Is there any piece of software that can talk to a SPI device using one of these ports? thanks for your help.

Reply to
hhausen
Loading thread data ...

SPI is not compatible with the normal "RS-232" serial port protocol.

A SPI interface requires three wires: data, clock, and chip select. The ADIS16201 should detail the signals required.

--
Peter Bennett VE7CEI 
email: peterbb4 (at) interchange.ubc.ca        
GPS and NMEA info and programs: http://vancouver-webpages.com/peter/index.html 
Newsgroup new user info: http://vancouver-webpages.com/nnq
Reply to
Peter Bennett

You can try bit bashing SPI with the parallel port or even twiddling the serial port signals such as RTS/CTS/Ring. Only trouble is PCs these days don't have a parallel port and you are lucky if you get a serial ports. And you'd need level shifters and it would be a bit of a hack.

What would be a much better idea is to use the FT2232C with the DLL and Delphi code downloadable from here

formatting link

Peter

Reply to
Peter

Thanks for your reply. Right now I am working on a solution with the FT2232C. I mentioned that I am not that experienced with programming hardware. I've checked my circuitry more than once. I've checked that the drivers are loaded correctly. The sample code from FTDI's resources site helped me a lot. The sample programmes from ftdi and dlp design work with my circuitry. But the data I get out of the sensor doesn't make sense. I went through all the app notes, programmers guides and I can't figure out whats wrong in my code. Do you have any advice for a hardware newbie?

Reply to
hhausen

You need to learn more about SPI. I'm not sure how it's done at high level like you are doing but the way that SPI works is that it swaps a byte at a time. You transmit a byte and simultaneously you get a byte back.

The first thing I'd do is to put a scope on the clock and datalines to see if anything is being exchanged.

Then I'd have a close look at the sensor datasheet

formatting link
to see what commands are required to read and write to the sensor's registers.

Use SPI_Write and SPI_Read or whatever they are called to send these commands to the sensor and you'll get a response the same size as the number of bytes that you sent out. Most of the commands to this chip are two bytes. You should be able to extract the relevant data from this.

Peter

Reply to
Peter

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.