element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Sudden Impact Wearables Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Sudden Impact Wearables Design Challenge
  • More
  • Cancel
Sudden Impact Wearables Design Challenge
Blog [real_time_monitor] Real Time Player Monitoring System Post#5 : Interfacing ADXL375 with CC3200 Launchpad
  • Blog
  • Forum
  • Documents
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ravi_butani
  • Date Created: 15 Feb 2015 4:43 PM Date Created
  • Views 90 views
  • Likes 1 like
  • Comments 0 comments
  • analog_devices_inc
  • tektronix
  • sudden_impact
  • real_time_monitor
  • cc3200_launchpad
  • adxl375
  • electrolube
Related
Recommended

[real_time_monitor] Real Time Player Monitoring System Post#5 : Interfacing ADXL375 with CC3200 Launchpad

ravi_butani
ravi_butani
15 Feb 2015

<< Previous Post

Table of Contents

Next Post >>

 

In my Previous Post , I have discussed Interfacing TMP006 contact less temperature sensor with CC3200 Launch Pad.... In this week I have received all Kits from ADI as part of this design challenge...

 

Today, I am sharing interfacing of ADXL375 +-200g Accelerometer with CC3200 LaunchPad, Using the same code you can Interface ADXL375 with Arduino or MSP430.... etc using Arduino or Energia or any uc Supporting Arduino like Library.

 



Test Setup....




Here is energia code for ADXL375 interfacing with CC3200 LaunchPad...

 

// ADXL375 Interfacing with CC3200 LaunchPad....


#include <Wire.h>


#define DEVICE (0x53) // Device address of ADXL375
byte _buff[6];


char POWER_CTL = 0x2D; //Power Control Register
char DATA_FORMAT = 0x31;
char DATAX0 = 0x32; //X-Axis Data 0 & following 5 bytes for X Y Z axis




void setup()
{
  Wire.begin();        // join i2c bus (address optional for master)
  Serial.begin(9600);  // start serial for output. Make sure you set your Serial Monitor to the same!
  Serial.print("Started");

  writeTo(DATA_FORMAT, 0x01);
  //Put the ADXL375 into Measurement Mode by writing 0x08 to the POWER_CTL register.
  writeTo(POWER_CTL, 0x08);
}


void loop()
{
  readAccel(); // read the x/y/z tilt
  delay(50); // only read every 0,5 seconds

}


void readAccel() {
  uint8_t howManyBytesToRead = 6;
  readFrom( DATAX0, howManyBytesToRead, _buff); //read the acceleration data from the ADXL375


  // LSB First
  // in cc3200 int is for 32 bit signed and short int is 16 bit signed
  short int x = (((short int)_buff[1]) << 8) | _buff[0];  
  short int y = (((short int)_buff[3]) << 8) | _buff[2];
  short int z = (((short int)_buff[5]) << 8) | _buff[4];
  Serial.print("x: ");
  Serial.print( x );
  Serial.print(" y: ");
  Serial.print( y );
  Serial.print(" z: ");
  Serial.println( z );
  }


void writeTo(byte address, byte val) {
  Wire.beginTransmission(DEVICE); // start transmission to device
  Wire.write(address);            // send register address
  Wire.write(val);                // send value to write
  Wire.endTransmission();        // end transmission
}


// Reads num bytes starting from address register on device in to _buff array
void readFrom(byte address, int num, byte _buff[]) {
  Wire.beginTransmission(DEVICE); // start transmission to device
  Wire.write(address);            // sends address to read from
  Wire.endTransmission();        // end transmission


  Wire.beginTransmission(DEVICE); // start transmission to device
  Wire.requestFrom(DEVICE, num);    // request 6 bytes from device


  int i = 0;
  while(Wire.available())        // device may send less than requested (abnormal)
  {
    _buff[i] = Wire.read();    // receive a byte
    i++;
  }
  Wire.endTransmission();        // end transmission
}

 

Interfacing Schematic...


EVAL-ADXL375Z Breakout Board Pin-out..

Demo Video...

You don't have permission to edit metadata of this video.
Edit media
x
Upload Preview


References :

http://www.analog.com/media/en/technical-documentation/user-guides/EVAL-ADXL375_User_Guide.pdf

http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL375.PDF

http://energia.nu/wordpress/wp-content/uploads/2014/09/cc3200lppinmap.jpg

Anonymous
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube