i2c question (BBB)

I’m trying i2c bus on BBB

slave module is OV7670 ( CMOS Camera )

OS is angstrom

when i connect ov7670 on BBB P9 Header (19,20)

and command i2cdetect -r -y 1

look at the picture above you fine ‘21’ is creating

0x21 is slave address ???

but slave address of ov7670 is 0x42 in datasheet

what means 0x21 ??

and

am i better try i2c ???

My purpose is writing data to the ov7670 register.

Advice please

There is an “8 bit” representation of an I2C address, where the bottom bit is actually the Read/Write bit and is, by convention, set to zero to describe the address.
There is a “7-bit” representation of an I2C address, where the address is shifted one bit to the right, so the read/write bit disappears and is not part of the address.
Half the manufacturers do it one way, the other half the other way.

Linux/Debian uses the 7 bit representation.

0x42 >> 1 = 0x21

— Graham

thank you for your answer

When the ‘1’ shift is not this lead?

Then how to i write register in Ov7670 ??

I must register modification in OV7670

I wonder how to I2C write .

*Please understand the lack of my English skills. ^^ ;;;;

thanks

2015년 6월 25일 목요일 오전 2시 18분 37초 UTC+9, Graham 님의 말:

The signal on the bus is the same.
Just the name is different.

So to talk to the part using Linux, use the address in “7-bit” format, which for your part is 0x21.

If you are writing in C, you will use i2c-dev and ioctl

If you are writing in Python 2.7, you will use SMbus and something like the Adafruit Python I2C BBB-IO

Best regards,

— Graham