- #1
jamie.j1989
- 79
- 0
I have a 3-Axis Digital Compass IC HMC5883L I2C chip, I just want to use it to learn how to talk to sensors via a Matlab to raspberry-pie to I2C chip link. The set up from Matlab to the pi is straight forward and simple, the issue I'm having seems to be the address I'm being returned when scanning the I2C bus line, I get an address of '0x0D' instead of the data sheets default of '0x1E'. There are two lines of code, the creation of the pi object 'rpi', and the function to scan the bus line is simply
rpi = raspi()
scanI2CBus(rpi, 'i2c-1' )
the argument 'i2c-1' tells the pi which bus line to scan, it is the only bus line available. Connections to the device are simple and have been checked and double checked, so I'm straight ruling that out. There is a built in MATLAB class for using this device with a pi, when I change the address it uses in this class to '0x0D' it clearly talks to the device but returns the error,
Error using hmc5883l/testDevice (line 246)
Error communicating with the HMC5883L sensor. The value read from ID_A, ID_B and ID_C registers do not match expected
values.
If I use the default address '0x1E' I get an error informing me that there is know device on the bus with that address.
Does an incorrectly returned address normally mean a faulty chip?
rpi = raspi()
scanI2CBus(rpi, 'i2c-1' )
the argument 'i2c-1' tells the pi which bus line to scan, it is the only bus line available. Connections to the device are simple and have been checked and double checked, so I'm straight ruling that out. There is a built in MATLAB class for using this device with a pi, when I change the address it uses in this class to '0x0D' it clearly talks to the device but returns the error,
Error using hmc5883l/testDevice (line 246)
Error communicating with the HMC5883L sensor. The value read from ID_A, ID_B and ID_C registers do not match expected
values.
If I use the default address '0x1E' I get an error informing me that there is know device on the bus with that address.
Does an incorrectly returned address normally mean a faulty chip?