ESP32-CAM Problem with not enough pins

zdyboo
Posts: 1
Joined: Thu Nov 14, 2019 9:24 pm

ESP32-CAM Problem with not enough pins

Postby zdyboo » Thu Nov 14, 2019 9:35 pm

Hi, i am using this module with active camera and sd-card reader and i need 2 pins to software i2c to connect modules.
I added lines in SD_MMC.cpp

Code: Select all

slot_config.width = 1
host.flags = SDMMC_HOST_FLAG_1BIT; 
I try to use many combination of pins for example 13,16; 13,12; and more...
Anything dont work. According to this thread : viewtopic.php?t=11703, i have free pins 13,12 and 4 but 4 - it is flash led, 12 - if is use it, esp32 cant boot, the same o 16 pin - all time reboot. What i have to do to change these pins to I2C?

wattexi
Posts: 5
Joined: Mon Nov 25, 2019 8:21 pm

Re: ESP32-CAM Problem with not enough pins

Postby wattexi » Mon Dec 02, 2019 7:23 pm

I have the same problem, I need 2 pins free ... did you succeed and if so how?

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32-CAM Problem with not enough pins

Postby chegewara » Tue Dec 03, 2019 5:34 am

https://github.com/espressif/esptool/wi ... -Selection

When you read this you can see that pin 12 cant be connected to VCC (in your case, from your issue description):
If driven High, flash voltage (VDD_SDIO) is 1.8V not default 3.3V. Has internal pull-down, so unconnected = Low = 3.3V. May prevent flashing and/or booting if 3.3V flash is used and this pin is pulled high, causing the flash to brownout. See the ESP32 datasheet for more details.
but I2C requires SDA and SCL to be pullup.
There is solution for this, but its not easy. When you burn efuse then esp32 wont read pin 12 on restart:
https://github.com/espressif/esptool/wi ... e-vdd_sdio

Of course you have to know what you are doing burning efuse because you may brick your device.

wattexi
Posts: 5
Joined: Mon Nov 25, 2019 8:21 pm

Re: ESP32-CAM Problem with not enough pins

Postby wattexi » Wed Dec 04, 2019 7:39 pm

thanks for your answer i'm looking at that

NoChill_Senpai
Posts: 1
Joined: Mon Feb 24, 2020 4:35 pm

Re: ESP32-CAM Problem with not enough pins

Postby NoChill_Senpai » Mon Feb 24, 2020 4:41 pm

Hi, If I want to use an I2C device with the CAM and the SD card, could I use the pin 0 that is used for the clock on the camera with the SDL pin for the I2C?

bobtidey
Posts: 43
Joined: Mon Jun 18, 2018 2:24 pm

Re: ESP32-CAM Problem with not enough pins

Postby bobtidey » Tue Feb 25, 2020 11:21 am

You can use the TXD and RXD pins as GPIO.

Obviously they are not operational during a flash upload operation which may mean swapping wires to do uploads but if you use OTA then that doesn't matter after the first flash.

Using RXD doesn't affect any serial debug print but using TXD will.

alanesq
Posts: 86
Joined: Thu Dec 14, 2017 8:38 pm

Re: ESP32-CAM Problem with not enough pins

Postby alanesq » Tue Feb 25, 2020 4:15 pm

You can use the sd card in "1 bit" mode which means you can then still control the onboard led (gpio4) when using an sd card?
gpio12 and 13 are then not used by the sd card

see: https://www.reddit.com/r/esp32/comments ... alk_to_an/

dwienie
Posts: 2
Joined: Sun Mar 15, 2020 4:12 pm

Re: ESP32-CAM Problem with not enough pins

Postby dwienie » Sun Mar 15, 2020 4:24 pm

bobtidey wrote:
Tue Feb 25, 2020 11:21 am
You can use the TXD and RXD pins as GPIO.

Obviously they are not operational during a flash upload operation which may mean swapping wires to do uploads but if you use OTA then that doesn't matter after the first flash.

Using RXD doesn't affect any serial debug print but using TXD will.
Where you able to use OTA with this device?

alanesq
Posts: 86
Joined: Thu Dec 14, 2017 8:38 pm

Re: ESP32-CAM Problem with not enough pins

Postby alanesq » Tue Mar 17, 2020 6:05 pm

[/quote]
Where you able to use OTA with this device?
[/quote]

Hi,
I have used OTA sucesfully with the esp32-cam but instead of selectingthe "ESP32-cam" board in the Arduino IDE, use "ESP32 Dev Module" and make sure PSRAM is enabled and Partition iis set to "default 4mb with spiffs"

alanesq
Posts: 86
Joined: Thu Dec 14, 2017 8:38 pm

Re: ESP32-CAM Problem with not enough pins

Postby alanesq » Sat Sep 26, 2020 7:05 am

Some additional info. on using 1-bit mode on the sd card to free up some io pins:

If you access the sd card in 1-bit mode with the command: SD_MMC.begin("/sdcard", true)
you can then use pins 12 and 13 as general io pins (although 12 must be low at boot)
You can also use the Flash LED on pin 4 no problem (it also stops it flashing when you access the sd card)
but, you have to define these pins as input or output after initialising the sd card as otherwise it re-configures them

There is also the possibility of soldering direct to some extra pins on the esp32-s module its self (possibilities? 16, 17, 9, 10, 11, 6, 7, 8)
and of course the rx and tx serial pins could be used as previously stated

Who is online

Users browsing this forum: Baidu [Spider] and 45 guests