I2C Not Working

Hi, I am trying to connect a compass to my UAV using Panda II.

I have studied a lot of the samples here, but I am still not able to make this work.

I can see the I2C is sending 0x21, this is what is in HMC6352 sample. But what is confusing me is that the MC6352 spec refers to 0x42 hex. And other code I see takes the address and divides it by two. Why is this needed?

But still it doesn’t work. Do the analog signals look OK? Is it getting close enough to ground?

Hi AlDean, welcome to the forum!

I2C addresses are 7-bit only; you must use the 7-bit address. When you talk about “divide by two” did you actually mean that it was “/2” somewhere, or that it was just shifted ? Often times people use the 8-bit address and shift that to that they get a 7-bit value.

[url]http://code.tinyclr.com/project/356/i2c-scanner/[/url] can be helpful so you can see what responds on your I2C bus.

HMC6352 default address in 7-bit format is 0x21. In 8-bit format (ie with the read / write bit ) these addresses are 0x42 and 0x43.

It’s working! The scanner found the part and I was using the wrong address. The part was NOT the part I thought it was.

Thanks for the pointer!

BTW, dotnet is fantastic here. I am so happy I can live in VS environment. Panda board rocks too.

Glad you like your panda and welcome to the community.

Excellent news ! Go I2C Scanner - it rocks !