Good morning,
I'm software developer and I'm try to do a communication between the launchpad C2000 and a magnetic sensor (HMC5883L) to control the BLDC motor speed. Then I have tried some ways and I would like that someone can help me and to explain what I did wrong.
This sensor has a example code in Arduino that is easy to see the bytes protocol. I have tested and confirmed the code.
This site show the example code: https://www.sparkfun.com/tutorials/301
Then, I found a I2C communication example within controlSUITE reading a eeprom memory, then I have edited for my case. But it seems like a good signal. the clock means like strange and when plug the sensor the wave just vanish. I don't know exactly why it happens. I'm using 28 and 29 pin.
I thought that the clock and data have a pull-up resistor, but when I put it, the communications stop. look the wave in the pic.
Then I try another way, using a basic I2C code that I found on this forum. But it didn't work...
I would like to know if someone can help me, I have to real some values from this sensor.
The communication is basically:
startI2C(address); //open communication with HMC5883 send(0x02); //select mode register send(0x00); //continuous measurement mode read(6xBytes);// three fields, two Bytes each
I hope that somebody can help
Thanks for all.