ESP32 development ① trip into the world of installation development environment ESP32

1 Introduction

    Welcome to the ESP32 the world, from now on, I will lead you slowly uncover ESP32 mystery.

    Before learning ESP32, bloggers hope that readers will have to learn the basic ESP8266 (ESP32 Wifi module, understood as an enhanced version of ESP8266, many of the basic principle is common, so bloggers are not going to repeat).

    ESP32 is a WiFi and Bluetooth system-on-chip (SoC), industry-leading RF performance, low power consumption and high integration advantages.

image

2. Overview

    ESP32 with two 32-bit (double core), LX6 CPU, clocked at up to 240MHz, 7-stage pipeline architecture, flash space is 4MB.

2.1 stable performance

  • ESP32 stable operating temperature range of -40 ° C to + 125 ° C. Self-calibrating integrated circuit implementation of the dynamic voltage adjustment, an external circuit defects can be eliminated and adapt to changing external conditions.

The highly integrated 2.2

  • ESP32 antenna switch, RF balun, power amplifiers, receiving low noise amplifiers, filters, power management functions into one module. ESP32 with minimal external components, you can achieve powerful processing performance, reliable security performance, and Wi-Fi & Bluetooth.

2.3 ultra-low power

  • ESP32 for mobile devices, wearable electronics and IOT applications, the industry has a high level of low power consumption, comprising a fine resolution clock gating, the power saving mode and the dynamic voltage adjustment.

2.4 Wi-Fi & Bluetooth solution

  • ESP32 can run as an application or a system independent from the host MCU devices, UART interface provides Wi-Fi and Bluetooth through SPI / SDIO or I2C /.

3. Module

    Lexin currently supports a variety of modules, details, please refer to the official website Lexin module case .

    Shun bloggers used herein can be derived based on the NodeMcu ESP32 development board.

image

3. Install ESP32 Arduino development environment

3.1 install Arduino IDE software

  • Bloggers chose to install the free version of version 1.8.9, the download is complete extract to a personal directory, for example, I was unpacked to E: \ arduinoIDE \ arduino1.8.9

3.2 install git tools

  • Bloggers recommended Baidu install git tools, there will not be installed Shoubashoujiao

3.3 git Clone arduino-esp32 source

  • Espressif create the folder \ arduinoIDE \ directory under arduino1.8.9: in E
  • In espressif folder right choice Git Bash Here
  • On the pop-CMD tool write

    git clone https://github.com/espressif/arduino-esp32.git

image

  • Confirm Clone, wait for the download is complete git. After the download is complete, open the E: \ arduinoIDE \ arduino1.8.9 \ espressif \ arduino-esp32 \ tools directory, click get.exe (Make sure you follow the python tool)

image

  • Reopen the Arduino IDE software, you will find under the Tools menu boards a lot more ESP32 related options

image

4. The first test code ESP32

Test code :

#include <WiFi.h>

/**
 * Demo:
 *    测试ESP32 demo
 *    打印ESP32模块信息
 *    1.打印Arduino Core For ESP32 版本
 *    2.打印Flash的唯一性芯片id(读者可以思考一下是否可以用来做点什么唯一性参考)
 *    4.打印IDE配置的使用Flash大小
 *    5.打印IDE配置的Flash连接通信的频率
 *    6.打印Flash连接模式:QIO QOUT DIO DOUT,可以理解为Flash传输速率
 * @author 单片机菜鸟
 * @date 2019/07/01
 */

#define LED_BUILTIN  22

int state = HIGH;
 
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  FlashMode_t ideMode = ESP.getFlashChipMode();
  String coreVersion = ESP.getSdkVersion();
  Serial.print(F("Arduino Core For ESP32 Version: "));
  Serial.println(coreVersion);
  Serial.printf("Flash real id(唯一标识符):   %08X\n", ESP.getChipRevision());
  Serial.printf("IDE配置Flash大小: %u KBytes\n", ESP.getFlashChipSize()/1024);
  Serial.printf("IDE配置Flash频率 : %u MHz\n", ESP.getFlashChipSpeed()/1000000);
  Serial.printf("Flash ide mode:  %s\n\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT" : ideMode == FM_DIO ? "DIO" : ideMode == FM_DOUT ? "DOUT" : "UNKNOWN"));
  state = !state;
  digitalWrite(LED_BUILTIN, state);
  delay(1000);
}

Notes :

  • This code may occur following compilation error, please delete ArduinoIDE comes with WIFI library

image

    Compiled by, the following code burned into ESP32 development board, burn the same way with ESP8266 NodeMcu not repeated here to explain.

    Under normal circumstances, the test results will be displayed as follows:

image

5. Pin Mapping relations

image

6. Summary

  • ESP8266 analogy recommended for beginners to learn (refer to detailed ESP8266 blogger tutorials, follow the tutorial will omit a lot of duplicate content, focusing on key content), basically the principle is very similar;
  • Bloggers in personal study group uploaded a series of learning videos for beginners less entry;
  • Learning to make things seem difficult become easier, please continue to focus bloggers subsequent updates of ESP32 tutorials, and strive to dry, do not say too much nonsense.

Guess you like

Origin www.cnblogs.com/danpianjicainiao/p/11117689.html