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 http://www.EmbeddedRelated.com
0
spman
8/17/2010 12:38:12 PM
comp.arch.embedded 19895 articles. 3 followers. Post Follow

4 Replies
1662 Views

Similar Articles

[PageSpeed] 34
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
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
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
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
Paul
8/19/2010 2:59:35 PM
Reply:
Similar Artilces:

I2C : PCF8574 emulate with PIC 16F84
Hi, Does anyone "make" a PCF8574 with PIC 16F84 ? This PIC is obsolete, but I'd like "convert" it in 8 I/O over I2C protocol. I looking for this source asm. Thanks a lot. -- -Stan Stan wrote: > Hi, > > Does anyone "make" a PCF8574 with PIC 16F84 ? > This PIC is obsolete, but I'd like "convert" it in 8 I/O > over I2C protocol. > > I looking for this source asm. Arrow sells the original part for $1.79. According to Philips, they have them in stock. Sound a hell lot cheaper to me than writi...

I2C protocol to communicate between FPGAs
Dear all, I am a newbie and am currently having a project to develop an I2C protocol in VHDL. My aim is to communicate between two Xilinx XC4005XL, one as master and one as slave. I wonder if any of you could provide me with some ideas on how I should start. I2C has 2 wires, SCL and SDA; all I have to do is to play with these two wires? What else should be considered? What I should do next? Thanks a lot! Well you could just wiggle the wires and see what happens or you could check out the i2c core at opencores.org and you could even get the documentation and read how it all works. ...

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 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 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 ...

US-TX-Austin: SW. QATest SW. Dev., C/C++,UART,SPI,I2C,USB,oscilloscope (45350214411)
US-TX-Austin: SW. QATest SW. Dev., C/C++,UART,SPI,I2C,USB,oscilloscope (45350214411) ==================================================================================== Position: SW. QATest SW. Dev. Reference: ZYD00017 Location: Austin TX Duration: Skills: Bachelor of Science Degree in Computer Science, Computer Engineering or Electrical Engineering. Expert embedded C programmer, minimum 5 experience. Strong C++ programmer. Experienced developing software tests with emphasis on automated test...

I2C SDA LINE
Hi All I am implementing the I2C Slave and i am using two data lines for sda input and sda output. MY question is that shall I expect from I2C bus to give me Z as input in place of 1 Shall I drive output 1 as Z to the sda_out Secondly We cannot synthesize Z as an input but can drive the output as Z any reason I have used an interal sda signal and sampled the SDA_input as SDA_internal<= '1' when SDA_input = 'Z' else '0' ; it is stucking the output /input to gnd and vcc in synthesis Pls specify Thanks Vipul On Thu, 4 Jun 2009 14:21:52 -0700 (PDT), VIPS wro...

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 leve...

MPC8260 - I2C - single channel 1-wire master (DS2482)
Hi, I'm writing an I2C driver for the MPC8260 that needs to read/write to a 1-wire EEPROM via a single channel 1-wire master. Since I'm new to the embedded world, I was wondering, if I want to send a READ ROM command to the 1 wire EEPROM, how must I go about doing that via software? How must I format the Tx buffer of the I2C to send that out to the 1-wire EEPROM via the single-channel 1-wire master? Thanks for your help in advance. Dead Fish >Since I'm new to the >embedded world, I was wondering, if I want to send a READ ROM command >to the 1 wire EEPROM, how must I ...

i2c slave using PIC16F88. Need urgent help/opinion.
Hi all, I am using PIC16F88 as an I2C slave. I have attached the code that I used. From the Microchip MPLAB ICD 2, I find that I am able to detect the start and stop conditions. But I find that SSPSTAT<BF> is not getting set. The program is getting stuck in the "gnb" loop. From the Microchip ICD2, I can see that SSPSTAT<S> and SSPSTAT<P> get set after the Start and Stop condictions. But not the BF bit. Nothing changes even if i enable the interrupts. Probably the address was not getting matched. I am using BL233 to mimic a master. Please let me know what mistake I...

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...

US-TX-Austin: SW. QATest SW. Dev., C/C++,UART,SPI,I2C,USB,oscilloscope (45349032428)
US-TX-Austin: SW. QATest SW. Dev., C/C++,UART,SPI,I2C,USB,oscilloscope (45349032428) ==================================================================================== Position: SW. QATest SW. Dev. Reference: ZYD00017 Location: Austin TX Duration: Skills: Bachelor of Science Degree in Computer Science, Computer Engineering or Electrical Engineering. Expert embedded C programmer, minimum 5 experience. Strong C++ programmer. Experienced developing software tests with emphasis on automated test...

US-TX-Austin: SW. QATest SW. Dev., C/C++,UART,SPI,I2C,USB,oscilloscope (45350557605)
US-TX-Austin: SW. QATest SW. Dev., C/C++,UART,SPI,I2C,USB,oscilloscope (45350557605) ==================================================================================== Position: SW. QATest SW. Dev. Reference: ZYD00017 Location: Austin TX Duration: Skills: Bachelor of Science Degree in Computer Science, Computer Engineering or Electrical Engineering. Expert embedded C programmer, minimum 5 experience. Strong C++ programmer. Experienced developing software tests with emphasis on automated test...

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...

Re: i2c smbus #3
It's a big help for me too! Could you share the VI and the hardware layout and others with me? My email:<a href="mailto:eggheader@gmail.com" target="_blank">eggheader@gmail.com</a> Thanks!???Egg Head?12-27-2005 08:29 PM????? ...

I2C TPU
Has anyone implemented a code for i2C in TPU? I need to find , get some help. i have been searching all around the net and all i found was Morbachs i2c code which is in assembly and i can't make it out!i am using the ECOC compiler. any help would be great. Thank you > Arno's code is written in TPU assembler; it lets the TPU do most of > the work of implementing an I2C master. > There is no C compiler for the TPU that I know of. > If you don't want to program the TPU, you can always "bit-bang" > on two I/O ports to create an I2C master, but it ha...

TotalPhase's Aardvark I2C adaptor with LV driver to read back register
I try to read back the uController's register using Aardvark I2C adaptor with LV 8.2. I have no problem to read back one register. But the read back is unstable when I tried read more than one registers (Sometime bounce between 0 and real value). Please see the attached VI. &nbsp; Also, is it a way to read/write all 256 registers at once? &nbsp; Thanks for Help &nbsp; Ed Wong Sun Read back file.vi: http://forums.ni.com/attachments/ni/170/257242/1/Sun Read back file.vi Hi Ed, I was wondering - where did you get the Aardvark I2C vi's from?&nbsp; They wouldn't load...

MPC866 and I2C
Hi, We are using an 866 to communicate with three I2C devices in our design. The driver is using the CPM and polling RxBD and TxBD to determine when an operation is complete. We can read and write all three devices literally for days, but eventually a read operation will fail and all subsequent I2C accesses will fail as well. The details of the read failure are that the R bit in the TxBD status and control byte does not clear. Oddly enough, the RxBD status appears to be correct (i.e. data was apparently returned from the slave device) and none of the error bits are set. It'...

Simulatring I2C communications in AVRStudio?
Hello, I'm trying to test my I2C code in the AVR simulator in AVRStudio. Is it possible to simulate an entire I2C communications session without having to resort to setting bits in the processor registers? Any tips? TIA -=- This message was sent via two or more anonymous remailing services. "Anonymous" <BigappleRemailer@bigapple.yi.org> schrieb im Newsbeitrag news:AX7AQN6538748.3851851852@anonymous... > > I'm trying to test my I2C code in the AVR simulator in AVRStudio. Is it > possible to simulate an entire I2C communications session without havin...

ov7690 SCCB interface
hi: i am trying to interface 0V7690 with SAM kit. ov7690 has SCCB interface. which i came to know that can be run over TWI interface. I have perfectly running code for TWI. and can read and write I2C based EEPROM. but when i trying to READ ID (from register 0x0A)from ov7690 which has slave adress of 0x43 to read i got error of time out, in other words it didnt respond!! my controller is running on 3.3v. and ov7690 is on 2.8v i have bi-directional MAX3002 level shifter between them. and also pull-up with 10K resistor on both sides. I didnt connect HREF,VSYNC,PCK and data lines, c...

US-TX-Round Rock: Development Engineer, I2C, IPMI, USB, 9 mo. (45391630743)
US-TX-Round Rock: Development Engineer, I2C, IPMI, USB, 9 mo. (45391630743) =========================================================================== Position: Development Engineer Reference: ALM00021 Location: Round Rock TX Duration: 9mo. Skills: I2C, IPMI, USB, SNMP, SMASH, TCPIP C development/debug skills including the use of debug tools Understanding and demonstrated experience of the software development process Server platforms Strong communication skills both verbal and written ...

pcf 8591 i2c bus basic stamp problem
Hi, I'm trying to control a PCF8591 A/D Converter with my Basic Stamp 2p40 via I2C Bus. Bus is working as I can control a PCF8574 without problems. Code is as follows: I2COUT 8, I2CIdSharpsWrite, I2CSharpsControlByte00, [I2CSharpsControlByte00] I2CIN 8, I2CIdSharpsRead, 0, [B0] I2COUT 8, I2CIdSharpsWrite, I2CSharpsControlByte01, [I2CSharpsControlByte01] I2CIN 8, I2CIdSharpsRead, 0, [B1] I2COUT 8, I2CIdSharpsWrite, I2CSharpsControlByte10, [I2CSharpsControlByte10] I2CIN 8, I2CIdSharpsRead, 0, [B2] I2COUT 8, I2CIdSharpsWrite, I2CSharpsControlByte11, [I2CSharpsControlByte1...

ov7690 SCCB writing data to register
hello: Hello: i am using ov7690 with at91sam usin MCK at 12.3MHz. but for testing purpose i am using I2C at 153KHz from atmega2560 for SCCB. I can read any register from ov7690 but I can't write to any register. the response is correct i.e. status register of TWI of atmega2560 depicts correcr value, meaning it sends data. but when i read back the value from that register the old valure retains... what can be the problem?? --------------------------------------- Posted through http://www.EmbeddedRelated.com the CODE is below. I use eeprom routine beciase it is...

RS-485 or I2C?
I'm trying to decide the architecture for my mobile robot, and I'm open for suggestions. Here's what I need to do: Fact: Brain of the robot will reside on a PC. This PC has standard ports (serial, parallel, USB, etc). My original thought: Have the PC interface via RS-232 with what I call "the main message manager", which is a PIC mcu that is responsible to inquiry several "sensor slave modules" (as described below) if a message is ready to send. If yes, then the message manager reads that data, packages into a given software protocol and transmits to t...

Configuring sccb for OV9650 cmos camera
Hi all. I have just purchased the omnivision 9650 cmos camera for my project of image processing and i wish to interface the camera with the Altera DE2 FPGA board. For this I need to write the configuration in verilog code program but I do not have a clue about how to write it. Can anyone here provide any guidance? Thanks a lot. --------------------------------------- This message was sent using the comp.arch.embedded web interface on http://www.EmbeddedRelated.com maximili wrote: > Hi all. I have just purchased the omnivision 9650 cmos camera for my > project...