EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

(SPI equipped) Sensor Data to PC

Started by hhausen July 12, 2006
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.

On 12 Jul 2006 08:29:21 -0700, "hhausen"
<external.hanno.muhle@de.bosch.com> wrote:

>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.
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
"hhausen" <external.hanno.muhle@de.bosch.com> wrote in message 
news:1152718161.834481.279770@s13g2000cwa.googlegroups.com...
> 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. >
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 http://www.ftdichip.com/Projects/MPSSE.htm#SPI Peter
Peter wrote:
>... > What would be a much better idea is to use the FT2232C with the DLL and > Delphi code downloadable from here > http://www.ftdichip.com/Projects/MPSSE.htm#SPI > > 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?
"hhausen" <external.hanno.muhle@de.bosch.com> wrote in message 
news:1152791036.328719.111370@s13g2000cwa.googlegroups.com...
> Peter wrote: >>... >> What would be a much better idea is to use the FT2232C with the DLL and >> Delphi code downloadable from here >> http://www.ftdichip.com/Projects/MPSSE.htm#SPI >> >> 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? >
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 http://www.analog.com/UploadedFiles/Data_Sheets/169285229ADIS16201_a.pdf 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

The 2024 Embedded Online Conference