breadboard
docs

Example project · Start here

ESP32-P4 MicroPython GPIO54

The pinned v1.29.0 rev3 UART/USB Serial-JTAG build runs Python on the P4 and blinks GPIO54, above the first 32 GPIOs. Edit the program in Code or type into its live REPL. Random and SSL material repeat across identical runs; they are not cryptographic entropy.

The ESP32-P4 MicroPython GPIO54 circuit as rendered by the simulator

How it works

The ESP32-P4 has two 400 MHz RISC-V cores and far more GPIOs than the smaller ESP32 chips. This bench runs MicroPython v1.29.0 built from pinned sources for the rev3 chip, with its console on UART and USB Serial-JTAG. The official binary made for earlier chip revisions is incompatible with the rev3 ROM, which is why this build is used.

The circuit is a single LED: GPIO54 drives a 220 Ω resistor and a red LED to ground. Pin numbers above 31 sit in the chip's second set of 32-bit GPIO registers, so blinking GPIO54 shows that the upper pins work as well as the lower ones. The script prints P4 GPIO54 ready and then turns the pin on and off every 500 ms, forever.

What to watch

Serial shows the MicroPython banner and then P4 GPIO54 ready. The red LED blinks once per second. Open Scope on g54 to see a 3.3 V square wave with a one-second period. Random numbers and SSL material repeat between identical runs, because the simulation is deterministic; they are not cryptographic entropy.

What's on the bench

  • ESP32-P4-Function-EV-Board
  • LED
  • Resistor

How it's wired

  • ESP32-P4-Function-EV-Board · g54→Resistor · a
  • Resistor · b→LED · a
  • LED · k→ESP32-P4-Function-EV-Board · gnd

The code

This MicroPython script runs on the emulated board every boot; edit it in Code.

from machine import Pin
from time import sleep_ms
led = Pin(54, Pin.OUT)
print("P4 GPIO54 ready")
while True:
    led.on()
    sleep_ms(500)
    led.off()
    sleep_ms(500)

Try this

  • Change both sleep_ms(500) calls to sleep_ms(100) and press Run on board. The LED blinks five times faster.
  • Add a second 220 Ω resistor and LED on g53 and drive it opposite to GPIO54, so the two LEDs take turns.
  • Print led.value() inside the loop. Serial shows 1 and 0 in step with the LED.

Related projects