pont-uart.ino

Arduino GIGA R1 · File : pont-uart.ino · Language : Arduino · Use case : Dialoguer avec un module sur l'UART matériel

The GIGA lines up 4 hardware UARTs: Serial1 on D0/D1 becomes the gateway to the TTL world. The bidirectional bridge configures a module live from the serial monitor.

Hardware required

An Arduino Giga R1 board (STM32H747 dual-core M7 at 480 MHz + M4, 76 I/O pins, 2 DACs, FDCAN) powered over USB-C or 5-24 V. 1 3.3 V UART module (GPS, LoRa, RS-485…) + adapter if needed.

Wiring

Crossed TX/RX between D0/D1 and the module, common grounds, 3.3 V levels. Note: D0/D1 are the classic Serial pins on other boards.

How it works

Two FIFOs and two whiles: each stream drains every pass. With 4 UARTs + USB, the GIGA bridge can grow into a multi-module router. In the Arduino IDE, install the « Arduino Zephyr-based Boards » (or Mbed) platform, select « Arduino Giga R1 », then Upload. 3.3 V logic.

Going further

Add frame parsing (prefix/terminator) and redirection onto the CAN bus.

pont-uart.ino

// Pont Serial USB <-> Serial1 (D0 RX / D1 TX) a 9600 bauds.
// Exemple typique : GPS, module LoRa, convertisseur RS-485.
void setup() {
  Serial.begin(115200);        // console USB
  Serial1.begin(9600);         // D0/D1 : le module
  Serial.println("Pont USB <-> Serial1 actif");
}

void loop() {
  while (Serial1.available())  // module -> console
    Serial.write(Serial1.read());
  while (Serial.available())   // console -> module (config AT)
    Serial1.write(Serial.read());
}

← Back to the board