ESP32-S3-Pico

From Waveshare Wiki
Jump to: navigation, search
ESP32-S3-Pico
ESP32-S3-Pico.jpg

Main Chip: ESP32-S3
Interface: USB Type-C
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

{{{name6}}}

Overview

Introduction

The ESP32-S3-Pico is a low-cost, high-performance microcontroller development board in a compact size and with rich peripheral interfaces.

Adopts ESP32-S3R2 as the main chip, which is an MCU chip with integrated 2.4 GHz Wi-Fi and Bluetooth 5 (LE).
The interface chips are CH343 and CH334, so you can enjoy USB and UART development with a single USB-C port, and no more trouble switching interfaces.

The DC-DC chip adopts MP28164, a high-efficiency buck-boost chip, which adopts PWM fixed-frequency current control mode to optimize circuit stability and response speed.

You can choose ESP-IDF, Arduino, MicroPython, or other development environments in software so that you can easily and quickly get started and apply it to the product.

Features

  • Adopts ESP32-S3R2 as the main chip.
  • Comes with Xtensa 32-bit LX7 dual-core processor, capable of running at 240 MHz.
  • Integrated 512KB SRAM, 384KB ROM, 2MB PSRAM, 16MB Flash memory.
  • Type-C connector, easier to use.
  • Onboard CH343 and CH334 chips can meet the needs of USB and UART development via a Type-C interface.
  • Onboard DC-DC chip MP28164, high-efficiency DC-DC buck-boost chip with load current up to 2A.
  • Supports multiple low-power operating states, the adjustable balance between communication distance, data rate, and power consumption to meet the power requirements of various application scenarios.
  • 27 × multi-function GPIO headers.
  • Castellated module allows soldering directly to carrier boards.
  • Rich peripheral interfaces, including full-speed USB OTG, SPI, I2C, UART, ADC, PWM, and DVP (8-bit ~ 16-bit camera interface), LCD interfaces (8-bit ~ 16-bit parallel RGB, I8080, MOTO6800), etc. to achieve various functions flexibly.

Pinout Definition

ESP32-S3-Pico03.jpg

  • Note: SPI, I2C, UART, and other interfaces can be mapped to most GPIOs through the GPIO Matrix and IO MUX, see the ESP32-S3 datasheet for details.

Dimensions

ESP32-S3-Pico 04.jpg

Working with ESP-IDF

This chapter introduces the setup of the ESP-IDF environment, including the installation of Visual Studio, the Espressif IDF plugin, program compilation and download, as well as testing of sample programs. It aims to help users gain proficiency with the development board for secondary development.

Environment Setup

Download and Install VSCode

  • Open the download page of the official VSCode website, and select the corresponding system and system bit to download.

ESP32-S3-Pico 05.jpg

  • After running the installation package, the rest can be installed by default, but here for the subsequent experience, it is recommended to check boxes 1, 2, and 3

ESP32-S3-Pico 06.jpg

    • After the first and second items are enabled, you can open VSCode directly by right-clicking files or directories, which can improve the subsequent user experience.
    • After the third item is enabled, you can select VSCode directly when you choose how to open it.
The environment setup is conducted on the Windows 10 system. Linux and Mac users can refer to the ESP-IDF Environment Setup

Installing the Espressif IDF Plugin

  • The "online installation" is generally recommended for installing the Espressif IDF plugin. If online installation is not possible due to network issues, then "offline installation" can be used.
  • For the tutorial on installing the Espressif IDF plugin, please refer to: Install Espressif IDF Plugin Tutorial

Run the First ESP-IDF Demo

If you are just getting started with ESP32 and ESP-IDF, and you don't know how to create, compile, flash, and run ESP-IDF ESP32 programs, then please expand and take a look. Hope it can help you!

New Project

ESP32-S3-AMOLED-1.91-study-01.png

ESP32-S3-AMOLED-1.91-study-02.png

Create Demo

  • Using the shortcut F1, enter esp-idf:show examples projects

ESP32-S3-AMOLED-1.91-study-03.png

  • Select your current IDF version

ESP32-S3-AMOLED-1.91-study-04.png

  • Take the Hello world demo as an example

①Select the corresponding demo
②Its readme will state what chip the demo applies to (how to use the demo and the file structure are described below, omitted here)
③Click to create the demo
ESP32-S3-AMOLED-1.91-study-05.png

  • Select the path to save the demo, and require that the demos cannot use folders with the same name

ESP32-S3-AMOLED-1.91-study-06.png

Modify COM port

  • The corresponding COM ports are shown here, click to modify them
  • Please select the COM ports according to your device (You can view it from the device manager)
  • In case of a download failure, please press the Reset button for more than 1 second or enter download mode, and wait for the PC to recognize the device again before downloading once more

ESP32-S3-AMOLED-1.91-study-07.png

Modify driver object

  • Select the object we need to drive, which is our main chip ESP32S3

ESP32-S3-AMOLED-1.91-study-08.png

  • Choose the path to openocd, it doesn't affect us here, so let's just choose one

ESP32-S3-AMOLED-1.91-study-09.png


Introduction to other status bar functions

①.ESP-IDF Development Environment Version Manager, when our project requires differentiation of development environment versions, it can be managed by installing different versions of ESP-IDF. When the project uses a specific version, it can be switched to by utilizing it
②.Device flashing COM port, select to flash the compiled program into the chip
③.Select set-target chip model, select the corresponding chip model, for example, ESP32-P4-NANO needs to choose esp32p4 as the target chip
④.menuconfig, click it to Modify sdkconfig configuration file Project configuration details
⑤.fullclean button, when the project compilation error or other operations pollute the compiled content, you can clean up all the compiled content by clicking it
⑥.Build project, when a project satisfies the build, click this button to compile
⑦.Current download mode, the default is UART
⑧.flash button, when a project build is completed, select the COM port of the corresponding development board, and click this button to flash the compiled firmware to the chip
⑨.monitor enable flashing port monitoring, when a project passes through Build --> Flash, click this button to view the log of output from flashing port and debugging port, so as to observe whether the application works normally
⑩.Debug
⑪.Build Flash Monitor one-click button, which is used to continuously execute Build --> Flash --> Monitor, often referred to as “little flame”


ESP32-S3-AMOLED-1.91-study-10.png

Compile, flash and serial port monitor

  • Click on the all-in-one button we described before to compile, flash and open the serial port monitor.

ESP32-S3-AMOLED-1.91-study-11.png

  • It may take a long time to compile especially for the first time

ESP32-S3-AMOLED-1.91-study-12.png

  • During this process, the ESP-IDF may take up a lot of CPU resources, so it may cause the system to lag
  • If it is the first time to flash the program for a new project, you will need to select the download method, and select UART

ESP32-S3-AMOLED-1.91-study-13.png

  • This can also be changed later in the Download methods section (click on it to pop up the options)

ESP32-S3-AMOLED-1.91-study-14.png

  • As it comes with the onboard automatic download circuit, it can be downloaded automatically without manual operation
  • After successful download, it will automatically enter the serial monitor, you can see the chip output the corresponding information and be prompted to restart after 10S

ESP32-S3-AMOLED-1.91-study-15.png


Use the IDF demos

The following takes 'ESP32-S3-LCD-1.47-Demo’ as an example to introduce the two opening methods of the project and the general steps of use, and the detailed explanation of the ESP-IDF project. If you use other projects, the operation steps can be applied similarly.

Open in the software

  • Open VScode software and select the folder to open the demo

ESP32-S3-AMOLED-1.91-study-16.png

  • Select the provided ESP-IDF example and click to select the file (located in the Examples/Demo/ESP-IDF path)

ESP32-S3-AMOLED-1.91-study-17.png


Open from outside the software

  • Select the project directory correctly and open the project, otherwise it will affect the compilation and flashing of subsequent programs

ESP32-S3-AMOLED-1.91-study-18.png

  • After connecting the device, select the COM port and model, click below to compile and flash to achieve program control

ESP32-S3-AMOLED-1.91-study-19.png

ESP-IDF Project Details

  • Component: The components in ESP-IDF are the basic modules for building applications, each component is usually a relatively independent code base or library, which can implement specific functions or services, and can be reused by applications or other components, similar to the definition of libraries in Python development.
    • Component reference: The import of libraries in the Python development environment only requires to "import library name or path", while ESP-IDF is based on the C language, and the importing of libraries is configured and defined through CMakeLists.txt.
    • The purpose of CmakeLists.txt: When compiling ESP-IDF, the build tool CMake first reads the content of the top-level CMakeLists.txt in the project directory to read the build rules and identify the content to be compiled. When the required components and demos are imported into the CMakeLists.txt, the compilation tool CMake will import each content that needs to be compiled according to the index. The compilation process is as follows:

ESP32-P4 VSCode ESP-IDF GettingStart 240906 02.png

Demo

  • ESP32-S3-GEEK Demo
Demo Basic Description
Wireless_USB_flash_drive The ESP32-S3-GEEK can be used as a USB disk with wireless access capabilities

Wireless_USB_flash_drive

Program Description


  • This routine allows the ESP32-S3-GEEK to be used as a USB disk with wireless access capabilities. When combined with SD card storage, it can become a high-capacity wireless storage device. Additionally, you can connect to the ESP32-S3-GEEK's hotspot to upload and download via an HTTP file server, greatly facilitating user operations. It is suitable for learning the USB MSC functionality of the ESP32, as it can act as a storage device connected to a USB host, supporting various storage methods, with callback functions to handle various events, and testing for stability and reliability
  • To exit the program, simply press the boot button and power cycle the device

Hardware connection


  • Insert the TF card into the development board
  • Connect the development board to the computer

Code analysis


  • init_fat():Initializes the FAT file system. Depending on the configuration, it mounts either the internal flash memory or an external TF card
    • If using internal flash memory, a specific function is selected for mounting based on the ESP-IDF version
    • If using an external TF card, it is initialized and mounted according to the interface type (SPI or SDIO)
  • app_main ():The main function that coordinates the initialization of various parts of the program, including file storage, Wi-Fi (if configured), and USB MSC
    • Calls init_fat to initialize file storage
    • If Wi-Fi is configured, it initializes and starts the file server
    • Initializes tinyUSB and installs the driver

Code Burning


  • Ensure the TF card is installed
  • Select the model (esp32s3) and port
  • Download via UART
  • Burn the program

Result demonstration


  • After programming, unplug and plug the ESP32-S3-GEEK again, and you can see a new USB flash driver

ESP32-S3 wireless disk02.png

  • You can open the USB drive to browse through the files on the TF card and perform various operations such as adding, deleting, modifying, and checking files

ESP32-S3 wireless disk03.png

  • Enter the PC's WIFI setting, connect to the ESP32-S3-GEEK's AP, and input the password of "Waveshare"
  • After connecting successfully, open the browser, and log in to IP: 192.168.4.1

ESP32-S3-GEEK Demo03.png

  • After login successfully, you can upload and download files wirelessly

ESP32-S3-GEEK-demo-10.png


MicroPython

Flash Firmware

1. For ESP32-S3-Pico, please download firmware: Click here to download the burner and firmware.
For ESP32-S3-DEV-KIT-N8R8, please download firmware: ESP32-S3-DEV-KIT-N8R8-micropython-firmware or download from micropython
2. Unzip the package downloaded before and enter.

ESP32-S3-Pico 54.jpg

3. Enter flash_download_tool_3.9.4 folder and open flash_download_tool_3.9.4.exe.

ESP32-S3-Pico 51.jpg

4. Choose the corresponding chip, choose ESP32-S3.

ESP32-S3-Pico 52.jpg

5. Choose the corresponding COM port, we have configured it and you just click Start to download.

ESP32-S3-Pico 53.jpg

    • ①Choose the COM port.
    • ②Download key.

Install Thonny

1. Open official Thonny website.

ESP32-S3-Pico 58.jpg

2. Select the corresponding system and version, here I choose "Windows", and the mouse has to move to Windows, only then will the corresponding information be displayed.

ESP32-S3-Pico 55.jpg

3. Just install it all the way by default.

ESP32-S3-Pico 56.jpg

4. Finish.

ESP32-S3-Pico 57.jpg

Get the Demo

1. Click here to download the demo.
2. Unzip the demo zip file.

ESP32-S3-Pico 89.jpg

Run the Demo

1. Open Thonny and choose Configure Interpreter.

ESP32-S3-Pico 90.jpg

2. Choose MicroPython (ESP32) as the Interpreter.

ESP32-S3-Pico 91.jpg

3. Click OK to save.

ESP32-S3-Pico 92.jpg

4. Click Stop or Ctrl + F2.

ESP32-S3-Pico 93.jpg

5. You can see the MicroPython version information and the board name.

ESP32-S3-Pico 94.jpg

6. Open the files.

ESP-S3-Pico 95.jpg

7. Choose our demo file and open a demo, here we choose a wifi-scan demo.

ESP-32-Pico 96.jpg

  • ①Current local file directory.
  • ②The demo we want to open is wifi-scan.py.
  • ③ESP32-S3-PICO directory.
8. Click to run or press F5.

ESP-32-Pico 97.jpg

9. Please wait a moment, and you can see the wifi output information of esp32-s3-pico.

ESP-32-Pico 98.jpg

MicroPython Demo Description

For better using experience, we include a py file in the firmware。 The following code is used to organize scattered GPIO pins in the order of Pico pins. The source code is shown below:

from micropython import const
D0 = const(11)
D1 = const(12)
D2 = const(13)
D3 = const(14)
D4 = const(15)
D5 = const(16)
D6 = const(17)
D7 = const(18)
D8 = const(33)
D9 = const(34)
D10= const(35)
D11= const(36)
D12= const(37)
D13= const(38)
D14= const(39)
D15= const(40)
D16= const(42)
D17= const(41)
D18= const(1)
D19= const(2)
D20= const(4)
D21= const(5)
D22= const(6)
D26= const(7)
D27= const(8)
D28= const(9)

A1= const(7)
A2= const(8)
A3= const(9)

RGB_PIN= const(21)
USB_ADC= const(3)

1-GPIO

Blink

  • GPIO10 on the Raspberry Pi Pico (ESP32-S3 GP35) blinks at at 1-sec interval.

Key

  • Read the level of the GPIO3 on the Raspberry Pi Pico (corresponding to ESP32-S3 GP13).
  • If it is at a low level, press the key to flip the LED level.

2-PWM

Fade

  • Output PWM frequency of GPIO12 on the Raspberry Pi PICO (corresponding to ESP32-S3 GP37) at 1000Hz, with a duty cycle increasing or decreasing between 0% and 100%.

Siren

  • Configure GPIO12 on the Raspberry Pi PICO (corresponding to ESP32-S3 GP37) to output PWM with a duty cycle of 30%, and the frequency increases or decreases between 600Hz to 1400Hz.

3-UART

UART

  • Using GPIO0 (ESP32-S3 GP11) and GPIO1 (ESP32-S3 GP12) on the Raspberry Pi Pico as the TX and RX pins for UART, perform UART echo.

4-I2C

I2C-OLED

  • Using GPIO6 (ESP32-S3 GP17) and GPIO7 (ESP32-S3 GP18) on the Raspberry Pi Pico as the SDA and SCL pins for I2C, drive the 1.5-inch OLED module.

I2C-SCAN

  • Using GPIO8 (ESP32-S3 GP33) and GPIO9 (GP34 of ESP32-S3) on the Raspberry Pi Pico as the SDA and SCL pins for I2C, scan the device addresses on the I2C bus.

5-SPI

Pico-LCD-1.3

  • Drive the PICO-LCD-1.3 module.

6-ADC

adc

  • Sequentially read the voltage values of GPIO26-29 pins on the Raspberry Pi PICO and output the information.

7-RGB

rgb

  • Lights up the onboard RGB-LEDs and keeps on changing colors.

8-SYS

FLASH-SIZE

  • Output remaining FLASH memory.

RAM-SIZE

  • Output the remaining and used RAM space.

RTC

  • Set RTC time and read the RTC value in a loop.

SLEEP

  • Set the ESP32-S3 to deep sleep for 10 seconds, it will automatically reset and reboot when it reaches the sleep time.

WDT

  • Set watchdog and wait for watchdog reset.

9-WIFI

Scan

  • Scan the surrounding wifi signal and display the related information.

Resource

Schematic

Demo

Software

ESP32-S3

CH343

UART

Datasheet

ESP32-S3

CH343

Official Documentation

Official ESP32 Document

Official MicroPython Document

FAQ



 Answer:

You can connect to the VBUS pin with 5V power. (it is not a wide range, but just 5V).

{{{5}}}


Support



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)