igrr / esp32-cam-demo

Demo for working with a camera on ESP32
Apache License 2.0
624 stars 243 forks source link

IO Expander #113

Open IGRajulu opened 5 years ago

IGRajulu commented 5 years ago

Can we use an 'IO Expander' (like MCP23017) to connect the camera Pins - D2, D3, HRef, VSync and Reset ? Of course, the rest pf the camera Pins would be connected directly to GPIO Pins f ESP32. Please help.

eflukx commented 5 years ago

Nope, the camera uses a high speed, time critical protocol, an MCP23017 wouldn't be able to keep up (by far!). The esp32-cam component uses the I2S module and DMA engine of the ESP32 that is specifically suited to handle such high speed signals.

The reset/power_down lines of the camera are not high speed, with a simple modification to the esp32-cam component it should be possible to drive there from the IO expander.

However, it should be possible for I2C devices (like an MCP23017) to share the SCCB bus with the camera. For making this work a small change in de SCCB_Probe function is needed, as it will otherwise report an error if it finds non-camera devices on the bus before it finds a camera (with a lower address than the camera).