MMA9553L sample source

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MMA9553L sample source

Jump to solution
1,525 Views
prasannaprabhu7
Contributor III

Hi All,

Curently I am working on STM32L4RCT MCU and on MMA9553L connected to IIC. Is there any sample source code available for the same ?

Regards,

Prasanna

Tags (1)
0 Kudos
1 Solution
943 Views
prasannaprabhu7
Contributor III

The issue is monitored in different thread. Thank you for your info.Marking this question resolved.

https://community.freescale.com/message/621622?et=watches.email.thread#621622

View solution in original post

0 Kudos
7 Replies
943 Views
JackITB
NXP Employee
NXP Employee

Hi Prasanna,

As you also entered a similar thread in the ISF community forum (MMA955L pedometer issue in reading 6axis data), do you still need we provide you more inputs on this one ?

Regards,     Jacques.

0 Kudos
944 Views
prasannaprabhu7
Contributor III

The issue is monitored in different thread. Thank you for your info.Marking this question resolved.

https://community.freescale.com/message/621622?et=watches.email.thread#621622

0 Kudos
943 Views
david_diaz
NXP Employee
NXP Employee

Hello Prasanna,

Unfortunately I do not have sample code for the MMA9553L device.

In this case, you may refer to the MMA9553L Intelligent Pedometer Platform Software Reference Manual.

This reference manual describes the features, architecture, usage examples, and programming model of the MMA9553L intelligent pedometer platform.

Please let me know if this information is useful for you.

If I misunderstood your question, feel free to let me know.  I will be glad to help.

Have a great day.

David Diaz.

Note: If this post answers your question, please click the Correct Answer button. Thank you!

0 Kudos
943 Views
prasannaprabhu7
Contributor III

Thank you David for your quick response. I did send 0x00 0x00 0x00 0x0c to MMA9555L and receiving proper versions from it. But on sending 0x12 0x20 0x06 0x01 0x00 I am not receiving any valid data and instead receiving 0x00 0x80 0x0c 0x0c 0x7a 0xed as responce from it instead of receiving Accelerometer data. Also tried sending

0x04, 0x20, 0x2C, 0x0C, 0x06, 0x18, 0x06, 0x19, 0x06, 0x1A, 0x06, 0x1B, 0x06, 0x1C, 0x06, 0x1D then 0x18, 0x20, 0x00, 0x01, 0x10 and then reading 6 bytes of data,resulted in

0x00 0x80 0x0c 0x0c 0x20 0x2c

    Can you please suggest the commands I am sending is wrong to get accelerometer data? Or is that I should send any other commands to receive valid accelerometer data from MMA9555L chip?

Regards,

Prasanna

0 Kudos
943 Views
david_diaz
NXP Employee
NXP Employee

Hello Prasanna,

I am glad to help.

Please be aware that the device powers up in Sleep mode, but it may become necessary to wake the part. This process uses the following mailboxes:

bytes to send.jpg

Once the device is awake, you may proceed with the pedometer application configuration as follow:

bytes to send 2.jpg

You may read the status registers properly.

Please let me know if this information is useful for you.

Have a great day.

David

0 Kudos
943 Views
prasannaprabhu7
Contributor III

Also for the commands you shared, Post sending

aTxBuffer[0] = 0x15;

  aTxBuffer[1] = 0x20;

  aTxBuffer[2] = 0x00;

  aTxBuffer[3] = 0x10;

  aTxBuffer[4] = 0x00;

  aTxBuffer[5] = 0x10;

  aTxBuffer[6] = 0x00;

  aTxBuffer[7] = 0x10;

  aTxBuffer[8] = 0x00;

  aTxBuffer[9] = 0x00;

  aTxBuffer[10] = 0x00;

  aTxBuffer[11] = 0x00;

  aTxBuffer[12] = 0x00;

  aTxBuffer[13] = 0x00;

  aTxBuffer[14] = 0x00;

  aTxBuffer[15] = 0x00;

  aTxBuffer[16] = 0x00;

  aTxBuffer[17] = 0x06;

  aTxBuffer[18] = 0x00;

  aTxBuffer[19] = 0x10;

  MMA955L_AcclDataTx(aTxBuffer, 20,0x15); //Send 20 bytes command to configure pedometer

//read status reg:

aTxBuffer[0] = 0x15;

  aTxBuffer[1] = 0x30;

  aTxBuffer[2] = 0x00;

  aTxBuffer[3] = 0x0c;

and reading 16 bytes of data response I am receiving is 0x15, 0x30 ,0x0 ,0xc, 0x0 ,0x10,0x0,0x10,0x00,0x00,0x00,0x00,0x80,0xc,0xc,0x7a

Is that valid?  As per data sheet 2 byte should be 0x80 but I am receiving 0x30. Is something wrong in sending ?

Regards,

Prasanna

0 Kudos
943 Views
prasannaprabhu7
Contributor III

Thank you David for your quick response. I did awake the device from sleep. I am in need only to read accelerometer data i.e x,y,z axis values and not speed etc. To achieve the same too should we send     0x15,0x20,0x0,0x10....... etc command??? As per data sheet to read accel data, I need to configure it as

aTxBuffer[0] = 0x1A;

  aTxBuffer[1] = 0x20;

  aTxBuffer[2] = 0x00;

  aTxBuffer[3] = 0x02;

  aTxBuffer[4] = 0x06;

  aTxBuffer[5] = 0x10;

   MMA955L_AcclDataTx(aTxBuffer, 6,0x1A); //Send i2c command to app ID 1A

  aTxBuffer[0] = 0x1A;

  aTxBuffer[1] = 0x10;

  aTxBuffer[2] = 0x00;

  aTxBuffer[3] = 0x02;

  MMA955L_AcclDataTx(aTxBuffer, 4,0x1A);//Send i2c command to app ID 1A

  memset(aRxBuffer, 0x00, sizeof(aRxBuffer));

  MMA955L_AcclDataRx(aRxBuffer, 6,0x1A);

//Read status reg:

aTxBuffer[0] = 0x1A;

  aTxBuffer[1] = 0x30;

  aTxBuffer[2] = 0x00;

  aTxBuffer[3] = 0x02;

  MMA955L_AcclDataTx(aTxBuffer, 4,0x1A);// read request to acclerometer

if(COCO_BIT_Set)

     MMA955L_AcclDataRx(aRxBuffer, 6,0x1A); //Read i2c data from 1A reg

Is this commands enough to read the accelerometer data?

Regards,

Prasanna

0 Kudos