The issues with the variables, shouldnt make a difference. Those warnings are being set because i am passing values to them and then never using the variables for anything. I simply put them in the code so that I can see the values returned during debugging in the locals tab. The IMU has a linear regulator to keep the voltage at 3.3V
The compass has only one address, and the gyro has two addresses, both of which i have tried to use, though by looking at the schematic it should be address 0x68 because the ADO ( alternate address pin) is GNDd.
Typical errors with I2C devices:
- missing pull-up resistors, or wrong values (I see none in your schematic)
- other parts at the I2C lines (might happen with the PSoC dev boards, they e.g. have capacitors and LEDs on some pins)
- wrong I2C address format (the PSoC API want 7bit addresses), or wrong address
- long data lines, together with a high slew rate at the ports, might cause ringing on the lines
Best way to debug: either have a sharp look at your schematic and your code (with a 'I know there is a bug hiding' mindset), or using a scope (or a logic analyzer)
Yes I saw the voltage regulator but the Vcc of the PSOC chip has an effect on the signal amplitude. Also I don't have your board so I can't troubleshoot your program.
So i have the gyro working now, simple case not changing the write buf vsariable names after copying and pasting parts of the function, thats what i get for not taking the time to type out things. still not getting anything from the compass though. Is my code the exact code you used to get it to ACK? i get nothing from the slave on setup to write (besides NAK).
1 of 1 people found this helpful
I did not change the code. Only contacts for my convenience.
Just pressed the reset and got the waveform from analyzer.
I found the issue. Apparently the sensor is not actually an HMC5883L, it is a QMC5883L, its stamped like the Honeywell one though. The IMU is advertised as having the Honeywell part. This is, of course, not documented anywhere i just found something about the knockoff online and thought i would try it out changing the address to see.
In case anyone else stumbles across this thread with similar issues with a supposed HMC5883 or the 10DOF IMU from dfrobot, the datasheet for the QMC5883L: http://img.filipeflop.com/files/download/Datasheet-QMC5883L-1.0%20.pdf
Thanks to everyones help and input.
hi,i am using QMC5883 but i cant get data from module?
can u give me your config and slave ddress for i2c communication?
can you give me your project sample?