🛠 Advanced I/O Management on Romu: Debug Pads and Internal Peripherals
Objectifs
This tutorial aims to master Input/Output management on the Bitmerse Romu board, which lacks standard external GPIO pins. You will learn to interact with debug pads for serial debugging, control the integrated RGB LED for visual feedback, and read the state of physical buttons. These skills are essential for developing complex HID peripherals like macro pads or MIDI controllers, where local feedback is crucial despite the extreme compactness (15.5 x 12 mm) of the RP2354A-based board.
Matériel nécessaire
- Romu development board (Bitmerse)
- Computer with USB 2.0 Type-A port
- Development software (MicroPython or C/C++ with Pico/RP2350 SDK)
- Male-to-male USB cable or adapter if needed for initial power (though the Type-A connector is integrated)
- Multimeter (optional, to check pad continuity)
Étapes
- Identify debug pads: On the bottom or side of the Romu, locate pads marked TX/RX or SWD. Unlike standard boards, you cannot solder standard connectors without risking damage to the chip. Use fine alligator clips or pogo pins to temporarily access these pads for serial debugging (UART) or wire debugging (SWD).
``python import machine import time # Generic example, check specific Romu pins led_r = machine.PWM(machine.Pin(25)) # Verify exact pin led_r.freq(1000) for duty in range(0, 1024, 10): led_r.duty_u16(duty) time.sleep(0.01) ``
- Configure the RGB LED: The RGB LED is wired directly to the RP2354A's internal GPIOs. In your code, identify the corresponding pins (often GP25 for the standard user LED, but check the specific Romu schematic). For advanced control, use PWM (Pulse Width Modulation) to vary intensity and create color gradients.
``python button = machine.Pin(20, machine.Pin.IN, machine.Pin.PULL_UP) # Pin to confirm while True: if button.value() == 0: print("Button pressed") time.sleep(0.2) # Simple debounce ``
- Read physical buttons: Buttons are typically wired with internal pull-up or pull-down. Configure the associated GPIOs as inputs. To avoid bouncing (debounce), implement a simple software filter or use hardware interrupts if available on the RP2354A.
- Interact with pads for debugging: To send serial logs without blocking the main USB (used for HID/MIDI), configure UART on the debug pads. This allows monitoring the microcontroller's internal state while the board functions as a USB peripheral.
Vérification
- The RGB LED should change color or intensity according to your code.
- Pressing buttons should trigger a visible action (LED change) or be logged via debug pads.
- Use a multimeter to verify that debug pads are not shorted to ground or power.
Pour aller plus loin
Explore the RP2354A's hybrid architecture by moving button reading tasks to the RISC-V cores to free up Arm cores for complex USB HID management. Consider adding external components soldered directly to pads if extension is absolutely necessary, respecting the thermal constraints of the ultra-compact board.
Other tutorials for this board
Code examples for this board
romu-rgb-led-pwm.inoC/C++ (Pico SDK)romu-hid-keyboard-macro.inoC/C++ (TinyUSB)romu-internal-flash-storage.inoC/C++ (Pico SDK)romu-midi-controller.inoC/C++ (TinyUSB)romu-secure-boot-check.inoC/C++ (Pico SDK)romu-hid-custom-keyboard.inoC++ (Arduino)