Two OV7670 with ESP32 :: Will this work? - Page 1
Forum section: electronics / general

author: code_monkey_
author_rank: Newbie
timestamp: July 21, 2020, 03:04:21 pm
content: Hi All,I want to read data from two ov7670 sequentially on esp32. But the problem with esp32 is that though it has two I2C buses it doesn't have enough pin to connect two ov7670 simultaneously. So I came up with the following idea. I have chosen TI TS3A44159, it is a quad 2:1 SPDT IC , This IC satisfy all the electrical criteria of data pins of ov7670, my thinking is that I will use this to switch between data pins (d0-d7) of one camera to another. But other pins such as XCLR, PCLR, SIOC... etc will be directly connected to esp32. Will this work?For reference kindly see the pic attached.Thanks for your help in advance.

author: hans
author_rank: Super Contributor
timestamp: July 21, 2020, 04:04:16 pm
content: That mux only has 35MHz bandwidth. The sensor seems to have a PCLK of 24 or 48MHz. If you want to receive a square wave, you probably want a multitude of BW for the switch, preferably in the 100MHz range I suppose. That switch adds a ton of capacitance. I would probably consider using a SN74CBTLV16292 or similar.With regards to the other pins, I have no idea. You probably also need to multiplex the pixel clocks and vsync to the ESP32, as you can't use those signals simultaneously anyway.I also suppose that the software library must be able to handle and support multiplexing of the sensors, e.g. if you were to switch them in and out mid-frame.

author: code_monkey_
author_rank: Newbie
timestamp: July 21, 2020, 04:31:35 pm
content: Thanks for your reply.. Indeed I am planning to work at 24MHz. The multiplexing IC (SN74CBTLV16292 ) that you have mentioned has an ON resistance of ~4ohm which is quite high as compared to 0.45 Ohms in TS3A44159. Should I even consider looking at ON resistance for this application?The reason I am not planning to multiplex PCLR and VSYNC is that I want both sensors to keep functioning simultaneously but I would read the data from them alternatively.

author: Scrts
author_rank: Frequent Contributor
timestamp: July 21, 2020, 04:52:26 pm
content: Quote from: code_monkey_ on July 21, 2020, 04:31:35 pmHow are you going to ensure that both sensors send the data exactly simultaneously pixel-by-pixel? If not, you need to have a mux for all signals.

author: code_monkey_
author_rank: Newbie
timestamp: July 21, 2020, 05:52:17 pm
content: Pardon me... I have explained it wrong. What I meant by that is all the signals that are input to the camera (XCLK, SIOC, SIOD) should be connected to ESP32 directly so as to minimize lag, time to setup and initialization. However the output clocks (VSYNC, PCLK, HREF), could be multiplexed.. Maybe connecting directly to the ESP32 could help eliminate Ton time of the switch.. I have see if that could be done

author: hans
author_rank: Super Contributor
timestamp: July 22, 2020, 08:24:43 am
content: Quote from: code_monkey_ on July 21, 2020, 04:31:35 pmA square wave of 24MHz hasharmonics in the hundreds of MHz(e.g. first harmonic at 72MHz, 2nd at 120M, 3rd at 168M, etc.). That's why I'd use a high BW switch.I don't think ON resistance is that critical, because it's not switching huge powers. Switch capacitance gives an indication of how much charge the digital outputs must provide each time it wants to pull the I/O line high or low. If you look at the I/O port specifications of a common microcontroller, you will see that their rise/fall times are usually specified for a particular output capacitance since their current sourcing/sinking capability is limited (8mA source, 15mA sink for the OV7670).