Skip to content

Commit aa5c30d

Browse files
committed
Arduino and Documentation
1 parent 882d3c5 commit aa5c30d

File tree

8 files changed

+255
-1
lines changed

8 files changed

+255
-1
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
2+
# Modtronix Specific
13
_Shortcut__*.lnk
2-
esp32MX-E.code-workspace
34

5+
# Visual Studio Code
6+
esp32MX-E.code-workspace
47

58
## Following is from ESP-IDF gitignore file
69
.config

docs/Ethernet/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
# Ethernet
3+
Ethernet is implemented with the internal Ethernet peripheral of the ESP32. The ESP32 is configured to output a 50MHz clock on the GPIO0 pin. The LAN8720 external PHY chip is used.
4+
5+
## Function of STM32F030
6+
It is important that the PHY chip's reset pin only gets released once the ESP32 is outputting the 50MHz signal on GPIO0. This happens during the Ethernet initialization code. The STM32F030 performs this function. It will monitor the GPIO0 pin for a clock signal. If it detects more than 1000 cycles within a 10ms period, it will release the PHY from reset.

docs/GPIO/README.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
2+
3+
# Pinouts & GPIO Pins #
4+
5+
| ESP32 Pin | Analog | DAC/T | Serial | Function | Note |
6+
| --- | --- | --- | --- | --- | --- | --- |
7+
| GPIO0 | ADC2-1 | Touch-1 | | **NOT available**, used by Bootloader and PHY | Default **Pull-Up**. Bootloader Mode=0, Run Mode=1 |
8+
| GPIO1 | | | TX0 | **Available** if USB comm not used. USB TX.| On the ESP32-NodeMCU, this pin is used for the USB to Serial converter TX pin |
9+
| GPIO2 | ADC2-2 | Touch-2 | | **Available** if SD not used. SD Card. 47k PU| Default **Pull-Down**. Must be 0 to enter Bootloader Mode (when GPIO0=0). |
10+
| GPIO3 | | | RX0 | **Available** if USB comm not used. USB RX via jumper. | On the ESP32-NodeMCU, this pin is used for the USB to Serial converter RX pin |
11+
| GPIO4 | ADC2-0 | Touch-0 | | **Available** to user. | |
12+
| GPIO5 | | | VSPI-SS | **Available** by default, LED via Jumper | Default **Pull-up**, use to determine timing of SDIO Slave. |
13+
| GPIO12 | ADC2-5 | Touch-5 | MISO | **Available** to user. | **JTAG** TDI - Default **Pull-down**. If 1 at PU, sets flash = 1.8V, else standard 3.3V. **MUST be 0** at PU for 3.3V board! |
14+
| GPIO13 | ADC2-4 | Touch-4 | MOSI | **Available** to user. | **JTAG** TCK |
15+
| GPIO14 | ADC2-6 | Touch-6 | CLK | **Available** if SD not used.<br>SD Card.| **JTAG** TMS |
16+
| GPIO15 | ADC2-3 | Touch-3 | SS | **Available** if SD not used.<br>SD Card.| **JTAG** TDO - Default **Pull-up**. If 0 at PU, silences boot messages printed by the ROM bootloader.|
17+
| GPIO16 | | | RX2 | **Available** to user. | **NOT AVAILABLE** on Wrover, used for PSRAM CS ! |
18+
| GPIO17 | | | TX2 | **Available** to user. | **NOT AVAILABLE** on Wrover, used for PSRAM CLK ! |
19+
| GPIO18 | | | VSPI-CLK | **NOT available**, used by PHY | |
20+
| GPIO19 | | | VSPI-MISO | **NOT available**, used by PHY | |
21+
| GPIO21 | | | I2C-SDA | **NOT available**, used by PHY | |
22+
| GPIO22 | | | I2C-SCL | **NOT available**, used by PHY | |
23+
| GPIO23 | | | VSPI-MOSI | **NOT available**, used by PHY | |
24+
| GPIO25 | ADC2-8 | DAC 1 | | **NOT available**, used by PHY | |
25+
| GPIO26 | ADC2-9 | DAC 2 | | **NOT available**, used by PHY | |
26+
| GPIO27 | ADC2-7 | Touch-7 | | **NOT available**, used by PHY | |
27+
| GPIO32 | ADC1-4 | Touch-9 | | I2C SCL, can also be\\ **used for user I2C** | XTAL32 |
28+
| GPIO33 | ADC1-5 | Touch-8 | | I2C SCL, can also be\\ **used for user I2C** | XTAL32 |
29+
| GPIO34 | ADC1-6 | | | **Available** by default,\\ User Button via Jumper | **Input Only!** No PU or PW! |
30+
| GPIO35 | ADC1-7 | | | **Available** to user.\\ Input only | **Input Only!** No PU or PW! |
31+
| GPIO36 | ADC1-0 | | | **Available** to user.\\ Input only | **Input Only!** No PU or PW! |
32+
| GPIO39 | ADC1-3 | | | **Available** to user.\\ Input only | **Input Only!** No PU or PW! |
33+
34+
## Other Pins that are not available ##
35+
| ESP32 Pin | Analog | DAC/T | Serial | NodeMCU | Wrover | Note |
36+
| --- | --- | --- | --- | --- | --- | --- |
37+
| GPIO6 | | | | | N/A | **NOT AVAILABLE** used for SPI Flash Wrover/Wroom Modules |
38+
| GPIO7 | | | | | N/A | **NOT AVAILABLE** used for SPI Flash Wrover/Wroom Modules |
39+
| GPIO8 | | | | | N/A | **NOT AVAILABLE** used for SPI Flash Wrover/Wroom Modules |
40+
| GPIO9 | | | RX1 | | N/A | **NOT AVAILABLE** used for SPI Flash Wrover/Wroom Modules |
41+
| GPIO10 | | | TX1 | | N/A | **NOT AVAILABLE** used for SPI Flash Wrover/Wroom Modules |
42+
| GPIO11 | | | | | N/A | **NOT AVAILABLE** used for SPI Flash Wrover/Wroom Modules |
43+
| GPIO16 | | | RX2 | | | **NOT AVAILABLE** on Wrover, used for PSRAM CS ! |
44+
| GPIO17 | | | TX2 | | | **NOT AVAILABLE** on Wrover, used for PSRAM CLK ! |
45+
| GPIO37 | | | | N/A | N/A | Pin is NOT available on NodeMCU and Wrover boards! |
46+
| GPIO38 | | | | N/A | N/A | Pin is NOT available on NodeMCU and Wrover boards! |
47+
48+
49+
## Input Only Pins: 34-39 ##
50+
Pins 34, 35, 36, 37, 38 and 39 cannot be configured as outputs, but they can be used as either digital inputs, analog inputs, or for other unique purposes. Also note that they do not have internal pull-up or pull-down resistors, like the other I/O pins.
51+
52+
GPIO pins 36-39 are an integral part of the ultra low noise pre-amplifier for the ADC – they are wired up to 270pF capacitors, which help to configure the sampling time and noise of the pre-amp.
53+
54+
## Pin Matrix ##
55+
The ESP32 has a pin matrix allowing any of the I/O pins to be assigned following peripherals:
56+
* 3 x SPI interfaces
57+
* 3 x UART interfaces
58+
* 2 x I2C interfaces
59+
* 2 x I2S interfaces
60+
* 16 x PWM outputs
61+
62+
## ADC ##
63+
See ADC pins in table above.
64+
65+
## UART ##
66+
The ESP32 has 3 UART interfaces (0,1 and 2), which provide asynchronous communication (RS232 and RS485) and IrDA support.
67+
Communication speed is up to 5 Mbps. All UARTs provides hardware management of the CTS and RTS signals and software flow
68+
control (XON and XOFF). All of the interfaces can be accessed by the DMA controller or directly by the CPU.
69+
70+
## SPI, HSPI and VSPI ##
71+
The ESP32 has 4 SPI peripherals(SPI0, SPI1, HSPI and VSPI), of which 2(HSPI and VSPI) are available to the user.
72+
73+
SPI Peripherals can be configured for slave and master modes in 1-line full-duplex and 1/2/4-line half-duplex communication modes.
74+
They support the following general-purpose SPI features:
75+
* Four timing modes of the SPI format transfer, which depend on the polarity (POL) and the phase (PHA)
76+
* up to 40 MHz and the divided clocks of 80 MHz
77+
* up to 64-byte FIFO
78+
* Each SPI can be served by DMA
79+
80+
SPI0 and SPI1 are used for the external Flash, and are not available to the user!
81+
This leaves two SPI peripherals for general use, HSPI and VSPI. They have default pins(IOMUX pins), but can also be assigned to any other
82+
I/O pin using the Pin Matrix. When using the default pins, speeds up to 80MBits/sec is possible, where 40MBits/sec is the limit when
83+
using the pin matrix. For details, see [[https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/peripherals/spi_master.html#gpio-matrix-and-iomux|this page]].
84+
85+
The default pins for HSPI are:
86+
* SS = GPIO 15
87+
* CLK = GPIO 14
88+
* MISO = GPIO 12
89+
* MOSI = GPIO 13
90+
91+
The default pins for VSPI are:
92+
* SS = GPIO 5
93+
* CLK = GPIO 18
94+
* MISO = GPIO 19
95+
* MOSI = GPIO 23
96+
97+
## I2C ##
98+
The ESP32 has two I2C bus interfaces which can serve as I2C master or slave, depending on the user’s configuration.
99+
The I2C interfaces support:
100+
* Standard mode (100 kbit/s)
101+
* Fast mode (400 kbit/s)
102+
* Up to 5 MHz, yet constrained by SDA pull-up strength
103+
* 7-bit/10-bit addressing mode
104+
* Dual addressing mode
105+
Users can program command registers to control I2C interfaces, so that they have more flexibility.
106+
107+
## I2S ##
108+
Two standard I2S interfaces are available in ESP32. They can be operated in the master or slave mode, in full
109+
duplex and half-duplex communication modes, and can be configured to operate with an 8-/16-/32-/40-/48-bit
110+
resolution as input or output channels. BCK clock frequency, from 10 kHz up to 40 MHz, is supported. When one
111+
or both of the I2S interfaces are configured in the master mode, the master clock can be output to the external
112+
DAC/CODEC.
113+
Both of the I2S interfaces have dedicated DMA controllers. PDM and BT PCM interfaces are supported.
114+
115+
## PWM ##
116+
The Pulse Width Modulation (PWM) controller can be used for driving digital motors and smart lights. The controller
117+
consists of PWM timers, the PWM operator and a dedicated capture sub-module. Each timer provides timing in
118+
synchronous or independent form, and each PWM operator generates a waveform for one PWM channel. The
119+
dedicated capture sub-module can accurately capture events with external timing.
120+
121+
## LED PWM ##
122+
The LED PWM controller can generate 16 independent channels of digital waveforms with configurable periods
123+
and duties. The 16 channels of digital waveforms operate at 80 MHz APB clock, eight of which have the option of using the 8
124+
MHz oscillator clock. Each channel can select a 20-bit timer with configurable counting range, while its accuracy
125+
of duty can be up to 16 bits within a 1 ms period.
126+
The software can change the duty immediately. Moreover, each channel supports step-by-step duty increasing or
127+
decreasing automatically, which makes it useful for the LED RGB color-gradient generator.
128+
129+
## Touch Sensor ##
130+
The ESP32 has 10 capacitive sensing GPIOs.
131+
132+
## Buttons and LEDs ##
133+
The following pins are used for Buttons and LEDs on common ESP32 based boards:
134+
135+
## JTAG Pins ##
136+
Pins 12 to 15 are also used for JTAG functions. If JTAG debugging is required, these pins should be used in such a way that they will be
137+
available for the JTAG programmer/debugger.
138+
139+
## ESP32 Strapping Pins ##
140+
**GPIO0**, **GPIO5** and **GPIO15** have pull-**up** resistors enabled during power up.\\
141+
**GPIO2** and **GPIO12** have pull-**down** resistors enabled during power up.\\
142+
These pull-up and pull-down resistors can be disabled via software once the device is running.
143+
144+
The ESP32 will enter the serial bootloader when GPIO0 is held low on reset. Otherwise it will run the program in flash.
145+
146+
GPIO0 has an internal pullup resistor, so if it is left unconnected then it will pull high.
147+
148+
Many boards use a button marked "Flash" (or "BOOT" on some Espressif development boards) that pulls GPIO0 low when pressed.
149+
150+
GPIO2 must also be either left unconnected/floating, or driven Low, in order to enter the serial bootloader.
151+
152+
## EN(RST) Pin ##
153+
The EN pin is the 3.3V regulator’s enable pin. It’s pulled up, so connect to ground to disable the 3.3V regulator. This means that you can use
154+
this pin connected to a push button to restart your ESP32, for example. This pin does NOT go low during a software reset of the ESP32.

docs/readme.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ The Eagle Schematics and PCB files for all prototype boards and faceplates are a
6868
| ![ ](../images/fordoc/esp32mx-e_in_enclosure_w800.jpg) | ![ ](../images/fordoc/esp32mx-e_with_proto_db_w800.jpg) |
6969
| ![ ](../images/fordoc/esp32mx-e_as_db_in_enclosure__open_w800.jpg) | ![ ](../images/fordoc/esp32mx-e_as_db_in_enclosure__open_2_w800.jpg) |
7070

71+
72+
# Software Development
73+
The two most popular ways to develop software for the esp32MX-E is using the official "Espressif ESP-IDF" or Arduino. The Arduino option is by far the easyest to get started. But, ESP-IDF provided many more options, and a true RTOS environment.
74+
75+
## Espressif ESP-IDF
76+
For details to use the official ESP-IDF with the esp32MX-E, see [the "idf" examples folder](../examples/idf/README.md).
77+
78+
## Arduino
79+
For details to use the official ESP-IDF with the esp32MX-E, see [the "idf" examples folder](../examples/arduino/README.md).
80+
7181
# STM32F030 Secondary Microcontroller
7282
The esp32MX-E has a secondary STM32F030F4 microcontroller. It controls the PHY reset circuitry, and provides additional I/O via the the I2C port of the ESP32. It can also be programmed with custom firmware.
7383

examples/arduino/README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
2+
# Examples using Arduino IDE
3+
This folder contains examples using Arduino for ESP32. For details, see [ithub.com/espressif/arduino-esp32](https://github.com/espressif/arduino-esp32)
4+
5+
## Installation
6+
The examples provided in this folder have been build using [v1.0.4](https://github.com/espressif/arduino-esp32/releases/tag/1.0.4) of Arduino-ESP32, which uses v3.2 of the Espressif ESP-IDE. For details on installing it, see this page:
7+
https://github.com/espressif/arduino-esp32#installation-instructions
8+
9+
In addition, we also used VS Code, with the Microsoft Arduino Plugin.
10+
11+
## Modifications
12+
Currently the Arduino-ESP32 library does not include support the the esp32MX-E by default. To add it to the list of available boards in the Arduino IDE, the following has to be done:
13+
- After installing the Arduino IDE and the Arduino-ESP32 board, locate the "boards.txt" file in the ESP32 folder. It will be located in the following folder of your Arduino installation: "..\packages\esp32\hardware\esp32\1.0.4"
14+
- Add the code given below to the end of this file(or to top of file after ").
15+
16+
```
17+
esp32mx-e.name=Modtronix ESP32MX-E
18+
19+
esp32mx-e.upload.tool=esptool_py
20+
esp32mx-e.upload.maximum_size=1310720
21+
esp32mx-e.upload.maximum_data_size=327680
22+
esp32mx-e.upload.wait_for_upload_port=true
23+
24+
esp32mx-e.serial.disableDTR=true
25+
esp32mx-e.serial.disableRTS=true
26+
27+
esp32mx-e.build.mcu=esp32
28+
esp32mx-e.build.core=esp32
29+
esp32mx-e.build.variant=esp32mx-e
30+
esp32mx-e.build.board=ESP32MX-E
31+
32+
esp32mx-e.build.f_cpu=240000000L
33+
esp32mx-e.build.flash_mode=dio
34+
esp32mx-e.build.flash_size=4MB
35+
esp32mx-e.build.boot=dio
36+
esp32mx-e.build.partitions=default
37+
esp32mx-e.build.defines=
38+
39+
esp32mx-e.menu.FlashFreq.80=80MHz
40+
esp32mx-e.menu.FlashFreq.80.build.flash_freq=80m
41+
esp32mx-e.menu.FlashFreq.40=40MHz
42+
esp32mx-e.menu.FlashFreq.40.build.flash_freq=40m
43+
44+
esp32mx-e.menu.UploadSpeed.921600=921600
45+
esp32mx-e.menu.UploadSpeed.921600.upload.speed=921600
46+
esp32mx-e.menu.UploadSpeed.115200=115200
47+
esp32mx-e.menu.UploadSpeed.115200.upload.speed=115200
48+
esp32mx-e.menu.UploadSpeed.256000.windows=256000
49+
esp32mx-e.menu.UploadSpeed.256000.upload.speed=256000
50+
esp32mx-e.menu.UploadSpeed.230400.windows.upload.speed=256000
51+
esp32mx-e.menu.UploadSpeed.230400=230400
52+
esp32mx-e.menu.UploadSpeed.230400.upload.speed=230400
53+
esp32mx-e.menu.UploadSpeed.460800.linux=460800
54+
esp32mx-e.menu.UploadSpeed.460800.macosx=460800
55+
esp32mx-e.menu.UploadSpeed.460800.upload.speed=460800
56+
esp32mx-e.menu.UploadSpeed.512000.windows=512000
57+
esp32mx-e.menu.UploadSpeed.512000.upload.speed=512000
58+
59+
esp32mx-e.menu.DebugLevel.none=None
60+
esp32mx-e.menu.DebugLevel.none.build.code_debug=0
61+
esp32mx-e.menu.DebugLevel.error=Error
62+
esp32mx-e.menu.DebugLevel.error.build.code_debug=1
63+
esp32mx-e.menu.DebugLevel.warn=Warn
64+
esp32mx-e.menu.DebugLevel.warn.build.code_debug=2
65+
esp32mx-e.menu.DebugLevel.info=Info
66+
esp32mx-e.menu.DebugLevel.info.build.code_debug=3
67+
esp32mx-e.menu.DebugLevel.debug=Debug
68+
esp32mx-e.menu.DebugLevel.debug.build.code_debug=4
69+
esp32mx-e.menu.DebugLevel.verbose=Verbose
70+
esp32mx-e.menu.DebugLevel.verbose.build.code_debug=5
71+
72+
##############################################################
73+
```

examples/arduino/blink/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
# Blink Example
3+
4+
This is a very basic example that blinks the LED on the esp32MX-E board, using a FreeRTOS task.
5+
6+
It uses ESP-IDF, the official development framework for the ESP32 chip from Espressif(manufacturers of theee ESP32). For details, see [github.com/espressif/esp-idf](https://github.com/espressif/esp-idf)
7+
8+
See the [README.md](../README.md) file in the upper level 'examples/idf' directory for more information about examples.

images/esp32MX-E_schematics_pg1.png

26 KB
Loading

images/esp32MX-E_schematics_pg2.png

-6.1 KB
Loading

0 commit comments

Comments
 (0)