ESP λͺ¨λμ λΈλ£¨ν¬μ€, μμ΄νμ΄λ₯Ό κΈ°λ³Έμ μΌλ‘ μ¬μ©ν μ μμΌλ©° 36κ°μ GPIOκ° μ¬μ© κ°λ₯νλ€. λν λ³λλ‘ λ³΄λ λΌμ΄λΈλ¬λ¦¬λ₯Ό μ€μΉνκΈ°λ§ νλ©΄ μλμ΄λ Έ IDEλ‘ μ λ‘λκ° κ°λ₯νλ€. NodeMCU 보λλ μ΄ ESP32 μΉ©/λͺ¨λμ κ°λ¨νκ² μ¬μ©ν μ μλ κ°λ° 보λμ΄λ€.
ESP32 Peripheral
- 18 ADC(Analog-to-Digital Converter) channel
- 3 SPI
- 3 UART
- 2 I2C
- 16 PWM
- 2 DAC (Digital-to-Analog Converter)
- 2 I2S
- 10 Capacitive sensing GPIO
ADCμ DACλ νΉμ νμμλ§ μ¬μ©ν μ μμ§λ§ λλ¨Έμ§λ€μ μ½λμμ μ€μ νλλ‘ μ¬μ©μ΄ κ°λ₯νλ€. μ΄μ κ°μ΄ νμ λ°λ‘ μ½λμμ μ€μ ν΄μ μ¬μ©ν μ μμ§λ§, κΈ°λ³Έμ μΌλ‘ κ³ μ λμ΄ μλ κΈ°λ₯λ μλ€. μλ ν 맡μ λνλμλ€.
ESP32 PIN MAP
ESP32 νλ³ κΈ°λ₯
INPUT Only Pins
μ λ ₯ μ μ© ν, λ΄λΆ νμ /νλ€μ΄ μμ, μΆλ ₯μΌλ‘ μ¬μ©λΆκ°
- GPIO 34
- GPIO 35
- GPIO 36
- GPIO 37
- GPIO 38
- GPIO 39
SPI flash intergrated on the ESP-WROOM-32
μΌλΆ 보λλ€μ GPIO 6-11 νλ μ¬μ© κ°λ₯νμ§λ§ ESP-WROOM-32 μΉ©μ λ΄μ₯λ SPI Flashμ μ°κ²°λμ΄μκΈ° λλ¬Έμ ν΄λΉ μΉ©μ μ¬μ©νλ κ²½μ° λ€λ₯Έ μ©λ μ¬μ©μ κΆμ₯νμ§ μμ
- GPIO 6 (SCK/CLK)
- GPIO 7 (SDO/SD0)
- GPIO 8 (SDI/SD1)
- GPIO 9 (SHD/SD2)
- GPIO 10 (SWP/SD3)
- GPIO 11 (CSC/CMD)
Capacitive Touch GPIO
ESP32λ μ μ μ ν°μΉ μ λ ₯μ΄ κ°λ₯, 10κ°μ ν°μΉ μ λ ₯ μΌμ μ΄μ© κ°λ₯
- T0 (GPIO 4)
- T1 (GPIO 0)
- T2 (GPIO 2)
- T3 (GPIO 15)
- T4 (GPIO 13)
- T5 (GPIO 12)
- T6 (GPIO 14)
- T7 (GPIO 27)
- T8 (GPIO 33)
- T9 (GPIO 32)
ADC (Analog-to-DIgital Converter)
18κ°μ 12-bit(0-4095(3.3V)) ADC μ±λ
- ADC1_CH0 (GPIO 36)
- ADC1_CH1 (GPIO 37)
- ADC1_CH2 (GPIO 38)
- ADC1_CH3 (GPIO 39)
- ADC1_CH4 (GPIO 32)
- ADC1_CH5 (GPIO 33)
- ADC1_CH6 (GPIO 34)
- ADC1_CH7 (GPIO 35)
- ADC2_CH0 (GPIO 4)
- ADC2_CH1 (GPIO 0)
- ADC2_CH2 (GPIO 2)
- ADC2_CH3 (GPIO 15)
- ADC2_CH4 (GPIO 13)
- ADC2_CH5 (GPIO 12)
- ADC2_CH6 (GPIO 14)
- ADC2_CH7 (GPIO 27)
- ADC2_CH8 (GPIO 25)
- ADC2_CH9 (GPIO 26)
DAC (Digital-toAnalog Converter)
2κ°μ 8-bit DAC μ±λ
- DAC1 (GPIO 25)
- DAC2 (GPIO 26)
RTC GPIO
There is RTC GPIO support on the ESP32. The GPIOs routed to the RTC low-power subsystem can be used when the ESP32 is in deep sleep. These RTC GPIOs can be used to wake up the ESP32 from deep sleep when the Ultra Low Power (ULP) co-processor is running. The following GPIOs can be used as an external wake up source.
- RTC_GPIO0 (GPIO 36)
- RTC_GPIO3 (GPIO 39)
- RTC_GPIO4 (GPIO 34)
- RTC_GPIO5 (GPIO 35)
- RTC_GPIO6 (GPIO 25)
- RTC_GPIO7 (GPIO 26)
- RTC_GPIO8 (GPIO 33)
- RTC_GPIO9 (GPIO 32)
- RTC_GPIO10 (GPIO 4)
- RTC_GPIO11 (GPIO 0)
- RTC_GPIO12 (GPIO 2)
- RTC_GPIO13 (GPIO 15)
- RTC_GPIO14 (GPIO 13)
- RTC_GPIO15 (GPIO 12)
- RTC_GPIO16 (GPIO 14)
- RTC_GPIO17 (GPIO 27)
PWM
μΆλ ₯ κ°λ₯ν λͺ¨λ νμ PWMμΌλ‘ μ¬μ© κ°λ₯, λ°λΌμ μ λ ₯ μ μ© νμΈ 34-39λ PWMμΌλ‘ μ¬μ© λΆκ°λ₯
νμν νλΌλ―Έν°
- Signal Frequency
- Duty Cycle
- PWM Channel
- μ νΈλ₯Ό μΆλ ₯ν GPIOν
I2C
ESP32μλ λ κ°μ I2C μ±λμ΄ μμΌλ©° λͺ¨λ νμ SDA λλ SCLλ‘ μ€μ ν μ μμ. Arduino IDEμ ν¨κ» ESP32λ₯Ό μ¬μ©ν κ²½μ° κΈ°λ³Έ I2C νμ λ€μκ³Ό κ°μ
- GPIO 21 (SDA)
- GPIO 22 (SCL)
SPI
By default, the pin mapping for SPI is:
SPI | MOSI | MISO | CLK | CS |
---|---|---|---|---|
VSPI | GPIO 23 | GPIO 19 | GPIO 18 | GPIO 5 |
HSPI | GPIO 13 | GPIO 12 | GPIO 14 | GPIO 15 |
Interupt
All GPIOs can be configured as interrupts.
Strapping Pin
μ΄λ ESP32λ₯Ό λΆν λ‘λ λλ νλμ λͺ¨λλ‘ μ ννλ λ° μ¬μ©λ©λλ€. USB/Serialμ΄ λ΄μ₯λ λλΆλΆμ κ°λ° 보λμμ μ΄λ¬ν νμ μνμ λν΄ κ±±μ ν νμκ° μμ΅λλ€. 보λλ νμ μ λ©Έ λλ λΆν λͺ¨λμ μ ν©ν μνλ‘ λ‘λλ€. ESP32 λΆν λͺ¨λ μ νμ λν μμΈν λ΄μ©μ μ¬κΈ°μμ νμΈν μ μμ΅λλ€.
κ·Έλ¬λ μ΄λ¬ν νμ μ£Όλ³ μ₯μΉκ° μ°κ²°λμ΄ μλ κ²½μ° μ μ½λλ₯Ό μ λ‘λνλ €κ³ νλ©΄ ESP32κ° μ νμ¨μ΄λ‘ κΉλ°μ΄κ±°λ 보λλ₯Ό μ¬μ€μ νλ λ° λ¬Έμ κ° μμ μ μμ΅λλ€. μΌλΆ μ£Όλ³ μ₯μΉκ° μ€νΈλ© νμ μ°κ²°λμ΄ μλλ° μ½λλ₯Ό μ λ‘λνκ±°λ ESP32λ₯Ό κΉλ°μ΄λ λ° λ¬Έμ κ° μλ κ²½μ°, μ£Όλ³ μ₯μΉκ° ESP32λ₯Ό μ¬λ°λ₯Έ λͺ¨λλ‘ μ ννμ§ λͺ»νκΈ° λλ¬ΈμΌ μ μμ΅λλ€. μ¬λ°λ₯Έ λ°©ν₯μΌλ‘ μλ΄νλ €λ©΄ λΆν λͺ¨λ μ ν μ€λͺ μλ₯Ό μ½μ΄ 보μμμ€. μ¬μ€μ , κΉλ°μ λλ λΆν νμλ μ΄λ¬ν νμ΄ μμλλ‘ μλν©λλ€.
- GPIO 0
- GPIO 2
- GPIO 4
- GPIO 5 (must be HIGH during boot)
- GPIO 12 (must be LOW during boot)
- GPIO 15 (must be HIGH during boot)
Pins High at Boot
μΌλΆ GPIOλ λΆν λλ μ¬μ€μ μ μνλ₯Ό HIGHλ‘ λ³κ²½νκ±°λ PWM μ νΈλ₯Ό μΆλ ₯ν¨
- GPIO 1
- GPIO 3
- GPIO 5
- GPIO 6 to GPIO 11 (connected to the ESP32 integrated SPI flash memory β not recommended to use).
- GPIO 14
- GPIO 15
Enable (EN)
ENμ 3.3V λ κ·€λ μ΄ν°μ EnableνμΌλ‘, νμ μ΄ λμ΄ μμ΄ GNDμ μ°κ²°νλ©΄ 3.3V λ κ·€λ μ΄ν°κ° λΉνμ±νλ¨. μ΄ νμ νΈμ¬λ²νΌμ μ°κ²°ν΄ λμΌλ©΄ ESP32λ₯Ό μ¬μλνλλ° μ¬μ© κ°λ₯
GPIO current drawn
The absolute maximum current drawn per GPIO is 40mA according to the βRecommended Operating Conditionsβ section in the ESP32 datasheet.
ESP32 Built-In Hall Effect Sensor
The ESP32 also features a built-in hall effect sensor that detects changes in the magnetic field in its surroundings.
μλμ΄λ Έ IDEμμ μ¬μ©νλ κ²½μ° ν λ²νΈ D23 (pin15/GPIO 23)νμ β23βμΌλ‘ μ¬μ©νλ©΄ λ¨
Reference
- https://github.com/espressif/arduino-esp32