I2C protocol interfacing Accelerometer MMA7660fc

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

I2C protocol interfacing Accelerometer MMA7660fc

1,690 Views
mdrasool_yadwad
Contributor II

Hello,

 

  I was interfacing the K60 microcontroller with the accelerometer MMA7660FC which is available on the tower board using I2C . I am configuring Microcontroller as master and MMA78451Q accelerometer as slave.

When I am transmitting in master mode the slave address is transmitting correctly by setting interrupt flag in status register but when i transmit register address it is not transmitting it is hanging there only when is check interrupt flag in while loop. I am not getting whats the issue. Please help me out.

Iam using I2C baud of 100k. I am attaching my code please check it once

Thanking You

0 Kudos
Reply
5 Replies

1,392 Views
nxf56274
NXP Employee
NXP Employee

Hi,

Sorry for the late. We have the latest library in our website "https://mcuxpresso.nxp.com/en/select ", you can try it. Please tell me which register you can't write.

Have a great day,
TIC

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,392 Views
mdrasool_yadwad
Contributor II

Hello Da Li,

   Sir actually the problem is when i debug by using break points it is updating but once i run without break point is not working. When i check the status register the interrupt flag is not raising after sending the register address of the slave.

And one more thing when i configure accelerometer by writing to the register 07 to change to the active mode and starts reading the accelerometer it is not giving the output. whether i need any configurations to update.

Thanking You,

Mohammedrasool

0 Kudos
Reply

1,392 Views
nxf56274
NXP Employee
NXP Employee

Hi,

You would be better to try the latest library in our website "https://mcuxpresso.nxp.com/en/select ". And using debugger to debug the communication protocol will influence the timing sequence of i2c. Use logic analyzer or  oscilloscope to watch wave.

Have a great day,

TIC

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,392 Views
mdrasool_yadwad
Contributor II

Hello,

I have taken screenshot let you see this. After giving values for few iterations the master switches to the slave automatically.i2c_error1.PNG

0 Kudos
Reply

1,392 Views
nxf56274
NXP Employee
NXP Employee

Hi,

We no longer support the codewarrior. If the code have some problems, please use the latest library and our free tool MCUXpresso. 

Have a great day,

TIC

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply