Jump to content


Recommended Posts

Hello, I apologize if my problem is a simple one, I am new to coding msp's and codecoposer. I am trying to use this MMA8452Q triple Axis accelerometer to detect offsets. As in Portrait / landscape detection, and communicate the 8 bit x, y, and z data to me. (i was just gonna use the variables tab in codecomposer for seeing the output).

I wrote this code which I have attached using the MMA8452q datasheet for reference while coding this. When i tried to run the code It came up with errors and i have been trying to debug it for a while. I feel like i am very close, but I can't seem to figure it out.

Can anyone help me?


Link to post
Share on other sites
3 hours ago, BBNOOB said:

When i tried to run the code It came up with errors

To follow up with @Rei Vilo the actual errors are important here, as is the processor (though I would presume G2553 given where you put the question).  Also, the interface module you are trying to use (I2C I would hope, since the MMA8452Q only communicates with I2C), what header files you included, what processor you selected in CCS project setup, and so on.


Link to post
Share on other sites

A quick look at your code reveals:

You have a typo in your port_2 interrupt handler; you call ICC_read, but the implementation is in IIC_read... 

I didn't read further as the above is a show-stopper...

There are numerous tutorials available for both I2C and interrupt handling to you to help get you started.

Since you're using CCS, I'd suggest also  posting your code & question on the TI e2e forum.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...