modelPinBridge

Electrical stage of one microcontroller pin: push-pull output fed by the supply rail, switchable internal pull-up/pull-down, leakage, voltage sensing

Information

Electrical stage of one pin of a microcontroller (Internal.Boards.McuCore), written as equations rather than standard blocks (fewer variables, one instance per pin):

  • Output (drive): conductance 1/ROut from the supply rail vdd to the pin (high level) or from the pin to VOL (low level). The high level is the voltage of the rail, and the current delivered by the pin is drawn from it: the supply of the board sees the load of its pins.
  • Pulls (pull): RPullUp to vdd, RPullDown to gnd; they act whatever the direction, like on the RP2040.
  • Input: leakage GOff to VOL (≈ GND), so that a floating input reads low.

Promoted from the prototype Sandbox.PinBridgeFull, see requirements.md, decision "Carte Raspberry Pi Pico et alimentation".

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.VoltageVOL0Low output level, above GND
Modelica.Units.SI.ResistanceROut100Output series resistance (drive strength), on both the high and the low side
Modelica.Units.SI.ResistanceRPullUp50e3Internal pull-up, to the supply rail
Modelica.Units.SI.ResistanceRPullDown50e3Internal pull-down, to GND
Modelica.Units.SI.ConductanceGOff1e-9Leakage of a pin that does not drive its line, towards GND

Connectors

TypeNameDefaultDescription
Modelica.Electrical.Analog.Interfaces.PositivePinpinThe pin
Modelica.Electrical.Analog.Interfaces.PositivePinvddSupply rail (IOVDD): source of the high level and of the pull-up
Modelica.Electrical.Analog.Interfaces.NegativePingndGround

Components

TypeNameDefaultDescription
BooleandriveOutput stage enabled (pin in output mode, board supplied)
BooleanlevelLevel driven when the output stage is enabled
IntegerpullInternal pull resistor: 0 = none, 1 = up (to vdd), 2 = down (to gnd)
Modelica.Units.SI.VoltagevVoltage of the pin, relative to gnd