3-Axis G Sensor MMA7660FC

This forum is for the 3-axis g sensor breakout board that is based on the Freescale MMA7660FC

3-Axis G Sensor MMA7660FC

Postby Kirk » Wed Nov 24, 2010 10:39 am

The 3-axis G sensor breakout board is based on the Freescale MMA7660FC. The MMA7660FC is an I2C Digital Output , very low power, low profile capacitive micro machined accelerometer featuring a low pass filter, compensation for 0g offset and gain errors, and conversion to 6- bit digital values at a user configurable output data rate. The device can be used for sensor data changes, product orientation, and gesture detection through an interrupt pin (INT). The device is housed in an extremely small 3mm x 3mm x 0.9mm DFN package.

IC Features:
* Low Power Current Consumption
o Off Mode: 0.4 µA
o Standby Mode: 2 µA
o Active Mode: Configurable down to 47 µA
* Low Voltage Operation: 2.4 V – 3.6 V
* 3-Axis ±1.5 g MEMS Sensor and CMOS Interface Controller Built Into One Package
* Configurable Output Data Rate From 1 To 120 Samples A Second
* Auto Wake/Sleep Feature for Low Power Consumption
* Tilt Orientation Detection for Portrait/Landscape Capability
* Gesture Detection Including Shake Detection and Pulse Detection
* Robust Design, High Shocks Survivability (10,000 g)

Breakout Board Features:
* 0.1" spaced pins in a 2 row by 4 pin configuration , rows are spaced 0.6"
* Independent power for DVDD and AVDD with 0.1uF bypass capacitors mounted directly below the IC.
* 0805 resistor pads for SDA and SCL pull-up to DVDD, allows flexibility for I2C bus pull-up location. You can use internal pull-ups from your micro-controller, or pull-ups from another location on the I2C bus, or populate the breakout board resistors (two 4.7k Ohm 0805 resistor included with each board)

3axis_front_sm.JPG
Front view of the MMA7660FC 3-axis G sensor breakout board
3axis_front_sm.JPG (39.04 KiB) Viewed 19192 times


3axis_back_sm.JPG
Back view of the MMA7660FC 3-axis G sensor breakout board
3axis_back_sm.JPG (42.61 KiB) Viewed 19192 times
Kirk
Site Admin
 
Posts: 11
Joined: Mon Sep 20, 2010 10:28 pm

Re: 3-Axis G Sensor MMA7660FC

Postby Kirk » Sun Dec 12, 2010 11:10 am

Here is example code that runs the MMA7660 using a PIC16F88 running code compiled with the version of HiTechC that comes with the MPLAB IDE You can download the entire project file here:

Pic_3axis_g_MPLAB_HitechC.rar
MMA7660FC PIC Code project file
(155.83 KiB) Downloaded 2853 times


Since this was my first project using I2C I used the low level drivers so that I could see what happened at every step.

Below is a snippet of the main.c:
OSCCON=0x50; /* Select 2 Mhz internal clock */

int Xbyte; // used for reading the X register
int Ybyte; // used for reading the Y register
int Zbyte; // used for reading the Z register
int Tiltbyte; // used for reading the Tilt register
char in; // used for getting data from the USART

init_comms(); // set up the USART - settings defined in usart.h
INTCON=0; // for the purpose of disabling the interrupts.

// init mma7660 to set device to active state
i2c_Start();// start i2c sequence
i2c_WriteTo(MMA_WR_ADDR );// device address 0x98
i2c_PutByte(0x07); //write to mode reg
i2c_PutByte(0x01); // write mode reg to 00000001
i2c_Stop();// end i2c sequence
//

while (1)
{

// printf("S\r\n");\
__delay_us(20000); // delay for 20 milliseconds

in = getch(); // read serial port

// printf("C\r\n");\

//Xbyte = i2c_GetByte(I2C_MORE); // read from register 0
//Ybyte = i2c_GetByte(I2C_MORE); // read from register 1
//Zbyte = i2c_GetByte(I2C_MORE); // read from register 2
//Tiltbyte = i2c_GetByte(I2C_LAST); // read from register 3

i2c_Start();// start I2C seuence
i2c_WriteTo(MMA_WR_ADDR );// write to mma7660 deivce address, 0x98

i2c_SendByte(0); // start read ing at register 0

i2c_Restart();// restart the i2c sequence
i2c_ReadFrom(MMA_RD_ADDR ); //read form mma7660 read addres 0x99

Xbyte = i2c_GetByte(I2C_MORE); // read from register 0
Ybyte = i2c_GetByte(I2C_MORE); // read from register 1
Zbyte = i2c_GetByte(I2C_MORE); // read from register 2
Tiltbyte = i2c_GetByte(I2C_LAST); // read from register 3
i2c_Stop();// end i2c sequence

//printf("%d,%d,%d,%d\r\n",Xbyte,Ybyte,Zbyte,Tiltbyte); //send reading to serial port

//convert two's compliment to signed int

if (Xbyte>31)
{
Xbyte = Xbyte-64;
}

if (Ybyte>31)
{
Ybyte = Ybyte -64;
}

if (Zbyte>31)
{
Zbyte = Zbyte -64;
}


if (in == 'X')
{
printf("%d\n",Xbyte); //send reading to serial port
}

if (in == 'Y')
{
printf("%d\n",Ybyte); //send reading to serial port
}

if (in == 'Z')// check to see if we should read from mma7660
{
printf("%d\n",Zbyte); //send reading to serial port
}

if (in == 'T')// check to see if we should read from mma7660
{
printf("%d\n",Tiltbyte); //send reading to serial port
}
if (in == 'A')// check to see if we should read from mma7660
{
printf("%d,%d,%d,%d\n",Xbyte,Ybyte,Zbyte,Tiltbyte); //send reading to serial port
}
if (in == 'Q')// check to see if we should read from mma7660
{
printf("MSH\n"); //send reading to serial port
}



}
Kirk
Site Admin
 
Posts: 11
Joined: Mon Sep 20, 2010 10:28 pm

Re: 3-Axis G Sensor MMA7660FC

Postby Kirk » Sun Dec 12, 2010 11:13 am

Here is a Visual basic code example for reading the MMA7660, see screen capture :
3Axis_VB_Demo.jpg
Screen capture of MMA7660 VB demo
3Axis_VB_Demo.jpg (30.14 KiB) Viewed 19159 times



You can download the VB project directory here:
Pic_3Axis_Visual_Basic.rar
Visual Basic demo code for MMA7660
(297.55 KiB) Downloaded 2620 times


See a YouTube video of the demo code in action: http://www.youtube.com/watch?v=eNMnMR6PL80
Kirk
Site Admin
 
Posts: 11
Joined: Mon Sep 20, 2010 10:28 pm


Return to 3-Axis G Sensor MMA7660FC

Who is online

Users browsing this forum: No registered users and 1 guest

cron