i2c question (BBB)

264 views
Skip to first unread message

멘지

unread,
Jun 24, 2015, 4:13:48 AM6/24/15
to beagl...@googlegroups.com

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

Graham

unread,
Jun 24, 2015, 1:18:37 PM6/24/15
to beagl...@googlegroups.com
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

==
Message has been deleted

멘지

unread,
Jun 25, 2015, 2:27:48 AM6/25/15
to beagl...@googlegroups.com
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 님의 말:

Graham Haddock

unread,
Jun 25, 2015, 11:00:01 AM6/25/15
to beagl...@googlegroups.com
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

==


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/c0M35cLIS4Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages