Open gitcnd opened 2 years ago
I'll verify your findings at which point I am happy to change the image accordingly. Thanks for your detailed investigation.
I've done a pile more investigation, including working out which pins can be used for input (or not - as well as with pullups, or not), and making some other handy lists (including disconnected pins, pins needed for SD(1bit) and SD_MMC(4bit), pins that crash the board(6) or prevent sketch upload over serial(12), ) and more...
If you want to point me at "the image" and/or give me a clue about how to change it - I'm happy to do that work for you, as well as propose the addition of the extra stuff I've worked out.
Long story short: an ESP32_D1 diagram that doesn't include all the above is likely to cause a lot of headaches to newcomers - every bit (pardon the pun) that I've worked out above is always going to need to be something to keep in mind when wiring things up to these boards...
(my notes re above):
Ok, you have clearly spent a lot more time with this MCU then I ever have!
If you are referring to this pinout, I took that simply from that website.
I did some digging and found this vector version of the pinout, but no Idea if that is just a copy or the "original": https://gitlab.com/gschorcht/RIOT.wiki-Images/-/blob/master/esp32/ESP32_pinouts.odg
I am not familiar with the odg format but seems to be a LibreOffice format. I am happy to replicate something nicer than my original sketch and close to the image above in Illustrator based on a mock-up from you. It seems quite a few people ended up using this repo so it's wort the update.
There is also this one, again with no original source I could find easily and only in jpg format...
I did some digging and found this vector version of the pinout, but no Idea if that is just a copy or the "original": https://gitlab.com/gschorcht/RIOT.wiki-Images/-/blob/master/esp32/ESP32_pinouts.odg
This is the pinout of the board as used by the RIOT-OS (https://doc.riot-os.org/group__boards__esp32__mh-et-live-minikit.html) which I created for the RIOT-OS documentation. Please note that it may differ from the pinout as provided by the Arduino core.
The ESP32 D1 Mini pin labelled "TX" is GPIO03 (wrongly labelled on this PDF as GPIO01) Yes, I know that the ESP32 GPIO pin 03 is "RX" - my guess is that the D1 board labelled "RX" as "TX" for wiring reasons?
The pin labelled "RX" is GPIO01 (wrongly labelled on the PDF as GPIO03).
Hm, really strange, I didn't realize that because I was always using the USB2UART bridge. The original pin assignment on the product page https://mhetlive.nodebb.com/topic/8/mh-et-live-minikit-for-esp32 also clearly states that the first pin of the left-hand header on the right-hand side is the TXD and thus the GPIO1 pin. This is also labeled accordingly on the PCB.
However, if I take a look into the schematic at https://i.imgur.com/EpE4dGj.jpg it seems in fact that the first pin of the left header at the right is the RXD0 pin :thinking: So not only the pinout is wrong but also the PCB.
This is even more worse because the Wemos D1 mini shields that should be pin compatible, expect as shown in the pinout, that is the TXD pin as the first pin and the RXD pin as the second pin.
The following GPIO pins do not output any data: 6, 7, 8, 9, 10, 11, 35
The reason for this is that GPIOs 6, 7, 8, 9, 10, 11 are the direct I/O pins of the SPI0 controller that are connected to the SPI flash. Since the SPI flash signals connected to GPIOs 9 and 10 are only active in the case of QOUT or QIO mode or are otherwise high-impedance, these GPIOs can very well be used as inputs and outputs in DOUT or DIO mode, which is controllable in RIOT-OS. This is probably not possible in Arduino core.
Of course, GPIO35 can only be as input because all GPIOs from 34 to 39 of the ESP32 are input-only pins. I thought there is no need to mark it in the pinout.
BTW, the labeling SPI<n>:xxx
, UART<n>:xXD
, PWM<n>:<m>
, ADC<n>
in the pinout is RIOT-OS specific and represents the GPIO usage as configured for the board in the RIOT-OS: https://github.com/RIOT-OS/RIOT/blob/master/boards/esp32-mh-et-live-minikit/include/periph_conf.h
@gschorcht Dear Gunar, thanks for digging deeper into this. I am happy to accept any pull request or concrete suggestions for correction. But I presonally don't have time at the moment to look into this in more detail.
Is there any concrete thing I could fix?
(my notes re above):
@gitcnd it's clear you walked into a minefield and took detailed notes so the rest of us could tread safely. I really appreciate that. I'm not entirely clear on your markup and maybe you could clear this up:
a IOxx b
I've got a few other questions to clarify this great diagram but I'll try to figure things out on my own first so as to not swamp you. Thanks for your work on this!
@gschorcht I think your note about input only pins is worth including in the schematic symbol. It's easy to set this as an input pin instead of bidirectional, and I'd suggest the graphic style of 'input low' as it's an easy way to represent an input pin graphically. The 'output low' could similarly be used for IO that can only be configured as outputs. It would be great to indicate pins that have other special considerations, like those without functioning pull-ups. I could imagine a letter coding, so a pin might be labelled IO_XX(a,b)
and on the table, someone could see that a
means the pull-up doesn't work, b
means in use with an SD card. Any thoughts on symbology @r0oland?
top-left corner of photo; "b" of "1" means that the pin turns to 0 when shorted through 10k resistor to ground when input_pullup is selected. "0" means the pin cannot be used with input_pullup.
"a" means the pin goes from 0 to 1 when shorted via 10k resistor to 3v3 (not using input_pullup of course)
"a" means the pin goes from 0 to 1 when shorted via 10k resistor to 3v3 (not using input_pullup of course)
Thanks for that!
So do a=0 pins have a strong pull-down resistor (smaller than 10k) or do they basically not work as inputs?
I see some Xes on lines connecting GPIO labels, which mostly line up with the pins you noted don't work as outputs. GPIO1 (mislabelled as 3, as you pointed out before) also gets an X... also not output-capable or something else?
Sorry... I've forgotten those now. Might have been me marking "stuff that doesn't work" when I was running my program which tested outputs, before I realized that "doesn't work" is not such a simple concept? I'm away for a few weeks, but happy to do better tests or collaborate on some improved doc when I get back. I've got a bunch of these posters on my wall for a range of MCU's... I use them frequently!
I think that makes sense, it "didn't work" and then there was more to it. Thanks so much for all of your help, I don't have the controller in hand yet but was able to lay out a PCB with the info you and @gschorcht provided. I can see a number of documentation changes that would be worth making here so it's easier to use this board, and I'd be glad to do some testing as well when mine come in.
I can think of a hardware change too; did anyone who made boards with this footprint find those drilled holes were too tight for header pins?
The ESP32 D1 Mini pin labelled "TX" is GPIO03 (wrongly labelled on this PDF as GPIO01) Yes, I know that the ESP32 GPIO pin 03 is "RX" - my guess is that the D1 board labelled "RX" as "TX" for wiring reasons?
The pin labelled "RX" is GPIO01 (wrongly labelled on the PDF as GPIO03).
The following GPIO pins do not output any data: 6, 7, 8, 9, 10, 11, 35 Of the above, pins 9, 10, and 35 are labelled in dark-green with "can be used if not other function is used"... which is not entirely accurate. These pins should be labelled differently: "Cannot be used for output".
It might be worth noting that trying to use pin 6 will crash the chip (since it does).
The code I used to verify the above, is shown below. Use a test-meter on the pins to read the (backwards) binary GPIO pin numbers in morse code (dot=0, dash=1).