[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4758: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4759: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4760: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
Hacker.instanet.net • View topic - MMA7455L Accelerometer

MMA7455L Accelerometer

Anything Arduino

MMA7455L Accelerometer

Postby Tim Laren » Thu Dec 08, 2011 7:02 pm

Image
Tim Laren
Site Admin
 
Posts: 137
Joined: Thu Mar 04, 2010 8:25 pm

Re: MMA7455L Accelerometer

Postby Tim Laren » Thu Dec 08, 2011 7:28 pm

This is the board
MMA7455.JPG
MMA7455.JPG (9.66 KiB) Viewed 11979 times


The pins are as follows for SPI:
CS -- CS
SDO -- MISO
SDA -- MOSI
SCL -- CLK
GND -- GND
VCC -- 5V

For I2C, the pins are as labled on the board.

The board has a voltage regulator and level translators, as the chip uses 3.3V power and logic and the Arduino has 5V Logic signals.

I am currently out of stock but will have some in within a few days and should be able to demonstrate the unit at the Chino Hills Swap this month.
Image
Tim Laren
Site Admin
 
Posts: 137
Joined: Thu Mar 04, 2010 8:25 pm

Re: MMA7455L Accelerometer

Postby Steve_C » Fri Dec 09, 2011 8:13 am

Good info.
However the Arduino code is not what I use.
I have a Arduino Pro board but I program in just C.
The Arduino environment with the sketches is not standard and I want my code to be portable.
I had hoped you would have the datasheet that came with the unit.
If not then I will have to write a lot of routines and hope the datasheet for the chip will be enough.

Thanks for posting what you have.

Steve
Steve_C
 
Posts: 6
Joined: Fri Dec 09, 2011 8:09 am

Re: MMA7455L Accelerometer

Postby tmdrake » Fri Dec 09, 2011 12:14 pm

I'm gonna try that code out...hehe.

I have a little project to complete.

BTW i may need more protoboards...
-Dennis (TM_Drake)
http://www.tmdake.com
tmdrake
 
Posts: 25
Joined: Sat Nov 26, 2011 9:54 pm
Location: Rancho Palos Verdes

Re: MMA7455L Accelerometer

Postby Tim Laren » Fri Dec 09, 2011 12:53 pm

You need your own print.

pinMode(CS, OUTPUT);
Change to setting the DDR for that port, I'm sure there is a macro with your Atmel library.

digitalWrite(CS, HIGH);
Change to SBI/CBI.

If you have already wrote a SPI driver, then just call that instead of the SPI routines in the example.
It's not that hard, the SPI interface requires almost nothing to operate.
If you get into the other options of the chip then you get a little more complicated.

This is a link to the spec sheet for the MMA7455 chip.

The board has no logic, just a voltage regulator and level translators so following the SPI or I2C programming instructions in the spec sheet is all there is to do.

Tim
Image
Tim Laren
Site Admin
 
Posts: 137
Joined: Thu Mar 04, 2010 8:25 pm

Re: MMA7455L Accelerometer

Postby tmdrake » Sun Dec 11, 2011 2:11 am

Click...that was easy..coded worked!.

I used protection diodes in the IO not sure if it was needed (1n4148 high speed)...
-Dennis (TM_Drake)
http://www.tmdake.com
tmdrake
 
Posts: 25
Joined: Sat Nov 26, 2011 9:54 pm
Location: Rancho Palos Verdes

Re: MMA7455L Accelerometer

Postby Steve_C » Sun Dec 11, 2011 2:19 am

FYI
I am not using the SPI interface
I am using the TWI interface

I have successfully transmitted 0x06 then initiated a read but got back 00000000
So either the chip is not reading or I missed a setup or bit setting for it somewhere.
I will post working code when I get a reading. The code is 3 files. 2 Header files and the main source.
I used code from ATMEL's site. AVR155 is the source I borrowed from if anyone is interested.
I made a lot of modifications and I have written 2 new functions. There will be a few more once I get the readings to come up other than 00000000.

Steve
Steve_C
 
Posts: 6
Joined: Fri Dec 09, 2011 8:09 am

Re: MMA7455L Accelerometer

Postby Steve_C » Sun Dec 11, 2011 4:08 am

I have solved my issue with returned 00000000.
I am now reading from the X 8 bit value register for the x axis.
Now I just have to create an interface to send the data to an LCD.
Once I am finished I will publish my results.

Steve
Steve_C
 
Posts: 6
Joined: Fri Dec 09, 2011 8:09 am


Return to Arduino

Who is online

Users browsing this forum: No registered users and 1 guest

cron