Espressif · ESP32-DevKitC-32E

ESP32-DevKitC

Espressif ESP32-DevKitC V4: an ESP32-WROOM-32E module (two Xtensa LX6 cores, Wi-Fi, Bluetooth) with a USB-UART bridge.

EmbassyZephyrEspressif
ESP32-DevKitCEspressif · ESP32 · 2 × Xtensa LX6 · 240 MHz · 520 KB · bare metalESP32ESP32-DevKitC1234567891can0 CANTWAI (add a transceiver) · tx GPIO21, rx GPIO222uart0 UARTUART0 (USB bridge) · tx GPIO1, rx GPIO33usb USBUSB (power and UART)4radio RadioWi-Fi / Bluetooth5pwr Power5 V USB6v3v3 Power3V3 pin7v5 Power5V pin (from USB)8button GPIOBOOT Button (low when pressed) · io GPIO09i2c0 I²CI2C0 · sda GPIO21, scl GPIO22

En bref

ESP32 development board: two 240 MHz Xtensa LX6 cores, 520 KB SRAM, Wi-Fi and Bluetooth. The TWAI (CAN) controller can be routed to most GPIOs and needs an external transceiver.

Horloge240 MHz
Flash4 MB
RAM520 KB
GPIO26
Logique3.3 V

Caractéristiques

Lues dans le modèle de la carte, dans le store.

Processeur
ESP32 · 2× Xtensa LX6 · chip "esp32"
Horloge
240 MHz
Flash
4 MB
RAM
520 KB
Broches GPIO
26
CAN (ADC)
ADC1 6 ch 12-bit, ADC2 10 ch 12-bit
Niveau logique
3.3 V
Alimentation
5 V USB (in); 3V3 pin: 3.3 V; 5V pin (from USB): 5 V
Courant par broche
pas encore dans le modèle de la carte
Bus
UART ×3, I²C ×2, SPI ×2, CAN ×1
Sur n’importe quelle broche
UART, I²C, SPI, CAN, PWM
Tourne
sans OS (bare metal)

Brochage

Chaque broche selon ce qu’elle fait. Survolez ou touchez une broche pour voir ce qu’elle peut être d’autre.

  • Alimentation 3
  • Numérique 5
  • Analogique 12
  • Bus 4
  • Contrôle 5
  • GPIO0GPIO0
  • GPIO1GPIO1
  • GPIO2GPIO2
  • GPIO3GPIO3
  • GPIO4GPIO4
  • GPIO5GPIO5
  • GPIO12GPIO12
  • GPIO13GPIO13
  • GPIO14GPIO14
  • GPIO15GPIO15
  • GPIO16GPIO16
  • GPIO17GPIO17
  • GPIO18GPIO18
  • GPIO19GPIO19
  • GPIO21GPIO21
  • GPIO22GPIO22
  • GPIO23GPIO23
  • GPIO25GPIO25
  • GPIO26GPIO26
  • GPIO27GPIO27
  • GPIO32GPIO32
  • GPIO33GPIO33
  • GPIO34GPIO34
  • GPIO35GPIO35
  • GPIO36GPIO36
  • GPIO39GPIO39
  • pwr5 V USB
  • v3v33V3 pin
  • v55V pin (from USB)

Attention

Ce qu’archec vérifie pour cette carte, d’après ses données. Chaque point nomme la vérification qui l’attrape.

  • Ses broches travaillent en 3.3 V. La sortie d’un capteur 5 V sur l’une d’elles demande un adaptateur de niveau entre les deux.

    vérification pin-level

  • Deux connecteurs de la carte partagent ces broches : GPIO21 (TWAI (add a transceiver) / I2C0), GPIO22 (TWAI (add a transceiver) / I2C0). Utilisez l’un ou l’autre.

    vérification pin-conflict

  • La carte utilise déjà GPIO0 (BOOT Button (low when pressed)). Autre chose branché là entre en conflit.

    vérification pin-conflict

  • Elle donne 3.3 V (3V3 pin), 5 V (5V pin (from USB)). Alimentez chaque pièce depuis une sortie à sa propre tension.

    vérification board-supply

  • Elle a 3 UART, 2 I²C, 2 SPI, 1 CAN. Un bus de plus d’un même type est une erreur.

    vérification board-peripheral

Premier modèle

Un clignotement pour cette carte : la carte, une LED et une partie qui l’inverse toutes les 500 ms. archec le vérifie, puis écrit le code à droite.

main.archeOuvrir dans le playground
project Blink "Blink" {
  version "0.1.0"
  edition "1.0"
  uses arche-hw-store "^0.1"
}

include "arche-hw-store/boards/esp32-devkitc/esp32-devkitc.arche"
include "arche-hw-store/devices/led/led.arche"

/// Turns the LED over at each step.
component Blinker "Blinker" {
  out led: requires Led
  fn blink "Blink" {
    ```arche
    led.toggle()
    ```
    wcet 50us
  }
}

/// The board, an LED on pin GPIO16, and the blinker.
system Hw "Blink" {
  part board:   Esp32DevKitC
  part led:     GpioLed { in pin { pins { pin GPIO16 } } }
  part blinker: Blinker
  blinker.led -> led.led
}

/// The firmware: the blinker every 500 ms.
deployment OnBoard "On the board" {
  system Hw
  platform Hw
  binary blink on board {
    thread main "Blink" { runs blinker; period 500ms; step blink }
  }
}
archec gen --target embassyblink/src/app/blinker.rs
//! Your code: the state and behaviour of this part. Write it between the USER CODE markers:
//! when the model changes, `archec gen` writes this file again around them (a new function, a
//! new input) and keeps them. Edit outside them and the file is yours: it is left as it is,
//! and the compiler says what to add (a new trait method).

#[allow(unused_imports)]
use crate::arche::*;

// @arche blinker main.arche:25 part
/// blinker
#[derive(Default)]
pub struct Blinker {}

impl BlinkerBehaviour for Blinker {
    // @arche blinker.blink main.arche:13 fn
    async fn blink(&mut self, _out: &BlinkerOut) {
        // Blink: from the model (```arche)
        _out.call_led_toggle().await;
    }
}

blink/src/app/blinker.rs, l’un des 14 fichiers qu’archec écrit.

Ouvrir dans le playground

Les pièces de la carte

Ce qu’est chaque pièce numérotée. Cliquez sur un numéro pour la trouver sur la carte.

1 2 3 4 5 6 7 8 9

Trouvez la pièce

Le quiz nomme une pièce : cliquez dessus sur la carte. Un premier essai réussi marque un point.

Comparer toutes les cartes