Hello,
I'm trying to get compass data from MPU9150 with the MotionAPP 5.1. It seems that the bypass mode does't work. I can even not read the whoamI register of the compass in the mpu_init function. The i2c_read always returns an error (I tried all possible i2c adress for ak8975: 0x0c, 0x0d, 0x0e, 0x0f). On the contrary, it works well when I read the i2c adress of MPU (0x68).
Can any one help me? Thanks!
Yijun
- Log in to post comments
phpbb Topic ID
15678
Re: Re: Problem read compass data
@yijun wrote:
Any idea for this issue?
Re: Re: Problem read compass data
I found something strange. When I put an oscilloscope probe on the "ES_DA" or "SDA" pin, it works well. I can read compass register via its i2c adress. But when I don't put it on any of these two pins, the read returns always an error and cannot get data. Any help would be greatly appreciated.
Yijun
Re: Re: Problem read compass data
In your MPU-9150 init, ensure that bypass in enabled by writing 2 to address 0x37, and I2C master is disabled by writing 0 to 0x6A. I would expect the I2C address to be 0x18 for Write and 0x19 for a Read. Hope this helps.
Re: Re: Problem read compass data
@gary wrote:
Hi Gary,
Thanks for your reply. I verified the two registers and the bypass mode is enabled when reading compass adress. The problem is when I add a small capacitor on the SDA pin (in parallel with the pull up resistance on SDA), all work well. Otherwise, I can even not read the whoamI register of the compass.
Yijun