sccb(I2C) for ov7670

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

formatting link

Reply to
spman
Loading thread data ...

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

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

but

May have blown the sensor with that sort of voltage input.

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.

Reply to
Paul

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

formatting link

Reply to
spman

s
!
e

ed

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 ;)

Reply to
matejz.sb

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.

Reply to
Paul

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.