On 27 May, in article <1117207069.668807.283210@g44g2000cwa.googlegroups.com> may_2005@olley.com "Paul Olley" wrote:>Thank you for the additional suggestions. > >I'm sorry if I wasn't clear in my description. I was releasing the >tri-state to form a passive "1" rather than driving the output high. > >Turns out that for a PIC18F8620 V Input High = 0.7Vdd for RC3 and RC4 >That equals 3.5V and since the OV7640 has its IO fed at 3.3V, clearly a >simple resistor configration fails. Pity, it was a simple solution >with the clamping diodes. Still the BSN20 devices are not very >expensive.Well worth a look...>So, many code trials later, bit-banging problem fixed, and my problem >is solved. > >I wasn't getting an acknowledge from the OV7640 because I was not >addressing it correctly.As I think we all suspected earlier.>The datasheet states : "The device slave addresses for the >OV7640/OV7141 are 42 for write and 43 for read." > >I took this to mean that the address was 01000010 > >So when addressing the device, one needed to send 10000100 > >(Shift the bits one to the left, and set the LSB to 0 to indicate a >read.) > >However, it appears the datasheet means that the bit sequence one uses >for the addressing byte is 01000010, the LSB being 0 indicating a >write. > >For a read, the bit sequence is 01000011 this time the LSB is 1 >indicating a read.Forgot to check that, glad you have the problem solved.>I have read out some of the read only register locations, obtaining the >default values specified in the datasheet. > >I will soon return to working on the image data which will no doubt >throw up some more questions.Well at least you are progressing in the right direction. Good to hear things are starting to work. -- Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.gnuh8.org.uk/> GNU H8 & mailing list info <http://www.badweb.org.uk/> For those web sites you hate
Omnivision OV7640 SCCB (I2C?) bus problem
Started by ●May 24, 2005
Reply by ●May 27, 20052005-05-27
Reply by ●May 28, 20052005-05-28
On Friday, in article <2JKdndMERMSvSgvfRVn_vg@giganews.com> vincesusu@yahoo-dot-fr.no-spam.invalid "vinch" wrote:>Hi ! > >I'm happy I'm not the only one in the world to have problem >configuring these cameras.... > >I'm using a OV7141, so the same camera but B&W. I'm configuring >the camera with a PIC core intergrated on a SPARTAN IIE FPGA. I have >2 1k resistors on SDA/SCL, I checked the signals and timings sent by >the FPGA to the camera and they are exactly like the ones on the >Omnivision datasheet ! > >I supplied the camera with 2,5V as it is indicated in the datasheet >(and not 3V3 which is too high for some input voltages) and the FPGA >is 3V3.The camera chip has Vdd-IO which should be 3V3, to match your FPGA.>The only difference I notice from I2C is that the camera "may not" >answer to the ack(called don't care bit) ! And it doesn't wih what I >can observe on my scope.Until you can address the camera and get a vlaid ACK to the address all the time, then everything else is pointless chasing.>In the datasheet : > >"The Don?t-Care bit is the 9th bit of a master-issued >transmission; ID address, sub-address and write data. The master will >continue to assert transmission phases until the transmission cycle is >complete. The master also assumes that there is no transmission error >during data transmissions. The purpose of the Don?t-Care 9th bit is >to indicate the completion of the transmission. >When there is more than one slave on the bus, the slave(s) may respond >to the Don?t-Care bit in one of two ways. If slave 1 is selected and >data is written to this specific slave, slave 1 will drive SIO_D to >logical 0 for the Don?t-Care bit. In this case, the SIO_D signal may >conflict at the beginning of the Don?t-Care bit, while it may be >floating at the end of the Don?t-Care bit. >Alternately, it is possible that the slave(s) do not respond to the >Don?t-Care bit of the current phase. In this situation, the SIO_D bus >remains at float for the whole Don?t-Care bit."Check as the other user that you are doing:- 1/ SDA is on an open-drain output from the FPGA and the pin is let float during the 'ninth bit' 2/ The address is as follows:- READ 10000100x (0x42 shift left one) Write 10000111x (0x43 shift left one) �� Write bit- ----- Ack bit (write to SDA line so it floats high) 3/ Make sure your FPGA/PIC reads the ack bit during SCL high 4/ Section 3.2.3 of the SCCB interface (Omnivision I2C spec) shows that SDA o/p from the master must FLOAT during this bit time and the SLAVE (OV7xxx) must set it low if it recognises the address as its address.. When SDA is driven low during this bit time, this is an acknowledgement to the Master that the slave has been addressed correctly.>If someone managed to configure a Omnivision camera yet, it would >really help me a lot !Yes the problems are not usually the camera chip, but understanding I2C and Omnivisions poor SCCB descriptions in order to avoid I2C patents. The fact they use a different address for read and write is also confusing and bad use of the I2C bus, when it could mean they had two or more cameras on the same bus. -- Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.gnuh8.org.uk/> GNU H8 & mailing list info <http://www.badweb.org.uk/> For those web sites you hate
Reply by ●May 31, 20052005-05-31
Reply by ●May 31, 20052005-05-31
Hello Paul and Vinch, Just to clarify, the bit sequence I used to address the OV7640 was READ 01000010x (0x42) WRITE 01000011x (0x43) ie : I didn't shift the bits one to the left. I really believed given the way the information was presented in the datasheet that I needed to shift the bits one to the left, but empirically I found this not to be the case. Paul.
Reply by ●June 3, 20052005-06-03
Hi Paul, The camera is still not answering (pulling down SDA pin) even if send 42h as write address (0100 0010). I'm recording SDA and SC sequence that's sending my fpga with an oscilloscope and the SD remains high. The timings I have are really higher than the spec o the SCCB (SCL high during 50us !) I added two pullups on SDA SCL, and this time instead of applying a on SDA, I realise it from the ground as you did Do you have a schematic of your circuit ? Can I have a look at you code Thank yo Vincen
Reply by ●June 3, 20052005-06-03
On Friday, in article <Q_GdnSyV3OorjD3fRVn_vg@giganews.com> vincesusu@yahoo-dot-fr.no-spam.invalid "vinch" wrote:>Hi Paul, > >The camera is still not answering (pulling down SDA pin) even if I >send 42h as write address (0100 0010). I'm recording SDA and SCLREAD address.>sequence that's sending my fpga with an oscilloscope and the SDA >remains high. The timings I have are really higher than the spec of >the SCCB (SCL high during 50us !). >I added two pullups on SDA SCL, and this time instead of applying a 1 >on SDA, I realise it from the ground as you did.You should have a pullup to 3V3 on the SDA and SCL line 2k or higher. The OV7640 should be powered at 3V3 on VDD-IO (only), and the FPGA I/O should be powered at 3V3 for that bank at least. The fpga pins that drive SDA and SCL must be open-drain configuration, whilst waiting for the ack bit you MUST set the SDA output from the FPGA to open-drain (pseudo drive high where the pullup resistor drives the line). If the FPGA is ACTIVELY driving the line you won't see a low. What exact voltage levels are you getting before and after the ack bit time and for '1' and '0' during the address bits? You may have the FPGA or soemthing else actively driving the line high during this bit time, which will give a slightly different voltage level (example 3.1V instead of 3.3V).>Do you have a schematic of your circuit ? Can I have a look at your >code ?I don't have FPGA code for such a setup and I have used bit banging from ports and Philips PCF8584 I2C controller for such tasks. There are examples about like fclib if you search for that as an example for Altera PLD I2C slave/master.>Thank you >Vincent-- Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.gnuh8.org.uk/> GNU H8 & mailing list info <http://www.badweb.org.uk/> For those web sites you hate
Reply by ●June 3, 20052005-06-03
This is a multi-part message in MIME format. ------=_NextPart_000_00A3_01C5685E.DBDD11C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable "Paul Carpenter" <paul$@pcserv.demon.co.uk> wrote in message = news:20050603.0854.309215snz@pcserv.demon.co.uk...> On Friday, in article <Q_GdnSyV3OorjD3fRVn_vg@giganews.com> > vincesusu@yahoo-dot-fr.no-spam.invalid "vinch" wrote:>>The camera is still not answering (pulling down SDA pin) even if I >>send 42h as write address (0100 0010). I'm recording SDA and SCL >=20 > READ address.The datasheet reads : "The device slave addresses for the OV7640/OV7141 = are 42 for write and 43 for read.">>Do you have a schematic of your circuit ? Can I have a look at your >>code ?Part of my schematic, at least the part including the OV7640 is here : = http://homepage.ntlworld.com/paul.olley/ The FET's are level shifters since the PIC is running at 5V and the = OV7640 runs on 3.3V =20> I don't have FPGA code for such a setup and I have used bit banging =from> ports and Philips PCF8584 I2C controller for such tasks. There are =examples> about like fclib if you search for that as an example for Altera PLD =I2C> slave/master.My code is also on a PIC. Among many others, I read the following webpage : = http://www.robot-electronics.co.uk/htm/using_the_i2c_bus.htm There is = some C code at the bottom which I thought was quite easy to read. I didn't find Omnvision parts easy to source, in fact, I only found one = supplier : www.2k1.co.uk Where else are OV products available? Paul. ------=_NextPart_000_00A3_01C5685E.DBDD11C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2900.2627" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>"Paul Carpenter" <</FONT><A=20 href=3D"mailto:paul$@pcserv.demon.co.uk"><FONT face=3DArial=20 size=3D2>paul$@pcserv.demon.co.uk</FONT></A><FONT face=3DArial = size=3D2>> wrote in=20 message </FONT><A = href=3D"news:20050603.0854.309215snz@pcserv.demon.co.uk"><FONT=20 face=3DArial=20 size=3D2>news:20050603.0854.309215snz@pcserv.demon.co.uk</FONT></A><FONT = face=3DArial size=3D2>...</FONT></DIV> <DIV><FONT face=3DArial size=3D2>> On Friday, in article = <</FONT><A=20 href=3D"mailto:Q_GdnSyV3OorjD3fRVn_vg@giganews.com"><FONT face=3DArial=20 size=3D2>Q_GdnSyV3OorjD3fRVn_vg@giganews.com</FONT></A><FONT = face=3DArial=20 size=3D2>><BR>> </FONT><A=20 href=3D"mailto:vincesusu@yahoo-dot-fr.no-spam.invalid"><FONT = face=3DArial=20 size=3D2>vincesusu@yahoo-dot-fr.no-spam.invalid</FONT></A><FONT = face=3DArial size=3D2>=20 "vinch" wrote:<BR></FONT></DIV> <DIV><BR><FONT face=3DArial size=3D2>>>The camera is still not = answering=20 (pulling down SDA pin) even if I<BR>>>send 42h as write address = (0100=20 0010). I'm recording SDA and SCL<BR>> <BR>> READ = address.<BR></FONT></DIV> <DIV><FONT face=3DArial size=3D2>The datasheet reads : "</FONT><FONT = face=3DArial=20 size=3D2>The device slave addresses for the OV7640/OV7141 are 42 for = write and=20 </FONT><FONT face=3DArial size=3D2>43 for read."</FONT></DIV><FONT = face=3DArial=20 size=3D2> <DIV><BR>>>Do you have a schematic of your circuit ? Can I have a = look at=20 your<BR>>>code ?<BR></DIV> <DIV>Part of my schematic, at least the part including the OV7640 is = here : <A=20 href=3D"http://homepage.ntlworld.com/paul.olley/">http://homepage.ntlworl= d.com/paul.olley/</A></DIV> <DIV> </DIV> <DIV>The FET's are level shifters since the PIC is running at 5V and the = OV7640 runs on 3.3V</DIV> <DIV> <BR>> I don't have FPGA code for such a setup and I have = used bit=20 banging from<BR>> ports and Philips PCF8584 I2C controller for such = tasks.=20 There are examples<BR>> about like fclib if you search for that as an = example=20 for Altera PLD I2C<BR>> slave/master.<BR></DIV> <DIV>My code is also on a PIC.</DIV> <DIV> </DIV> <DIV>Among many others, I read the following webpage : <A=20 href=3D"http://www.robot-electronics.co.uk/htm/using_the_i2c_bus.htm">htt= p://www.robot-electronics.co.uk/htm/using_the_i2c_bus.htm</A> =20 There is some C code at the bottom which I thought was quite easy to = read.</DIV> <DIV><BR>I didn't find Omnvision parts easy to source, in fact, I only = found one=20 supplier : <A = href=3D"http://www.2k1.co.uk">www.2k1.co.uk</A></DIV> <DIV> </DIV> <DIV>Where else are OV products available?</DIV> <DIV> </DIV> <DIV>Paul.</DIV> <DIV> </DIV> <DIV></FONT> </DIV></BODY></HTML> ------=_NextPart_000_00A3_01C5685E.DBDD11C0--
Reply by ●June 3, 20052005-06-03
On Friday, in article <Ni%ne.2413$8m5.346@newsfe5-gui.ntli.net> may_2005@olley.com "Paul Olley" wrote:>This is a multi-part message in MIME format.mutter, mutter, mutter....>"Paul Carpenter" <paul$@pcserv.demon.co.uk> wrote in message = >news:20050603.0854.309215snz@pcserv.demon.co.uk... >> On Friday, in article <Q_GdnSyV3OorjD3fRVn_vg@giganews.com> >> vincesusu@yahoo-dot-fr.no-spam.invalid "vinch" wrote: >>>The camera is still not answering (pulling down SDA pin) even if I >>>send 42h as write address (0100 0010). I'm recording SDA and SCL >> >> READ address. > >The datasheet reads : "The device slave addresses for the OV7640/OV7141 = >are 42 for write and 43 for read."Must remember when house full of builders, don't rely on another posting double check the datasheet.>>>Do you have a schematic of your circuit ? Can I have a look at your >>>code ? > >Part of my schematic, at least the part including the OV7640 is here : = >http://homepage.ntlworld.com/paul.olley/ > >The FET's are level shifters since the PIC is running at 5V and the = >OV7640 runs on 3.3V >=20 >> I don't have FPGA code for such a setup and I have used bit banging = >from >> ports and Philips PCF8584 I2C controller for such tasks. There are = >examples >> about like fclib if you search for that as an example for Altera PLD = >I2C >> slave/master. > >My code is also on a PIC. > >Among many others, I read the following webpage : = >http://www.robot-electronics.co.uk/htm/using_the_i2c_bus.htm There is = >some C code at the bottom which I thought was quite easy to read. > >I didn't find Omnvision parts easy to source, in fact, I only found one = >supplier : www.2k1.co.ukIn UK I beleive they are the only source, but I have had varying degrees of success with that company over the years with various parts, and part shipments.>Where else are OV products available?According to their website Telecom Design Communications Ltd. Tel: +44(0)1256 332800 Fax: +44 (0)1256 332810 Website: www.tdc.co.uk Email: web.sales@tdc.co.uk>Paul. > > >------=_NextPart_000_00A3_01C5685E.DBDD11C0 >Content-Type: text/html; > charset="iso-8859-1" >Content-Transfer-Encoding: quoted-printable > ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ><HTML><HEAD>..... -- Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.gnuh8.org.uk/> GNU H8 & mailing list info <http://www.badweb.org.uk/> For those web sites you hate
Reply by ●June 4, 20052005-06-04
Paul Olley wrote:> > Part 1.1 Type: Plain Text (text/plain) > Encoding: quoted-printableAnother unread message because of the html or mime encoding. Usenet is a pure text mechanism. -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson
Reply by ●June 5, 20052005-06-05