Hello everyone!
Got an ESP32 dev board as on a picture (ESP). It works but since I am new into Arduino (but have huge embedded dev background for freescale chips) I got a few questions.
-
ESP32 Technical Reference says there are 3 UARTs available, however I only can see two on the board. Which one is connected to CH340 chip? Can 2 UARTs be accessed/used at the same design with this board ? (I want to interface my ESP32 with LoRa and GSM boards at the same time)
-
Technical Reference says that it is around 500K flash available however this board has 4MB. Are these different flash chips? Is it connected to SPI and if yes - which one? Which address these chips are mapped? Should I change my boards.txt (and how?) to use with my board?
-
All pins, including DAC1/2 are marked as PWM pins. Does that mean I can't do analogWrite to DAC pin to get desired output voltage on this pin?
-
Is there any detailed information on booting process for the board? Boot loader source code?
Thanks!
Hi @vvb333007 ,
Welcome to the forum..
nice board..
- Serial is tied to the CH340 for programming and serial prints debugging..
Serial2 is in your diagram pins 16 and 17..
Serial1 I forget..
Serial1 and Serial2 can be re-assigned to almost any pin..
So yes, you can use both at the same time..
- depends on the board but yes allot of them come with additional SPI RAM..
I believe it's incorporated into ram, so you can malloc it up, but check the docs, I use SPI ram with the cams but cams use it directly not me..
- All PWM pins you can AnalogWrite too..
- Your core source..
ESP32 runs RTOS..
Here's your guide..
Search this board, it's a wealth of knowledge..
have fun.. ~q
1 Like
The flash is partitioned and if you require more program space you can select a different partition scheme from the Arduino IDE "Tools/Partition Scheme"
The tool "esptool.exe" is another way of looking into the ESP32 configuration and is very useful, you can use from the cmd prompt or there is also a gui app
This doc is written for MicroPython but the hardware protocols and pinout is still good for your module
https://docs.micropython.org/en/latest/esp32/quickref.html#uart-serial-bus
1 Like
Thanks for the answers!
It seems like i can call Serial1.setPins() to assign it to any pins I want
You're welcome..
Check this thread..
esp32-uart-hardware-serial-ports-help
~q
Yes it is obviously something strange with pins 16 and 17. I failed to initialize UART1 at these pins. However 18,19 works just fine. Thats strange. When tried pins 16 and 17 i defenitely got something back from the uart but length & content was corrupted :-/. Looks like common problem with this board. CPU is rev. 3.1. and latest Errata has nothing on these pins.
@vvb333007 the hardware uart pins should be
uart0
tx=GPIO1 rx=GPIO3 (also USB)
uart1
tx=GPIO10 rx=GPIO9
uart2
tx=GPIO17 rx=GPIO16
The 30 pin ESP32 Dev Kit you show in the picture does not bring out GPIO9 and GPIO10 to the header pins so it is unlikely you were able to test uart1. UART1 is available on the 36/38 pin dev boards
If you could not get hardware uart 2 working I am not sure why, I need to check it out on one of the 30 pin boards I have and post back at some time
UART1 exists within the ESP32 MCU; but, it is not useable as the physical pins (28, 29) of MCU that are supposed to be connected with UART1, they are now connecting with flash memory. See Fig-1 below:
Fig-1:
1 Like
The attached file may worth reading:
ch-18 ESP32Lec.pdf (1.2 MB)
1 Like
Yeah, docs say that pins 6..11 must not be used as they are used internally for the flash.
I successfuly use UART1 now with SIM800L and it works just fine. UART1 at pins 18 and 19 (HardwareSerial::begin(9600, **18, 19**);
). Also I didn't use Serial1 global variable but created a new instance of HardwareSerial;
I think you are using Serial0 (UART0/Serial) and NOT UART1.
This is the memory organizational digram (Fig-1) of ESP32. The NANO ESP32's one sould be similar.
Figure-1:
1 Like