sanity check for connected peripherals

theskaz
Posts: 22
Joined: Mon Feb 13, 2017 5:22 pm

sanity check for connected peripherals

Postby theskaz » Fri Feb 08, 2019 6:41 pm

This is a code excerpt from my Arduino based project for an ESP32-WROOM-32U. I think I have address all my GPIO issues on the current revision of my board, and would like someone to verify my pinout is ok before I order new boards.
  1. //pinout
  2. #define USB_TX 1 //Programming Port Connected to FT231XS
  3. #define USB_RX 3 //Programming Port Connected to FT231XS
  4. #define TEMPA_BUS 4 //DS18B20 Bus
  5. #define TEMPC_BUS 12 //DS18B20 Bus
  6. #define ELEMENT2_SSR_RELAY 13 //Connected by wire to a 40A SSR
  7. #define ELEMENT1_SSR_RELAY 14 //Connected by wire to a 40A SSR
  8. #define PUMP1_RELAY 15 //Songle 5v Relay
  9. #define DEBUG_TX 16 //Pin for connecting a USB/Serial Device for debugging
  10. #define DEBUG_RX 17 //not really used...
  11. #define ELEMENT1_CONTACTOR_RELAY 18 //Songle 5v Relay
  12. #define ERROR_RELAY 19 //Songle 5v Relay
  13. #define SDA 21 //I2C Bus
  14. #define SCL 22 //I2C Bus
  15. //On I2C bus, there are 2 ADS1015 ADCs and 1 BME280 with 3.3k pullup resistors in place.
  16. #define TEMPB_BUS 23 //DS18B20 Bus
  17. #define ELEMENT2_CONTACTOR_RELAY 25 //Songle 5v Relay
  18. #define DISPLAY_TX 26 //Connected to Nextion Display
  19. #define DISPLAY_RX 27 //Connected to Nextion Display
  20. #define PUMP2_RELAY 33 //Songle 5v Relay
does anyone see any issues or have any questions?

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: sanity check for connected peripherals

Postby ESP_igrr » Sat Feb 09, 2019 11:51 am

TEMPC_BUS 12 //DS18B20 Bus
This might be problematic since the default state of a onewire bus is high. GPIO12 is a strapping pin which determines flash voltage, with high meaning 1.8V; while the module you are using has 3.3V flash.

You can overcome this by either using a different pin, or burning VDDSDIO Efuse to 3.3V. The latter is explained in https://github.com/espressif/esptool/wi ... e-vdd_sdio.

theskaz
Posts: 22
Joined: Mon Feb 13, 2017 5:22 pm

Re: sanity check for connected peripherals

Postby theskaz » Mon Feb 11, 2019 4:48 am

for the sake of testing, a onewire device connected to GPIO12 will NOT allow it to be programmed.

I can do 1 of 2 things.

1. move it to GPIO5 and get rid of my "on" led
2. do the fuse thing.

How do I determine if burning to 3.3v is the right thing to do? what considerations should I take?

thank you for putting that out there!

ESP_Sprite
Posts: 9711
Joined: Thu Nov 26, 2015 4:08 am

Re: sanity check for connected peripherals

Postby ESP_Sprite » Mon Feb 11, 2019 6:12 am

You can switch around the LED and the onewire pin if you want to. Just make sure to connect your LED from +3.3V through a resistor to GPIO12. That way, the pin is default-high (but note that you need to make the GPIO *low* in order to light the LED.)
*EDIT* Oops, that's wrong, it needs to be low. See Igrrs post under this.

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: sanity check for connected peripherals

Postby ESP_igrr » Mon Feb 11, 2019 11:15 am

Efuse solution will work, but if you plan to produce a lot of devices that would be an extra step to account for during production (although an easily scriptable one).

Swapping the LED as suggested by ESP_Sprite will also work if you wire the LED between GPIO12 and GND (you need GPIO12 to be low at reset for 3.3V strapping, not high).

theskaz
Posts: 22
Joined: Mon Feb 13, 2017 5:22 pm

Re: sanity check for connected peripherals

Postby theskaz » Mon Feb 11, 2019 4:25 pm

Capture1.PNG
Capture1.PNG (5.05 KiB) Viewed 9359 times
Like this?

and after the esp boots, I dont need to manually pull it high, or do anything else to it?

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: sanity check for connected peripherals

Postby ESP_igrr » Tue Feb 12, 2019 12:35 am

Yes, like that, but flip the LED polarity, and you also need a resistor in series with the LED (usually around 1kOhm) — this applies to any other LEDs you have. If you want the LED to turn on you can set the pin as output and set level to high.

theskaz
Posts: 22
Joined: Mon Feb 13, 2017 5:22 pm

Re: sanity check for connected peripherals

Postby theskaz » Tue Feb 12, 2019 3:53 pm

yes, the resistor was what I was wondering. Thank you, Ill go this route.

Who is online

Users browsing this forum: No registered users and 33 guests