modelXIAO_rp2040

Seeed Studio XIAO RP2040 standard board with real pad-to-GPIO mapping, USB/5 V supply and active-low RGB LED

Extends from Internal.Boards.PartialUsbBoard (Common base of the boards supplied through USB (RPi_Pico, MicroBit_v2): the USB supply parameters are written here once - each board keeps its own supply chain (pins, components, wiring), whose placement and topology are board-specific).

Information

Replica of the Seeed Studio XIAO RP2040 standard board (not the XIAO RP2040 Plus): 21 x 17.8 mm, USB-C and 14 edge pads. The board contains the shared RP2040 programmable core, a 3.3 V regulator, its power LED and the active-low RGB user LED. The BOOT and RESET buttons are drawn but not simulated.

Pinout

The schematic and icon show both the XIAO pad names (D0...D10) and the RP2040 GPIO numbers. In a script, keep using the real GPIO identifiers: D0 = machine.Pin(26), D1 = Pin(27), D2 = Pin(28), D3 = Pin(29), D4 = Pin(6), D5 = Pin(7), D6 = Pin(0), D7 = Pin(1), D8 = Pin(2), D9 = Pin(4), D10 = Pin(3). D0-D3 are the four ADC inputs (ADC(0)...ADC(3)).

UART and I2C use the RP2040 rp2 pin multiplexing. For example, the default UART(0) uses GPIO0/GPIO1 (D6/D7), and I2C(1) uses SCL GPIO7/SDA GPIO6 (D5/D4). GPIOs not exposed on the standard XIAO are rejected, even though they exist in the RP2040 silicon.

Power

usbConnected (true by default) powers the 5 V input from USB-C. With USB disconnected, an external 5 V supply can be connected to V5. The averaged regulator supplies the RP2040, the pins and the V3V3 output at 3.3 V. This is a simplified electrical model, not a component-level replica of the regulator. Do not connect an external 5 V supply while the USB source is enabled.

One on-board RGB LED package is driven by GPIO17 (red), GPIO16 (green) and GPIO25 (blue); all three channels are active low, as on the board. The power LED is connected to the 3.3 V rail and lights when the board is powered. The core starts on power-up and stops permanently below VPowerOff; a restart after power loss is not simulated.

Display0 is the educational logical display link also found on the other boards; it is not a physical XIAO connector. See requirements.md, decision "Seeed Studio XIAO RP2040".

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.TimetickPeriod (from PartialMcuSettings)0.1Period of the minimal sync point (output freshness if the script never sleeps)
Python script
StringscriptPath (from PartialMcuSettings)Modelica.Utilities.Files.loadResource("modelica://MicroPythonMCU/Resources/Scripts/MCU/demo.py")Path of the user script (.py) - with an active file system, run after boot.py instead of main.py; empty = main.py from the flash
BooleanaddScriptDirToPath (from PartialMcuSettings)trueMake the .py files next to the script importable (e.g. import my_module) - mimics the real Pico (flash root folder on sys.path)
StringlibraryPath (from PartialMcuSettings)""Optional: a .py file from a shared library folder to make importable (the folder containing this file is added to the module search path) - leave empty if unused
File system › Simulated flash
BooleanfsEnabled (from PartialMcuSettings)falseEnable the file system (simulated flash) - disabled: open() and os raise OSError
StringfsSource (from PartialMcuSettings)""Initial image of the flash (folder: data, boot.py, main.py, lib/), copied at each simulation and never modified - any file of the folder, the folder path or a modelica:// URI; empty = blank flash, only the script runs
StringfsWorkspace (from PartialMcuSettings)"."Workspace: folder where each simulation creates its copy, named <instance>_<FS name>_<date>_<time> (created if missing) - "." or relative path = from the simulation folder; full path of the copy shown in the log
BooleanfsOpenExplorer (from PartialMcuSettings)trueOpen Windows Explorer on the copy at the end of the simulation
Execution time
Modelica.Units.SI.TimegpioOpTime (from PartialMcuSettings)5e-6Execution time of a pin access (Pin.value(), on(), off()): two writes without sleep() give a pulse of this width (bit-banging) - order of magnitude of MicroPython on RP2040; 0 = instantaneous accesses
Modelica.Units.SI.TimehangWarningTime (from PartialMcuSettings)10Real (wall-clock) time after which a warning is logged if the script does not let the simulation advance (loop without sleep() nor pin access, or with gpioOpTime = 0) - the simulation keeps waiting; 0 = no warning
Debugging
BooleandebugEnabled (from PartialMcuSettings)falseDebug the program with VS Code: at the start of the simulation, the microcontroller waits until VS Code attaches (debugpy, Run and Debug > attach to localhost:debugPort); simulated time stays frozen while the program is paused - one microcontroller per model
IntegerdebugPort (from PartialMcuSettings)5678Local TCP port on which the debugger (debugpy) listens - the port of the VS Code attach configuration
Electrical › Logic levels
Modelica.Units.SI.VoltageVOL (from PartialMcuSettings)Interfaces.VOLLogic low voltage
Modelica.Units.SI.VoltageVIH (from PartialMcuSettings)Interfaces.VIHThreshold above which an input reads high
Modelica.Units.SI.VoltageVIL (from PartialMcuSettings)Interfaces.VILThreshold below which an input reads low
Electrical › Output stages
Modelica.Units.SI.ResistanceROut (from PartialMcuSettings)Interfaces.ROutOutput series resistance (drive strength)
Electrical › Input stages
Modelica.Units.SI.ResistanceRPullUp (from PartialMcuSettings)Interfaces.RPullInternal pull-up resistor to the supply, switched on by Pin(n, mode, Pin.PULL_UP) and by I2C() on SCL/SDA
Modelica.Units.SI.ResistanceRPullDown (from PartialMcuSettings)Interfaces.RPullInternal pull-down resistor to GND, switched on by Pin(n, mode, Pin.PULL_DOWN)
Modelica.Units.SI.ConductanceGOff (from PartialMcuSettings)Interfaces.GOffLeakage of a pin that does not drive its line (input, released I2C line), towards GND: 1e-9 S = 1 GOhm
Power supply › Consumption
Modelica.Units.SI.CurrentICore (from PartialBoard)0.02Current drawn from the supply rail by the core and its memory while supplied (program running, pins excluded)
Power supply › Power-on
Modelica.Units.SI.VoltageVPowerOn (from PartialBoard)1.8Supply rail voltage above which the core starts (power-on reset)
Modelica.Units.SI.VoltageVPowerOff (from PartialBoard)1.6Supply rail voltage below which a running core stops for good (brown-out)
Power supply › USB
BooleanusbConnected (from PartialUsbBoard)trueUSB cable plugged in: 5 V through the USB connector (the board runs without any wiring) - false to supply the board through its supply pin
Modelica.Units.SI.VoltageVUsb (from PartialUsbBoard)5Voltage of the USB supply
Modelica.Units.SI.ResistanceRUsb (from PartialUsbBoard)0.2Resistance of the USB cable and connector
Power supply › Regulator
Realeta (from PartialUsbBoard)0.9Efficiency of the regulator
Power supply › Temperature sensor
Modelica.Units.NonSI.Temperature_degCdieTemperature27RP2040 die temperature, read by machine.ADC(4)
Electrical › On-board LEDs
Modelica.Units.SI.ResistanceledSeriesR330Series resistance of each active-low RGB LED channel
Modelica.Units.SI.ResistancepowerLedSeriesR1000Series resistance of the green power LED

Connectors

TypeNameDefaultDescription
Modelica.Electrical.Analog.Interfaces.PositivePinD0XIAO D0, RP2040 GPIO26 (machine.Pin(26), ADC(0))
Modelica.Electrical.Analog.Interfaces.PositivePinD1XIAO D1, RP2040 GPIO27 (machine.Pin(27), ADC(1))
Modelica.Electrical.Analog.Interfaces.PositivePinD2XIAO D2, RP2040 GPIO28 (machine.Pin(28), ADC(2))
Modelica.Electrical.Analog.Interfaces.PositivePinD3XIAO D3, RP2040 GPIO29 (machine.Pin(29), ADC(3))
Modelica.Electrical.Analog.Interfaces.PositivePinD4XIAO D4, RP2040 GPIO6 (machine.Pin(6))
Modelica.Electrical.Analog.Interfaces.PositivePinD5XIAO D5, RP2040 GPIO7 (machine.Pin(7))
Modelica.Electrical.Analog.Interfaces.PositivePinD6XIAO D6, RP2040 GPIO0 (machine.Pin(0))
Modelica.Electrical.Analog.Interfaces.PositivePinV55 V USB-C input/output (do not drive externally while usbConnected is true)
Modelica.Electrical.Analog.Interfaces.NegativePinGNDGround
Modelica.Electrical.Analog.Interfaces.PositivePinV3V33.3 V regulated output for external circuits
Modelica.Electrical.Analog.Interfaces.PositivePinD10XIAO D10, RP2040 GPIO3 (machine.Pin(3))
Modelica.Electrical.Analog.Interfaces.PositivePinD9XIAO D9, RP2040 GPIO4 (machine.Pin(4))
Modelica.Electrical.Analog.Interfaces.PositivePinD8XIAO D8, RP2040 GPIO2 (machine.Pin(2))
Modelica.Electrical.Analog.Interfaces.PositivePinD7XIAO D7, RP2040 GPIO1 (machine.Pin(1))
Interfaces.DisplayLinkOutputDisplay0Educational logical display link, not on the real board

Components

TypeNameDefaultDescription
Internal.Boards.PartialMcuCorecore (from PartialBoard)Programmable core, public like in the boards so that its plotted variables (powerGood, supplyOk...) stay in the simulation results - partial: every board redeclares it (McuCore); pin table (nPins, pinIds, pinCaps), board profile and on-board devices are set by the board in the modifier of its extends, pins in the order of pinIds
Internal.Boards.Rt6150regulatorAveraged 5 V to 3.3 V buck-boost regulator
Modelica.Electrical.Analog.Sources.ConstantVoltageusbSupplyUSB-C 5 V supply
Modelica.Electrical.Analog.Basic.ResistorusbCableUSB cable and connector resistance
Modelica.Electrical.Analog.Basic.ResistorpowerLedResistorPower LED current limiter
MicroPythonMCU.Peripherals.LEDpowerLedOn-board green power LED
Internal.Boards.XiaoRgbLedrgbLedSingle on-board RGB LED package
Modelica.Units.SI.VoltagevRailV3V3.v - core.gnd.vRegulated 3.3 V rail
Modelica.Units.SI.VoltagevInputV5.v - core.gnd.v5 V input rail
Modelica.Units.SI.CurrentiInputregulator.iInCurrent drawn by the regulator from the 5 V input