sccb(I2C) for ov7670

  • Permalink
  • submit to reddit
  • Email
  • Follow


hello friends

i want to implement an Omnivision OV7670 image sensor with ATMEGA16.
but encountered to a problem

i can't write in ov7670 registers !

when i try to communicate via I2C, i get NACK!
i send start and give rep_start from OV7670. then i send the write address
(0x42 according to datasheet) but no ACK is detected !!

i doubt to these :

1- according to datasheet, the address for writing is 42 (did not say hex!
is it?)
don't know i must send 0x42 itself or ox42 with a left shift ? because the
LSB specifies writing or reading

2- difference between logic levels. obviously atmega16 works with 5V, but
ov7670 I/O voltage is 1.7 to 3V. i am using 2.6V for sensor
know what happens to I2C between mega16 and ov7670?
should i connect the I2C pullup resistors to 5V or 2.6V? (i had connected
it to 5V)

my circuit is simple. only SDA and SCL of OV7670 and ATMEGA16 are connected
and a 4.7K pullup resistor on each line

thanks

	   
					
---------------------------------------		
Posted through http://www.EmbeddedRelated.com
0
Reply spman 8/17/2010 12:38:12 PM

See related articles to this posting

In article <a-6dnVVZEropH_fRnZ2dnUVZ_hCdnZ2d@giganews.com>, 
spman_xm@n_o_s_p_a_m.yahoo.com says...
> 
> hello friends
> 
> i want to implement an Omnivision OV7670 image sensor with ATMEGA16.
> but encountered to a problem
> 
> i can't write in ov7670 registers !
> 
> when i try to communicate via I2C, i get NACK!
> i send start and give rep_start from OV7670. then i send the write address
> (0x42 according to datasheet) but no ACK is detected !!
>
> i doubt to these :
> 
> 1- according to datasheet, the address for writing is 42 (did not say hex!
> is it?)

They usually use Address byte of 0x42 for write and 0x43 for reading.

> don't know i must send 0x42 itself or ox42 with a left shift ? because 
> the LSB specifies writing or reading

The actual value. I always test devices like this by doing a READ on a 
single register first.

> 2- difference between logic levels. obviously atmega16 works with 5V, 
but
> ov7670 I/O voltage is 1.7 to 3V. i am using 2.6V for sensor
> know what happens to I2C between mega16 and ov7670?
> should i connect the I2C pullup resistors to 5V or 2.6V? (i had connected
> it to 5V)

May have blown the sensor with that sort of voltage input.
 
> my circuit is simple. only SDA and SCL of OV7670 and ATMEGA16 are connected
> and a 4.7K pullup resistor on each line

Two issues here, 

1/ for that amount of voltage difference you need a level translator 
   betwen the two voltage domains a FET with pull ups on both sides to 
   the different rails will do it.

2/ have you exceeded the maximum SCL speed (clock rate) for the device.

Have you actually scoped the signals and all the other signals to the 
sensor, like what voltage level is the clock and other inputs to the
sensor.





 
> thanks
> 
> 	   
> 					
> ---------------------------------------		
> Posted through http://www.EmbeddedRelated.com


0
Reply Paul 8/18/2010 8:20:00 AM

thank you Paul

what is your opinion about an at91sam7x256? if i use it to connect to
sensor, need to shift voltage level yet? (i don't have any FET in present
time ...)	   
					
---------------------------------------		
Posted through http://www.EmbeddedRelated.com
0
Reply spman 8/19/2010 9:46:00 AM

On Aug 17, 2:38=A0pm, "spman" <spman_xm@n_o_s_p_a_m.yahoo.com> wrote:
> hello friends
>
> i want to implement an Omnivision OV7670 image sensor with ATMEGA16.
> but encountered to a problem
>
> i can't write in ov7670 registers !
>
> when i try to communicate via I2C, i get NACK!
> i send start and give rep_start from OV7670. then i send the write addres=
s
> (0x42 according to datasheet) but no ACK is detected !!
>
> i doubt to these :
>
> 1- according to datasheet, the address for writing is 42 (did not say hex=
!
> is it?)
> don't know i must send 0x42 itself or ox42 with a left shift ? because th=
e
> LSB specifies writing or reading
>
> 2- difference between logic levels. obviously atmega16 works with 5V, but
> ov7670 I/O voltage is 1.7 to 3V. i am using 2.6V for sensor
> know what happens to I2C between mega16 and ov7670?
> should i connect the I2C pullup resistors to 5V or 2.6V? (i had connected
> it to 5V)
>
> my circuit is simple. only SDA and SCL of OV7670 and ATMEGA16 are connect=
ed
> and a 4.7K pullup resistor on each line
>
> thanks
>
> --------------------------------------- =A0 =A0 =A0 =A0
> Posted throughhttp://www.EmbeddedRelated.com

Hi, you need to define what would be use for the image sensor in your
project.

If it is =93simple=94 image =93analysis=94, low res. 8bit (color tracking,
object tracking). Then you should look on Internet for a serial output
CMOS image sensors with optics(as they are used in robotics). If there
is need for =93high=94 image analysis, then AVR will not do the trick. For
that purpose, you should chose device with image sensor =93port=94(on some
Atmel ARM7 devices, high end). By using more =93advanced=94 ARM you will
get a memory flash controller, may came in handy =3D)

For simple stuff, I would recommend that you first use newer devices
from Atmel, with a picoPower technology enhanced (something like
Atmega644pa, expensive).With that device you will have no trouble with
voltage difference (you will have to power your image sensor from
2,85V). First, try to get I2C communication going with some memory IC
of temp. sensors.

Use Internet, read, build, read, build, read, build, read, ...
Be assured that soon you will be in a loop of choices :)

Consider ARM Cortex-M3 devices...

Best regards

P.S. Use search on this group ;)
0
Reply Matej 8/19/2010 1:31:15 PM

In article <2_qdnQpQDtzFYPHRnZ2dnUVZ_gydnZ2d@giganews.com>, 
spman_xm@n_o_s_p_a_m.yahoo.com says...
> 
> thank you Paul
> 
> what is your opinion about an at91sam7x256? if i use it to connect to
> sensor, need to shift voltage level yet? (i don't have any FET in present
> time ...)	   

Not looked at the processor so I have no idea what it does.
You have looked ta its datasheets I take it.

To connect the I2C/SCCB of any processor and and I2C device
including the Omnivision sensor, you will have to make sure
the voltage levls and clock speeds are right.

If you cannot directly match the voltage levels then you
will have to put some form of (voltage) level translator
in.

0
Reply Paul 8/19/2010 2:59:35 PM
comp.arch.embedded 19671 articles. 2 followers. Post

4 Replies
1212 Views

Similar Articles

[PageSpeed] 31

  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Omnivision OV7640 SCCB (I2C?) bus problem
Hello, I am hoping someone can assist me with the SCCB (I2C?) bus of an Omnivision OV7640 image sensor. I am unable to get the OV7640 to respond to commands on the SCCB bus. Preliminary : I have connected the OV7640 to a SRAM, and feed VSYNC and HREF to an Altera 7032S CPLD which controls and address counter and the SRAM. I can successfully capture an image frame, and transfer it (slowly) over RS232 to a PC. If I treat each pixel as a luminance value, I get a good monochrome photograph, 640 x 480. I find this surprising, since I was expecting bayer encoded data. Looking at (on the data...

SES-2 over I2C == multimaster I2C?
Dear Everyone, while investigating the theoretical background of some recent SuperMicro SAS backplanes with the AMI MG9072 enclosure management processor, I've ended up with the following unanswered question: it would seem that "enclosure management over I2C", as specified in the SATA 2.5 spec, implies the use of multi-master I2C. The host PC or the RAID controller effectively sends a SCSI command encapsulated in I2C to the enclosure backplane processor (I2C write transaction), then the backplane processor and the host machine switch roles on the I2C bus, and the backp...

I2C
hi, i am working with philips microcontroller LPC935 which is to be attached to I2C port expander. i have to write a code for this .As my device is configured as master receiver to read (i have to read only) the value or status of port pins . my question is that : Do i need to check for all 25 states of I2C bus from status register for my operation ? abhay wrote: > hi, > i am working with philips microcontroller LPC935 which is to be > attached to I2C port expander. > i have to write a code for this .As my device is configured as master > receiver to read (i have to read onl...

I2C high speed mode and I2C range extending
Hi - are there any microcontrollers out there that support I2C high speed mode? (3.4Mbps - defined in the I=B2C-bus specification, Version 2=2E0). I can't find any that do. I can't even find any NXP parts that do! Also - has anybody ever used an I2C bus extender chip? (ie the NXP P82B715). What was your experience with it? Are there any that can handle higher speeds that that one? (1Mbps+) Thanks! -Michael Michael wrote: > Hi - are there any microcontrollers out there that support I2C high > speed mode? (3.4Mbps - defined in the I�C-bus specification, Version > 2.0). I ca...

Devantech USB-I2C R286-USB-I2C board
Hello, I bought the Devantech USB-I2C R286-USB-I2C board. The Devantech USB- I2C module is a low cost USB to I2C module, with a simple command set, and interfacing to any I2C device. I'm trying to set the I2C interface between my I2C board and R286-USB-I2C? Also I do need a help in User Interface development for Microsoft Windows. It should be similar to your USB_I2C_SRF08.exe software but modified differently. Thanks in advanced for any help, Regards, Michael ...

I2C read write error in I2C User application
Hi all, I have a I2C based touch screen driver TSC2003 which i obtained from open source. Ref: http://lists.lm-sensors.org/pipermail/lm-sensors/2005-November/014227.html I added the driver to kernel (2.6.10)tree and I2C communication in hard ware is ok. After booting the system i didnt find any device entry. I manually created the device entry by mknod i2c-0 -c 89 0 I am writing an application in which i am polling the I2C device for reading X anf Y position. The application source is as follows int tscfd; int res; int addr = 0x48; #define I2C_SLA...

How to forward IOCTL's from i2c-dev.c to adapter driver (i2c-rt3352.c)
I'm writing the I2C adapter driver for SOC. This adapter exist now in system and RTC driver works with it via .master_xfer. I would like to send IOCTL's from application via /dev/i2c. I have loaded i2c_dev and all modules. After sending IOCTL I get following : #i2ccmd read 0 i2cdev_open[382] i2c_dev_get_by_minor[54] i2c_get_adapter[896] i2cdev_ioctl[186] ioctl, cmd=0x03, arg=0x00 i2c_control[731] i2cdev_release[420] i2c_put_adapter[910] i2cdev_ioctl method doesn't send I2C_RDWR IOCT'L to my adapter driver. How can I forward those IOCTL's to i2c-rt3352.c ...

I2C EEPROM
Hi, I am trying to read a byte from a particular address in I2C EEPROM. But the data I get is from a different location. For example, if try to read data from "x05" location, the byte from "x0B" location is read. If try to read data from "x06" location, data from "x0D" is read. If I try to read data from "x07", data from "x0F" is read. If you notice above situation, a fixed pattern is followed. I am using a I2C Master Core controller to read data from I2C EEPROM. Xilinx Post route simulation works fine but when I try to configure th...

i2c and compilers
dear all, ** I have been working on libero with the i2c programme, it is compiling without any error but no output. ** so i changed to other compiler hdlworks worked on it which i got a free code again same effect. ** Can anyone suggest me how to tackle this programme, is the state machine depends on the compiler? ** if anyone can suggest any code for libero with i2c it will be great help . Thank you. ...

i2c addressing
hi! i want to know that i2c addressing scheme for page write fashion how will it be. i mean what will be address scheme. it is described in the datasheet of the device you are using ...

having problems with i2c
hello you all i've been working on an i2c communication among a unique master and several slaves (all of them pic16f877) but a problem arose when trying to send data from slaves to the master: when working with a slave as transmitter, after setting sspcon2.RCEN, the SDA line is supposed to get the value of the most significant bit contained in SSPBUF and then shifting out the next bits with the falling edges of the SCL line (so that the second bit of the byte to be transmitted is shifted out with the falling edge of the first clock pulse, the third bit with the second falling edge... ...

i2c Bus
hallo all , i am a beginner in vhdl , i need help . i just want to ask with VHDL code wether the i2c Bus is free. bus is free when a stop condition is sent und known start condition is sent this is a start condition ______ scl(1) __ \__ sda(1->0) this is a stop condition ______ scl(1) __ __/ sda(0->1) please help me . thanks I think what you are asking for is a falling edge detector and a rising edge detector. Very simple: SIGNAL sda1, sda2, falling_edge, rising_edge : std_logic; BEGIN proc1: PROCESS BEGIN WAIT until clk=...

I2C slave
I've written a I2C slave core: http://www.frank-buss.de/vhdl/i2c_slave-0.1.zip It should work with 100 kB and 400 kB master devices and it supports sending and receiving multiple bytes and the repeated start condition. Stretching clock cycles is not supported, the host which uses the core must be fast enough. Currently I've tested it in a simulator, only, maybe someone could test it on real hardware, e.g. with the included testdevice and a hardware master, like built-in in some microcontrollers. I'm not sure about the communication concept: Currently it doesn't use handshak...

I2C on TMS320C5510
I am looking to use the AIC31 codec with a TMS320C5510 and I have not found much good info at ti.com on how to do this. Seems the 5510 is the only member of the family without an I2C port built in. I was looking at bit banging the GPIO port to do this and I am not sure you can make the port act like an open collector output. The data sheet says the data register is for reading the input when in input mode or you can write to it for the output mode. It is not clear if you can write a 0 to the output register when still in input mode. If not, it may be in the 1 state when the mode is set to...

On I2C protocol
As for the I2C Master, assuming no clock stretching is issued by the Slave, here is a common situation and its concerning counterparts. Usual scenario: 1) Start - b1 - b2 - Stop And relative CONCERNING scenarios: 2) Start - b1 - DELAY - b2 - Stop 3) Start - b1 - b2 - DELAY - Stop (and why not) Start - DELAY - b1 - b2 - Stop Where: b1 is a completely transferred and acked byte b2 as above DELAY is at least, more than a single SCL period. The difference between 1 and 2, 3 is the DELAY. Is such a delay allowed? If it is, which is the polarity of SCL when the master is (let's say) &quo...

I2C simulator
Hi all, I want to learn 'how to program an I2C device' . I am trying to find a simulator for an I2C device which I can use to test any sample programs I get from the web. When I search the web for a simulator I get a lot of VLSI related results. Is there a free I2C device simulator software for learning I2C programming. Thank in advance. Wills wrote: > I want to learn 'how to program an I2C device' . I am trying to find > a simulator for an I2C device which I can use to test any sample > programs I get from the web. When I search the web for a simulator I > get ...

I2C control.
Dear All, On my understanding, and the function call that chip supplier provides to me: ABC_IICWrite(1, 0x1A); // write 0x1a to register 1. It seems that: 1. I2C device can't support more then 255 registers. ( due to only 1 byte for register assigment. ) 2. I2C device only accept 1 byte data a time. ( it is my guess only, due to the function call accepts 1 byte only and that is not a pointer ). am I right? BR/ Boki. I2c specifications from Philips! http://www.standardics.philips.com/literature/books/i2c/pdf/i2c.bus.specification.pdf Enjoy! "Boki" <bokiteam@ms21.hine...

Multiple I2C
I have 2 separate I2C chain with 8 identical IC in each ones. Is it possible to drive both with same NI USB-8451 - of course with some switches, let say CMOS Analog Multiplexer. I can use IO port on NI USB-8451 to drive Mux, but how to avoid timing problem. With other words how to achieve that IO command wait until I2C Read or Write is ended (without extensive Wait in LabView execution). &nbsp; I haven?t yet NI USB-8451 so I can?t test and must to know how to solve that problem before buy hardware. Hi Oldi, Our I2C Box can serve 8 identical devices, for example EEPROMS because the addres...

Problem with I2C
Hi, I'm trying to interface a Toshiba 16bit MCU with another IC(call this IC2), with the MCU being a slave transmitter. The IC2 expects a slave EEPROM at a certain address, and I've setup the MCU to be at this address. The problem is that the MCU isn't interrupting or acknowledging the signals all the time. I've looked at the SDA/SCL waveforms and while IC2 is sending the first device address(with wr direction), the MCU doesn't ACK the address, even though it does interrupt at the end of the address. IC2 hence immediately sends the device address again, and only this time ...

i2c interface
I have a code for transferring the data serially to SDA line as: when data_tx=> if(bit_cnt<8) then if(SCL'event and SCL='0') then if(temp='0') then SDA<=data_register(7); temp:='1'; bit_cnt:=bit_cnt+1; else data_register<=data_register(6 downto 0) & '0'; SDA<=data_register(7); bit_cnt:=bit_cnt+1; end if; end if; end if; in above code, i wan...

I2C Extended
Hello Wire Workers, &nbsp; Can anyone enlighten me how to use more than 8 addresses (MAX 500 addresses) in NI USB 8451? Does USB 8451 support 10 bit addressing (I2C Extended)? In other words can I&nbsp;monitor 500 I2C compatible devices&nbsp;through NI USB 8451? &nbsp; Regards, Karthik SP ...

I2C Terminology
Hi all. After reaging the docs, I am still a bit confused about terminology used by lm-sensors team. I have to implement i2c driver for my specific hardware, that is based on ARM926EJ and AMBA bus. As I can see, there is not support for I2C interface that sits on AMBA bus (APB part of AMBA) adn is on the othae side connected to peripherals via I2C bus. So, that interface, called ApI2c, is bridge between I2C and AMBA bus. I have to write driver to describe it, so I am confused what files to look. 1) Is this what I described an "adapter" (in i2c terminology)? 2) Where should new .c f...

i2c opencores
Hi, has anybody successfully used this core? What I need to do seems to me really really simple: configure a couple of settings of a transceiver (operation frequency, transmitting mode, etc.). I was asked to do this with a i2c bus. I'm stuck creating the test bench just to do some read/write test. Has anybody a simple testbench example? Help. Tomas If you have a copy of Circuit Cellar ISSUE 176 March 2005 Control an FPGA with I2C, by Roberto Ferrabone, p. 60 There is a good I2C test bench written in VHDL. This article also has a very good description of the I2C protocol. It is wort...

I2C trick?
Suppose you have the two I2C slaves that have to be connected to the MCU. Both slaves have the same I2C address. The I2C master is simulated by bit banging. Would it be possible to swap SCL and SDA lines on one of the slaves so both slaves can be addressed independently? Can this cause any "side effects" ? Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com Vladimir Vassilevsky wrote: > Suppose you have the two I2C slaves that have to be connected to the >MCU. Both slaves have the same I2C address. First time I hear somebody doing t...