0% found this document useful (0 votes)
122 views

Topic 15 - Using MicroPython On ESP32 (Slides)

The document discusses using MicroPython on ESP32 microcontrollers. It describes the ESP32's hardware components including its CPU, memory, wireless capabilities, and peripheral interfaces. It then explains how to set up a MicroPython development environment on the ESP32 using tools like esptool and PyCharm. Finally, it provides an overview of the MicroPython libraries available for controlling hardware functions and peripherals of the ESP32.

Uploaded by

Wesley Falcão
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
122 views

Topic 15 - Using MicroPython On ESP32 (Slides)

The document discusses using MicroPython on ESP32 microcontrollers. It describes the ESP32's hardware components including its CPU, memory, wireless capabilities, and peripheral interfaces. It then explains how to set up a MicroPython development environment on the ESP32 using tools like esptool and PyCharm. Finally, it provides an overview of the MicroPython libraries available for controlling hardware functions and peripherals of the ESP32.

Uploaded by

Wesley Falcão
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Topic 15

Using MicroPython on ESP32

Professor Peter YK Cheung


Dyson School of Design Engineering

URL: www.ee.ic.ac.uk/pcheung/teaching/DE1_EE/
E-mail: [email protected]
PYKC 9 June 2020 DE 1.3 - Electronics 1 Topic 15 Slide 1
ESP32 IoT Microcontroller (1)

Bluetooth Embedded flash memory

Radio

Wi-Fi

Cryptographic Hardware CPU core & memory Peripheral Interface

Real-time clock & Low Power processor unit

PYKC 9 June 2020 DE 1.3 - Electronics 1 Topic 15 Slide 2


ESP32 CPU Core & Memory

PYKC 9 June 2020 DE 1.3 - Electronics 1 Topic 15 Slide 3


ESP32 RTC and Power Management Sub-system

PYKC 9 June 2020 DE 1.3 - Electronics 1 Topic 15 Slide 4


ESP32 Crypto Hardware

PYKC 9 June 2020 DE 1.3 - Electronics 1 Topic 15 Slide 5


ESP32 wireless links

PYKC 9 June 2020 DE 1.3 - Electronics 1 Topic 15 Slide 6


ESP32 Peripheral Interfaces & SPI RAM

PYKC 9 June 2020 DE 1.3 - Electronics 1 Topic 15 Slide 7


Heltec ESP32 module

PYKC 9 June 2020 DE 1.3 - Electronics 1 Topic 15 Slide 8


ESP32 with MicroPython (uPy)

Flash ESP32
via esptool
PyCharm IDE MicroPython firmware
in flash ROM

machine esp network


Directory
sys esp32 neopixel

time os math

On-chip ROM for


programs
Editor
boot.py

main.py
oled.py
hello.py rotary.py
REPL uPy terminal

PYKC 9 June 2020 DE 1.3 - Electronics 1 Topic 15 Slide 9


Lab 4A – Setting up the MicroPython environment

Task 1 Task 2 Task 3 Task 4

Install Erase and Install


Install PyCharm
CP2102 flash uPy to
esptool IDE with
drive driver ESP32
uPy plug-in

Tasks 7 Task 8
Tasks 5 & 6

Explore uPy Flashing


via REPL “Hello world!” Display on
onto ESP32 OLED

PYKC 9 June 2020 DE 1.3 - Electronics 1 Topic 15 Slide 10


MicroPython Documentation

PYKC 9 June 2020 DE 1.3 - Electronics 1 Topic 15 Slide 11


MicroPython Library Functions

Python math – mathematical functions (e.g. sin, pi)


standard lib sys – system specific functions (e.g. sys.argv)

MicroPython machine – functions related to


Libraries processor itself
esp – functions related to the board

MicroPython time – functions related to hardware timer


and ESP32 Various class libraries to drive
specific lib peripherals

PYKC 9 June 2020 DE 1.3 - Electronics 1 Topic 15 Slide 12


pyb - Class Library

class PWM – PWM signal generation


class ADC – analog to digital conversion
class DAC – digital to analog converson (2 channels)
class LED – LED objects to control on board LEDs
machine Classes
class Pin – control I/O pins
class I2C – control I2C interface
class Timer – control hardware timers
class SPI – control SPI interface

PYKC 9 June 2020 DE 1.3 - Electronics 1 Topic 15 Slide 13

You might also like