🛠 GPIO, ADC 16 bits et DAC sur le Nucleo STM32H743ZI : bouton, LED et potentiomètre

STM32H7 Nucleo-144 (flagship: NUCLEO-H743ZI) · debutant · Schéma : IMG-stm32h7-nucleo-debutant-2-stm32h743zi-gpio-adc-dac.svg — Nucleo-144 STM32H743ZI sur plaque de prototypage, bouton USER (PC13), LED LD1 (PB0), potentiomètre sur A0 et sortie DAC1_OUT1 (PA4) reliée à un oscilloscope, connecteurs ST Zio et morpho annotés, flat vector style, étiquettes en français, fond blanc.

What you will build

A hands-on tour of the STM32H743ZI's basic I/O: the board exposes up to 114 GPIO with external interrupt capability through the ST Zio connector (Arduino Uno V3 compatible) and the ST morpho headers, plus serious analog silicon: 3× ADC (16-bit, 36 channels, up to 3.6 MSPS) and 2× 12-bit DAC. We will read the USER button, dim an LED and stream a potentiometer value through the DAC.

Board map (default Zephyr mapping, useful even under Arduino)

Hardware

Code (STM32duino core, board "Nucleo H743ZI")

const uint8_t BTN  = LED_BUILTIN; // USER button is PC13 on the board; on the
                                  // Arduino header use any free pin vs GND
const uint8_t LED  = LED1;        // LD1 = PB0 via the core alias
const uint8_t POT  = A0;          // one of 28 analog channels A0..A27
const uint8_t DAC1 = A4;          // PA4 = DAC1_OUT1 (Zephyr mapping)
                                  // > 
                                  // pin alias depends on your core version

void setup {
  pinMode(LED, OUTPUT);
  Serial.begin(115200);           // ST-LINK virtual COM port
}

void loop {
  int raw = analogRead(POT);      // 3x 16-bit ADCs, up to 3.6 MSPS
  // Map the ADC reading onto the 12-bit DAC output scale
  analogWrite(DAC1, map(raw, 0, 4095, 0, 255));
  digitalWrite(LED, (raw > 2048) ? HIGH : LOW);
  Serial.printf("ADC=%d  -> DAC level=%d\n", raw,
                map(raw, 0, 4095, 0, 255));
  delay(100);
}

Steps

  1. Wire the potentiometer between 3V3, GND and A0 (never feed more than the board's own rail into a pin).
  2. Select board Nucleo H743ZI in the STM32duino core and upload.
  3. Turn the pot: the multimeter on PA4 should follow smoothly — that is the 12-bit DAC working.
  4. Press the USER button (PC13) if you wired it to a header pin: use pinMode(pin, INPUT_PULLUP) and digitalRead the same way.

Expected result

ADC counts climb while you turn the pot, the DAC voltage follows, and LD1 flips at mid-scale. With three 16-bit ADCs at up to 3.6 MSPS, this board samples far faster than any classic Arduino — the bottleneck is your sketch, not the silicon.

Common pitfalls

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials