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.

Msp430 Launchpad I2C to HMC5883L Magnetometer

Other Parts Discussed in Thread: MSP430G2553

Hi,

On reply to several questions about the simplest MSP430 like the G2231 communicating with the HMC5883L , creating an easy to use magnetic sensor, here is the c code for the Code Composer 5:

The ASPD9.zip contains the code and a photo of the device connections

Good luck

A. Ofek

 

ASPD9.zip
  • Hi, I'm not using your code. BUt I'm using the HMC and a msp430g2553.

    Did you find troubles returning to a specific register address after a reading?

    My problem is that i can only point to a HMC register only once, and it returns correct values, but the next try to point to another address register, it returns 0.

    For example if I try to read the id of regs 10,11,12, I do a write with no data to reg 10
    it returns 0x48,0x34,0x33, that's ok, =H43, but if I try to re-read that register or any other it returns 0, doing the same procedure, attempting a write to that address.

    Or if I try to read all registers, the first read it's ok, but the next addressing, when reading returns 0's

    Here I tried to read twice all registers 0-12 with te autoincrement pointer register of the HMC.
    10 20 03 FF 86 FE BE FE 05 FF 86 FE BE 00 00 00 00 00 00 00 00 00 00 00

    I've also noticed that once reading the reg 0x03 it returns FF 86 FE BE FE 05 but the same values are returned from registers 10,11,12

    If I want to read the Id registers, 10,11,12 Ivé to attempt a write to adress 10, it doesn't work with the autoincrement pointer register of the HMC.

    But if I read first all teh register I cant read the ID, and viceresa.

    Thanks

**Attention** This is a public forum