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): conductance1/ROutfrom the supply railvddto the pin (high level) or from the pin toVOL(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):RPullUptovdd,RPullDowntognd; they act whatever the direction, like on the RP2040. - Input: leakage
GOfftoVOL(≈ 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
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.Voltage | VOL | 0 | Low output level, above GND |
| Modelica.Units.SI.Resistance | ROut | 100 | Output series resistance (drive strength), on both the high and the low side |
| Modelica.Units.SI.Resistance | RPullUp | 50e3 | Internal pull-up, to the supply rail |
| Modelica.Units.SI.Resistance | RPullDown | 50e3 | Internal pull-down, to GND |
| Modelica.Units.SI.Conductance | GOff | 1e-9 | Leakage of a pin that does not drive its line, towards GND |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Electrical.Analog.Interfaces.PositivePin | pin | The pin | |
| Modelica.Electrical.Analog.Interfaces.PositivePin | vdd | Supply rail (IOVDD): source of the high level and of the pull-up | |
| Modelica.Electrical.Analog.Interfaces.NegativePin | gnd | Ground |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | drive | Output stage enabled (pin in output mode, board supplied) | |
| Boolean | level | Level driven when the output stage is enabled | |
| Integer | pull | Internal pull resistor: 0 = none, 1 = up (to vdd), 2 = down (to gnd) | |
| Modelica.Units.SI.Voltage | v | Voltage of the pin, relative to gnd |