Shop OBEX P1 Docs P2 Docs Learn Events
Code for inertial sensor to Parallax USB datalogger with BASIC Stamp 2e — Parallax Forums

Code for inertial sensor to Parallax USB datalogger with BASIC Stamp 2e

calomegacalomega Posts: 4
edited 2009-02-24 03:03 in BASIC Stamp
I am trying to write a code to request data from an Analog Devices inertial sensor (ADIS16350) to be recorded on the Parallax USB datalogger using a BASIC Stamp 2e microcontroller. The sensor is SPI-compatible and I am able to connect all of the appropriate pins but I'm having difficulty mapping out the exact commands. Please let me know if you have any suggestions or links to sample source code that might address this problem.

Here is the datasheet for the inertial sensor:

http://www.analog.com/static/imported-files/data_sheets/ADIS16350_16355.pdf

Thanks!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-24 01:02
    The main thing you'll have to deal with is that the Stamp can't send and receive SPI data at the same time and your inertial sensor is designed to do just that (send and receive simultaneously). For writing, you should be fine and should be able to use a straightforward SHIFTOUT statement. For reading, you'll have to use a SHIFTOUT statement to address the register you want, then use a SHIFTIN to get the data. Unfortunately, the sensor will be expecting another register number to be presented to it while you're reading the data you asked for and you can't do that. You may be able to just send another register number on the next exchange of information.

    I'm not aware of any sample code. You might look at other SPI devices that Parallax sells. For most products, there's always sample code linked from the webstore page for the product. Make sure you read the chapters in the Stamp Basic Manual on the SHIFTOUT and SHIFTIN statements.
  • calomegacalomega Posts: 4
    edited 2009-02-24 03:03
    Okay, thanks for the advice. I will definitely look into the SHIFTIN and SHIFTOUT commands and see if I can get something working.
Sign In or Register to comment.