SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on how to get your MSP JTAG programmer up and running.
By MostlyHarmless
#80096
I'm having trouble with my Honeywell Compass (HMC5843). I would like to read from a particular register in the device. This requires I send a read to slave 0x1E (becomes 0x3D with the R/~W bit set), then send the register (0x02), and then clock out the data in that register.

I'm having trouble with this because of the way the I2C state machine works on the MSP.

If I clear I2CTRX in I2CTCTL and initiate a read, the I2C expects the next byte on SDA to be received by the MSP. But I want to send out the register I wish to read from first. Then receive one byte.

I think I'm missing something obvious about the way I2C works in the MSP430.

Any tips, help, or a pointer to the MSP user guide (so I can RTFM) is much appreciated!
Cheers,
MH