BBNOOB 0 Posted April 16, 2020 Share Posted April 16, 2020 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? MMA8452q_Accelerator_Project.c Quote Link to post Share on other sites
Rei Vilo 695 Posted April 16, 2020 Share Posted April 16, 2020 Please have a look at Information to Provide When Asking for Help I²C Check-List I guess you're using the MMA8452 on I²C. bluehash 1 Quote Link to post Share on other sites
enl 227 Posted April 16, 2020 Share Posted April 16, 2020 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. bluehash 1 Quote Link to post Share on other sites
NurseBob 111 Posted April 17, 2020 Share Posted April 17, 2020 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. Quote Link to post Share on other sites
BBNOOB 0 Posted April 17, 2020 Author Share Posted April 17, 2020 Many thanks! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.