View Single Post
  #2   Spotlight this post!  
Unread 24-04-2010, 20:27
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: please help in adxl345

Quote:
Originally Posted by matrix_manshy View Post
hi am a new user to adxl345 accelerometer and i use it in graduation project to give output displacement i am really cant know a lot of things about it
first i use spi interface so i use only 4 pins cs ,sdio,sdo,sclk,i think 4 wire
Here are the datasheets for the PIC18F448 [link] and ADXL345 [link]

Quote:
Originally Posted by matrix_manshy View Post
second i want to know if the registers in the accelerometer is default configured that i can use to connect it directly to pic as i use 18f448 and make operation in pic
The register defaults are in the accelerometer datasheet, but by default they're set to for 4-wire SPI, so you would connect _CS to _SS, SDI to SDO, SDO to SDI, and SCL to SCK. Just make sure that when you're configuring the SPI on the PIC, you select a clock divider such that the SPI clock isn't faster than 5 MHz and that the clock polarity and phase are set properly.

Quote:
Originally Posted by matrix_manshy View Post
third the operation in pic is to convert the digital bits to corresponding current and then double integration
am i right?
You don't need to convert to current; in the datasheet, the scales are listed as mg/LSB (milli-standard gravities per LSB), so just multiply the reading from the accelerometer by that scale, then divide by 1000 to get the number of gs of acceleration the accelerometer is measuring. You are correct that to get displacement you would then doubly integrate the sensor reading. Maybe use one of the PICs timers to compute delta time. Of course, integrating over large ranges of time will lead to large errors as noise accumulates.

Quote:
Originally Posted by matrix_manshy View Post
please help me if you have any codes can help me in either configuring the accelerometer or in other operations

finally i am very sorry to disturb you all but really i am new in using this and i am really in great problem due to time limited !!!!!plz help me
I wasn't able to find any PIC code for the ADXL345, but there is a listing for the Arduino here that might at least provide an outline of the command/response. You might also try asking on the SparkFun forums, there appear to be a few people using the ADXL345, whereas this forum is pretty specialized toward the hardware that the FIRST Robotics Competition includes with their kits of parts, which so far have been almost exclusively interfaced through analog or parallel digital interfaces.

Good luck,
--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote