This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

I2C on MSP430F5529 and 9DOF

Other Parts Discussed in Thread: MSP430F5529, ENERGIA

Hello,

I am trying to use 9DOF sensor stick (https://www.sparkfun.com/products/10724) with MSP430F5529 experimenter’s board but it is the first time that I use I2C communication protocol. I tried to find some I2C example code but I didn't found anything that i can be helpful. I would APPRICIATE if someone can send me any I2C example code.

** I would like to know if someone has ever tried to use the 9DOF with msp430 MCU. 

 

  • Hi Roy,

    roy mintz said:
    I would like to know if someone has ever tried to use the 9DOF with msp430 MCU. 

    Is a fairly specific statement - which I can't help you with. I also suspect that most people's code will be owned by their employers and therefore are not able to share it.

    However, the beauty about I2C being a standard is that any example code the for the msp430 should be good for you. With a core library - writes/reads you should be able to follow the datasheets for the various sensors on the 9DOF to get some code for what you need. 

    roy mintz said:
    I tried to find some I2C example code but I didn't found anything that i can be helpful. 

    This is surprising. The example code folder (http://www.ti.com/lsds/ti/microcontroller/16-bit_msp430/tools_software.page#code) for the MSP430F5529 contains I2C code to allow you to set/write and read registers via I2C. Did you try these? Where there problems? I would definitely recommend hooking a scope up to familarise yourself with I2C if its new to you and to check the physical bus - unless this is correct, there is no hope of getting more complex behavior. From there, just add small increments in functionality e.g. can you read the ID from the device (or some other known register)? Does the device ACK on the I2C bus?  

    As a final comment - if you have found any code for the device (from the manufacture) which works it can be helpful to see what commands they were sending/reading and then just build it up in your own msp430 code. 

    Hope this helps, 

  • Check out Energia - http://energia.nu

    It has the "Wire" library which is meant to help you talk over I2C.

  • Hi Roy,

    I am using the same MCU to integrate with another 9 DOF sensor.

  • Hi Tim,

    thanks for your replay. I am using the CCS for the MCU programming, and I had succeeded to program the accelerometer (ADXL345) and it work fine. But, I have some problem with the programming of the magnetometer (HMC5883L) I think that I have problem with my initialization because I can read some data but it seem as wrong information. If you do not mind I would like if you share with me your code for the magnetometer so I can use it as reference for debugging my code.

    Thanks

    Roy

**Attention** This is a public forum