Main Site Documentation

I2C Not Working


#1

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?


#2

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.

http://code.tinyclr.com/project/356/i2c-scanner/ 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.


#3

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.


#4

Glad you like your panda and welcome to the community.


#5

Excellent news ! Go I2C Scanner - it rocks !