CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

I2C Comm with Omnivision OV7910 CMOS Camera

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Kevin Burtness
Guest







I2C Comm with Omnivision OV7910 CMOS Camera
PostPosted: Sat Apr 13, 2002 2:06 pm     Reply with quote

I've got an application using a 16F877 as I2C master. I'm communicating with 5 slaves (4 Phillips EEPROM chips and an OV7910 CMOS Camera).

I can R/W to the EEPROM chips fine. I can only write to the OV7910 chip. I send commands to set registers in the OV7910. When I try reading the registers back, I only receive 0xFF.
I'm seeing variations in the video signal coming out of the OV7910, so I know its receiving the commands I'm sending it over I2C. I just can't verify register contents. I can verify that I receive the ACK back from the OV7910 as expected.

The code used to read from the OV7910 is below. Thanks!

registerReadVal = 0xFE;

// read register data from camera
i2c_start(); // Start i2c
If (i2c_write(0x80) !=0) returnstat = fail; //Address OV7910(W)
If (i2c_write(0x14) != 0) returnstat = fail; // Register #
If (i2c_write(0x81) == 0) // Address OV7910(R)
registerReadVal = i2c_read(0); // Read value
else returnstat = fail;
i2c_stop(); // Stop I2C
___________________________
This message was ported from CCS's old forum
Original Post ID: 3770
Kevin Burtness
Guest







Re: I2C Comm with Omnivision OV7910 CMOS Camera
PostPosted: Sat Apr 13, 2002 2:23 pm     Reply with quote

I just figured it out. Here's my revised code. Thx.

// Send a write cmd to the selected register
i2c_start(); // Start i2c
If (i2c_write(0x80) !=0) returnstat = fail;
If (i2c_write(register_num) != 0) returnstat = fail;
i2c_stop();

// Delay after the stop
delay_ms(5);

// Perform a read. OV7910 keeps track of the last register
// writtten to
i2c_start();
If (i2c_write(0x81) == 0)
registerReadVal = i2c_read(0);
else returnstat = fail;
i2c_stop();






-------------------
:=I've got an application using a 16F877 as I2C master. I'm communicating with 5 slaves (4 Phillips EEPROM chips and an OV7910 CMOS Camera).
:=
:=I can R/W to the EEPROM chips fine. I can only write to the OV7910 chip. I send commands to set registers in the OV7910. When I try reading the registers back, I only receive 0xFF.
:=I'm seeing variations in the video signal coming out of the OV7910, so I know its receiving the commands I'm sending it over I2C. I just can't verify register contents. I can verify that I receive the ACK back from the OV7910 as expected.
:=
:=The code used to read from the OV7910 is below. Thanks!
:=
:=registerReadVal = 0xFE;
:=
:=// read register data from camera
:=i2c_start(); // Start i2c
:=If (i2c_write(0x80) !=0) returnstat = fail; //Address OV7910(W)
:=If (i2c_write(0x14) != 0) returnstat = fail; // Register #
:=If (i2c_write(0x81) == 0) // Address OV7910(R)
:= registerReadVal = i2c_read(0); // Read value
:=else returnstat = fail;
:=i2c_stop(); // Stop I2C
:=
___________________________
This message was ported from CCS's old forum
Original Post ID: 3771
Andrew Cole acole#hmc.edu
Guest







I2C problem with OmniVision CameraChip
PostPosted: Tue Dec 09, 2003 6:20 pm     Reply with quote

I'm using the same code to communicate with the OmniVision OV2610AA camera, which uses, i believe, the same control interface. I was having the same problem with receiving 0xFF back from reads, but I wasn't checking the ACK bits. Now I realize I'm not getting ACK back from the camera. Any ideas?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group