modelPartialUsbBoard

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

Extends from PartialBoard (Common base of the boards (MCU, RPi_Pico, MicroBit_v2): the user settings and the core contract are written here once - the boards add their pins, their connectors, their supply and their pin table (modifier of core in their extends)).

Information

Common base of the USB-supplied boards RPi_Pico and MicroBit_v2, on top of PartialBoard: only the USB supply parameters are shared (usbConnected, VUsb, RUsb, eta), because the supply chains really differ - the Pico exposes VBUS/VSYS as public pins with the Schottky between them, the micro:bit feeds its regulator from the USB rail and exposes 3V only. The conditional components (usbSupply, usbCable) and their wiring stay in each board: their placement cannot be changed by inheritance, and so does the drawn routing of their wires.

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
BooleanusbConnectedtrueUSB 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.VoltageVUsb5Voltage of the USB supply
Modelica.Units.SI.ResistanceRUsb0.2Resistance of the USB cable and connector
Power supply › Regulator
Realeta0.9Efficiency of the regulator

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