From f557b64ddeabe05c8f65d7cc2fece9ac18533581 Mon Sep 17 00:00:00 2001 From: Richard Lin Date: Wed, 9 Aug 2023 22:11:30 -0700 Subject: [PATCH] Resettable mixin (#280) Add external reset pin support to microcontrollers via a Resettable mixin which can be applied to any Block. Refactor VoltageRegulatorEnable to use the Resettable mixin instead. Resettable defines an optional reset port, which when not connected generates internal reset circuitry to keep the device always enabled, and when connected directly connects the digital reset line (without generating any interface circuitry - it is up to the system designer to create a proper circuit). Also break up big SWD, by separating out the optional (from the spec points of view) reset line. SWD connector now only defines the base gnd, power, and SWD lines, with reset, SWO, JTAG TDI moved into optional mixins. --- edg/BoardTop.py | 2 +- edg_core/BlockInterfaceMixin.py | 2 +- .../AbstractDebugHeaders.py | 23 +++++++--- .../AbstractPowerConverters.py | 42 ++++++++---------- .../IoControllerProgramming.py | 15 ++++--- electronics_abstract_parts/PassiveFilters.py | 15 ++++--- electronics_abstract_parts/Resettable.py | 22 ++++++++++ electronics_abstract_parts/__init__.py | 6 ++- .../BoostConverters_AnalogDevices.py | 2 +- electronics_lib/BoostConverters_DiodesInc.py | 2 +- electronics_lib/BoostConverters_Torex.py | 8 ++-- electronics_lib/BuckConverter_Ap3418.py | 2 +- .../BuckConverter_TexasInstruments.py | 10 ++--- electronics_lib/DebugHeaders.py | 16 +++---- electronics_lib/LinearRegulators.py | 8 ++-- electronics_lib/Microcontroller_Esp.py | 1 - electronics_lib/Microcontroller_Esp32.py | 20 +++++++-- electronics_lib/Microcontroller_Esp32c3.py | 20 +++++++-- electronics_lib/Microcontroller_Esp32s3.py | 19 ++++++-- electronics_lib/Microcontroller_Lpc1549.py | 29 ++++++++---- electronics_lib/Microcontroller_Rp2040.py | 21 ++++++--- electronics_lib/Microcontroller_Stm32f103.py | 19 +++++--- electronics_lib/Microcontroller_nRF52840.py | 31 +++++++++---- electronics_model/DebugPorts.py | 5 --- examples/CanAdapter/CanAdapter.net | 2 +- examples/Datalogger/Datalogger.net | 2 +- examples/Fcml/Fcml.net | 2 +- examples/HighSwitch/HighSwitch.net | 2 +- examples/IotDisplay/IotDisplay.net | 22 +++++----- examples/IotFan/IotFan.net | 22 +++++----- examples/IotKnob/IotKnob.net | 22 +++++----- examples/IotLedDriver/IotLedDriver.net | 22 +++++----- examples/LedMatrix/LedMatrix.net | 44 +++++++++---------- examples/Multimeter/Multimeter.net | 2 +- examples/RobotCrawler/RobotCrawler.net | 22 +++++----- examples/RobotDriver/RobotDriver.net | 44 +++++++++---------- examples/SevenSegment/SevenSegment.net | 22 +++++----- examples/SwdDebugger/SwdDebugger.net | 38 ++++++++-------- .../SwitchController/SwitchController.net | 44 +++++++++---------- examples/TofArray/TofArray.net | 2 +- .../UsbSourceMeasure/UsbSourceMeasure.net | 2 +- examples/test_multimeter.py | 2 +- examples/test_swd_debugger.py | 20 +++++---- examples/test_tofarray.py | 2 +- examples/test_usb_source_measure.py | 2 +- 45 files changed, 400 insertions(+), 282 deletions(-) create mode 100644 electronics_abstract_parts/Resettable.py diff --git a/edg/BoardTop.py b/edg/BoardTop.py index b0b75ec0a..e8cf9c65f 100644 --- a/edg/BoardTop.py +++ b/edg/BoardTop.py @@ -36,7 +36,7 @@ def refinements(self) -> Refinements: (CanEsdDiode, Pesd1can), (TestPoint, TeRc), - (SwdCortexTargetWithSwoTdiConnector, SwdCortexTargetHeader), + (SwdCortexTargetConnector, SwdCortexTargetHeader), (SpiMemory, W25q), diff --git a/edg_core/BlockInterfaceMixin.py b/edg_core/BlockInterfaceMixin.py index abd78370d..ca9360565 100644 --- a/edg_core/BlockInterfaceMixin.py +++ b/edg_core/BlockInterfaceMixin.py @@ -56,7 +56,7 @@ def _get_mixin_base(cls) -> Type['BlockInterfaceMixin']: mixin_base = bcls_args[0] if mixin_base is None: raise BlockDefinitionError(cls, "no mixin base defined") - if (mixin_base, AbstractBlockProperty) not in mixin_base._elt_properties: + if (mixin_base, AbstractBlockProperty) not in mixin_base._elt_properties and mixin_base is not Block: raise BlockDefinitionError(cls, "mixin base must be abstract") return mixin_base diff --git a/electronics_abstract_parts/AbstractDebugHeaders.py b/electronics_abstract_parts/AbstractDebugHeaders.py index bf94f779d..5695a03ec 100644 --- a/electronics_abstract_parts/AbstractDebugHeaders.py +++ b/electronics_abstract_parts/AbstractDebugHeaders.py @@ -13,13 +13,22 @@ def __init__(self) -> None: self.swd = self.Port(SwdHostPort.empty(), [Output]) -@abstract_block -class SwdCortexTargetWithSwoTdiConnector(SwdCortexTargetConnector): - """SWD programming header (power + SWD) with additional optional and generic-digital - SWO (optional SWD pin) and TDI (if a JTAG header is used) pins which can be used as GPIOs - for side-channel data like a supplementary UART console.""" - def __init__(self) -> None: - super().__init__() +class SwdCortexTargetConnectorReset(BlockInterfaceMixin[SwdCortexTargetConnector]): + """Mixin for SWD connectors with adding the optional reset pin""" + def __init__(self, *args, **kwargs) -> None: + super().__init__(*args, **kwargs) + self.reset = self.Port(DigitalSource.empty()) + +class SwdCortexTargetConnectorSwo(BlockInterfaceMixin[SwdCortexTargetConnector]): + """Mixin for SWD connectors with adding the optional SWO pin""" + def __init__(self, *args, **kwargs) -> None: + super().__init__(*args, **kwargs) self.swo = self.Port(DigitalBidir.empty(), optional=True) + + +class SwdCortexTargetConnectorTdi(BlockInterfaceMixin[SwdCortexTargetConnector]): + """Mixin for SWD connectors with adding the NONSTANDARD TDI pin (where pins are shared with JTAG)""" + def __init__(self, *args, **kwargs) -> None: + super().__init__(*args, **kwargs) self.tdi = self.Port(DigitalBidir.empty(), optional=True) diff --git a/electronics_abstract_parts/AbstractPowerConverters.py b/electronics_abstract_parts/AbstractPowerConverters.py index 8b854f8fd..e02de9a44 100644 --- a/electronics_abstract_parts/AbstractPowerConverters.py +++ b/electronics_abstract_parts/AbstractPowerConverters.py @@ -4,6 +4,7 @@ from .Categories import * from .AbstractCapacitor import DecouplingCapacitor from .AbstractInductor import Inductor +from .Resettable import Resettable @abstract_block_default(lambda: IdealVoltageRegulator) @@ -33,32 +34,25 @@ def contents(self): "Output voltage must be within spec") -class VoltageRegulatorEnable(BlockInterfaceMixin[VoltageRegulator]): - """Mixin for VoltageRegulator with an active-high enable pin (or active-low disable pin).""" - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.enable = self.Port(DigitalSink.empty(), optional=True) - - -class VoltageRegulatorEnableWrapper(VoltageRegulatorEnable, VoltageRegulator, GeneratorBlock): - """Implementation mixin for a voltage regulator wrapper block where the inner device has an enable pin +class VoltageRegulatorEnableWrapper(Resettable, VoltageRegulator, GeneratorBlock): + """Implementation mixin for a voltage regulator wrapper block where the inner device has a reset/enable pin (active-high enable / active-low shutdown) that is automatically tied high if not externally connected. - Mix this into a VoltageRegulator to automatically handle the enable pin.""" + Mix this into a VoltageRegulator to automatically handle the reset pin.""" @abstractmethod - def _generator_inner_enable_pin(self) -> Port[DigitalLink]: - """Returns the inner device's enable pin, to be connected in the generator. + def _generator_inner_reset_pin(self) -> Port[DigitalLink]: + """Returns the inner device's reset pin, to be connected in the generator. Only called within a generator.""" def contents(self): super().contents() - self.generator_param(self.enable.is_connected()) + self.generator_param(self.reset.is_connected()) def generate(self): super().generate() - if self.get(self.enable.is_connected()): - self.connect(self.enable, self._generator_inner_enable_pin()) + if self.get(self.reset.is_connected()): + self.connect(self.reset, self._generator_inner_reset_pin()) else: # by default tie high to enable regulator - self.connect(self.pwr_in.as_digital_source(), self._generator_inner_enable_pin()) + self.connect(self.pwr_in.as_digital_source(), self._generator_inner_reset_pin()) @abstract_block_default(lambda: IdealLinearRegulator) @@ -71,7 +65,7 @@ class VoltageReference(LinearRegulator): """Voltage reference, generally provides high accuracy but limited current""" -class IdealLinearRegulator(VoltageRegulatorEnable, LinearRegulator, IdealModel): +class IdealLinearRegulator(Resettable, LinearRegulator, IdealModel): """Ideal linear regulator, draws the output current and produces spec output voltage limited by input voltage""" def contents(self): super().contents() @@ -81,7 +75,7 @@ def contents(self): current_draw=self.pwr_out.link().current_drawn)) self.pwr_out.init_from(VoltageSource( voltage_out=effective_output_voltage)) - self.enable.init_from(DigitalSink()) + self.reset.init_from(DigitalSink()) @non_library @@ -173,7 +167,7 @@ class DiscreteBuckConverter(BuckConverter): """Category for discrete buck converter subcircuits (as opposed to integrated components)""" -class IdealBuckConverter(VoltageRegulatorEnable, DiscreteBuckConverter, IdealModel): +class IdealBuckConverter(Resettable, DiscreteBuckConverter, IdealModel): """Ideal buck converter producing the spec output voltage (buck-boost) limited by input voltage and drawing input current from conversation of power""" def contents(self): @@ -184,7 +178,7 @@ def contents(self): current_draw=effective_output_voltage / self.pwr_in.link().voltage * self.pwr_out.link().current_drawn)) self.pwr_out.init_from(VoltageSource( voltage_out=effective_output_voltage)) - self.enable.init_from(DigitalSink()) + self.reset.init_from(DigitalSink()) class BuckConverterPowerPath(InternalSubcircuit, GeneratorBlock): @@ -334,7 +328,7 @@ class DiscreteBoostConverter(BoostConverter): """Category for discrete boost converter subcircuits (as opposed to integrated components)""" -class IdealBoostConverter(VoltageRegulatorEnable, DiscreteBoostConverter, IdealModel): +class IdealBoostConverter(Resettable, DiscreteBoostConverter, IdealModel): """Ideal boost converter producing the spec output voltage (buck-boost) limited by input voltage and drawing input current from conversation of power""" def contents(self): @@ -345,7 +339,7 @@ def contents(self): current_draw=effective_output_voltage / self.pwr_in.link().voltage * self.pwr_out.link().current_drawn)) self.pwr_out.init_from(VoltageSource( voltage_out=effective_output_voltage)) - self.enable.init_from(DigitalSink()) + self.reset.init_from(DigitalSink()) class BoostConverterPowerPath(InternalSubcircuit, GeneratorBlock): @@ -485,7 +479,7 @@ class DiscreteBuckBoostConverter(BuckBoostConverter): """Category for discrete buck-boost converter subcircuits (as opposed to integrated components)""" -class IdealVoltageRegulator(VoltageRegulatorEnable, DiscreteBuckBoostConverter, IdealModel): +class IdealVoltageRegulator(Resettable, DiscreteBuckBoostConverter, IdealModel): """Ideal buck-boost / general DC-DC converter producing the spec output voltage and drawing input current from conversation of power""" def contents(self): @@ -495,7 +489,7 @@ def contents(self): current_draw=self.output_voltage / self.pwr_in.link().voltage * self.pwr_out.link().current_drawn)) self.pwr_out.init_from(VoltageSource( voltage_out=self.output_voltage)) - self.enable.init_from(DigitalSink()) + self.reset.init_from(DigitalSink()) class BuckBoostConverterPowerPath(InternalSubcircuit, GeneratorBlock): diff --git a/electronics_abstract_parts/IoControllerProgramming.py b/electronics_abstract_parts/IoControllerProgramming.py index 92f2cf55c..f70317315 100644 --- a/electronics_abstract_parts/IoControllerProgramming.py +++ b/electronics_abstract_parts/IoControllerProgramming.py @@ -1,5 +1,6 @@ from electronics_model import * -from .AbstractDebugHeaders import SwdCortexTargetWithSwoTdiConnector +from .AbstractDebugHeaders import SwdCortexTargetConnector, SwdCortexTargetConnectorReset, SwdCortexTargetConnectorSwo, \ + SwdCortexTargetConnectorTdi from .IoController import BaseIoControllerExportable, IoController @@ -18,13 +19,15 @@ def __init__(self, swd_swo_pin: StringLike = "NC", swd_tdi_pin: StringLike = "NC self.swd_tdi_pin = self.ArgParameter(swd_tdi_pin) self.generator_param(self.swd_swo_pin, self.swd_tdi_pin) self.swd_node = self.connect() # connect this internal node to the microcontroller + self.reset_node = self.connect() # connect this internal node to the microcontroller def contents(self): super().contents() - self.swd = self.Block(SwdCortexTargetWithSwoTdiConnector()) - self.connect(self.swd_node, self.swd.swd) - self.connect(self.swd.pwr, self.pwr) + self.swd = self.Block(SwdCortexTargetConnector()) self.connect(self.swd.gnd, self.gnd) + self.connect(self.swd.pwr, self.pwr) + self.connect(self.swd_node, self.swd.swd) + self.connect(self.reset_node, self.swd.with_mixin(SwdCortexTargetConnectorReset()).reset) def _inner_pin_assigns(self) -> list[str]: pin_assigns = super()._inner_pin_assigns() @@ -37,6 +40,6 @@ def _inner_pin_assigns(self) -> list[str]: def generate(self): super().generate() if self.get(self.swd_swo_pin) != 'NC': - self.connect(self.ic.gpio.request('swd_swo'), self.swd.swo) + self.connect(self.ic.gpio.request('swd_swo'), self.swd.with_mixin(SwdCortexTargetConnectorSwo()).swo) if self.get(self.swd_tdi_pin) != 'NC': - self.connect(self.ic.gpio.request('swd_tdi'), self.swd.tdi) + self.connect(self.ic.gpio.request('swd_tdi'), self.swd.with_mixin(SwdCortexTargetConnectorTdi()).tdi) diff --git a/electronics_abstract_parts/PassiveFilters.py b/electronics_abstract_parts/PassiveFilters.py index a37768ce1..d011079b7 100644 --- a/electronics_abstract_parts/PassiveFilters.py +++ b/electronics_abstract_parts/PassiveFilters.py @@ -41,18 +41,23 @@ class PullupDelayRc(DigitalFilter, Block): @init_in_parent def __init__(self, impedance: RangeLike, time_constant: RangeLike): super().__init__() - self.input = self.Port(VoltageSink.empty(), [Power]) + self.pwr = self.Port(VoltageSink.empty(), [Power]) self.time_constant = self.ArgParameter(time_constant) self.rc = self.Block(LowPassRc(impedance=impedance, cutoff_freq=1/(2 * pi * self.time_constant), - voltage=self.input.link().voltage)) + voltage=self.pwr.link().voltage)) - self.connect(self.input, self.rc.input.adapt_to(VoltageSink())) - self.io = self.Export(self.rc.output.adapt_to(DigitalSingleSource.high_from_supply(self.input)), [Output]) + self.connect(self.pwr, self.rc.input.adapt_to(VoltageSink())) + self.io = self.Export(self.rc.output.adapt_to(DigitalSingleSource.high_from_supply(self.pwr)), [Output]) self.gnd = self.Export(self.rc.gnd.adapt_to(Ground()), [Common]) - def connected(self, io: Optional[Port[DigitalLink]] = None) -> 'PullupDelayRc': + def connected(self, *, gnd: Optional[Port[VoltageLink]] = None, pwr: Optional[Port[VoltageLink]] = None, + io: Optional[Port[DigitalLink]] = None) -> 'PullupDelayRc': """Convenience function to connect both ports, returning this object so it can still be given a name.""" + if gnd is not None: + cast(Block, builder.get_enclosing_block()).connect(gnd, self.gnd) + if pwr is not None: + cast(Block, builder.get_enclosing_block()).connect(pwr, self.pwr) if io is not None: cast(Block, builder.get_enclosing_block()).connect(io, self.io) return self diff --git a/electronics_abstract_parts/Resettable.py b/electronics_abstract_parts/Resettable.py new file mode 100644 index 000000000..27612fc36 --- /dev/null +++ b/electronics_abstract_parts/Resettable.py @@ -0,0 +1,22 @@ +from electronics_model import * + + +class Resettable(BlockInterfaceMixin[Block]): + """Mixin for all devices that specifies a digital reset pin (active-low reset / active-high enable). + + THIS IS AN ADVANCED FEATURE - BE SURE TO UNDERSTAND THE RESET REQUIREMENTS OF DEVICES. + When disconnected (mixin not used or port not connected), reset circuitry is automatically generated if needed. + When connected, no additional reset circuitry is generated and the system designer is responsible for providing + appropriate reset signals. + Note that some chips have built-in pull-ups on their reset lines, these are not affected, but no external reset + circuitry will be generated. + + Devices may optionally require the reset pin where a power-on reset pulse is required and tying / pulling the + pin high is insufficient. + + Microcontrollers may generate internal programming connectors that drive this signal, and system designers must + connect microcontroller resets with this in mind - for example, only driving them in open-drain mode. + """ + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.reset = self.Port(DigitalSink.empty(), optional=True) diff --git a/electronics_abstract_parts/__init__.py b/electronics_abstract_parts/__init__.py index 7097af296..de3d1dfc5 100644 --- a/electronics_abstract_parts/__init__.py +++ b/electronics_abstract_parts/__init__.py @@ -34,6 +34,7 @@ from .ResistiveDivider import FeedbackVoltageDivider, SignalDivider from .PassiveFilters import LowPassRc, DigitalLowPassRc, DigitalLowPassRcArray, LowPassRcDac, PullupDelayRc from .I2cPullup import I2cPullup +from .Resettable import Resettable from .AbstractDiodes import BaseDiode, Diode, BaseDiodeStandardFootprint, TableDiode from .AbstractDiodes import ZenerDiode, TableZenerDiode, ProtectionZenerDiode @@ -54,7 +55,7 @@ from .AbstractSpiMemory import SpiMemory from .OpampCurrentSensor import OpampCurrentSensor from .DigitalAmplifiers import HighSideSwitch, HalfBridgeNFet, OpenDrainDriver -from .AbstractPowerConverters import VoltageRegulator, VoltageRegulatorEnable, VoltageRegulatorEnableWrapper +from .AbstractPowerConverters import VoltageRegulator, VoltageRegulatorEnableWrapper from .AbstractPowerConverters import LinearRegulator, VoltageReference, LinearRegulatorDevice, SwitchingVoltageRegulator from .AbstractPowerConverters import BuckConverter, DiscreteBuckConverter, BoostConverter, DiscreteBoostConverter from .AbstractPowerConverters import BuckConverterPowerPath, BoostConverterPowerPath, BuckBoostConverterPowerPath @@ -62,7 +63,8 @@ from .AbstractFuse import Fuse, PptcFuse, FuseStandardFootprint, TableFuse, SeriesPowerPptcFuse from .AbstractCrystal import Crystal, TableCrystal, OscillatorReference, CeramicResonator from .AbstractOscillator import Oscillator, TableOscillator -from .AbstractDebugHeaders import SwdCortexTargetConnector, SwdCortexTargetWithSwoTdiConnector +from .AbstractDebugHeaders import SwdCortexTargetConnector, SwdCortexTargetConnectorReset, \ + SwdCortexTargetConnectorSwo, SwdCortexTargetConnectorTdi from .AbstractTestPoint import TestPoint, VoltageTestPoint, DigitalTestPoint, DigitalArrayTestPoint, AnalogTestPoint from .AbstractTestPoint import I2cTestPoint, CanControllerTestPoint from .AbstractJumper import Jumper, DigitalJumper diff --git a/electronics_lib/BoostConverters_AnalogDevices.py b/electronics_lib/BoostConverters_AnalogDevices.py index 4f194f5d3..1a4b4ec60 100644 --- a/electronics_lib/BoostConverters_AnalogDevices.py +++ b/electronics_lib/BoostConverters_AnalogDevices.py @@ -46,7 +46,7 @@ class Ltc3429(VoltageRegulatorEnableWrapper, DiscreteBoostConverter): """Low-input-voltage boost converter (starts as low as 0.85V). Pin-compatible with the less-expensive UM3429S""" NMOS_CURRENT_LIMIT = 0.6 - def _generator_inner_enable_pin(self) -> Port[DigitalLink]: + def _generator_inner_reset_pin(self) -> Port[DigitalLink]: return self.ic.nshdn def contents(self): diff --git a/electronics_lib/BoostConverters_DiodesInc.py b/electronics_lib/BoostConverters_DiodesInc.py index 5d5290314..56aee668a 100644 --- a/electronics_lib/BoostConverters_DiodesInc.py +++ b/electronics_lib/BoostConverters_DiodesInc.py @@ -40,7 +40,7 @@ def contents(self): class Ap3012(VoltageRegulatorEnableWrapper, DiscreteBoostConverter): """Adjustable boost converter in SOT-23-5 with integrated switch""" - def _generator_inner_enable_pin(self) -> Port[DigitalLink]: + def _generator_inner_reset_pin(self) -> Port[DigitalLink]: return self.ic.nshdn def contents(self): diff --git a/electronics_lib/BoostConverters_Torex.py b/electronics_lib/BoostConverters_Torex.py index 42799e905..d60fd3a8e 100644 --- a/electronics_lib/BoostConverters_Torex.py +++ b/electronics_lib/BoostConverters_Torex.py @@ -70,13 +70,13 @@ def generate(self) -> None: ) -class Xc9142(VoltageRegulatorEnable, DiscreteBoostConverter, GeneratorBlock): +class Xc9142(Resettable, DiscreteBoostConverter, GeneratorBlock): """Low-input-voltage boost converter (starts as low as 0.9V) with fixed output. XC9142 has PWM/PFM functionality, compared to PWM only for XC9141. Semi pin compatible with XC9140, LTC3525, MAX1724.""" def contents(self): super().contents() - self.generator_param(self.enable.is_connected()) + self.generator_param(self.reset.is_connected()) with self.implicit_connect( ImplicitConnect(self.pwr_in, [Power]), @@ -98,7 +98,7 @@ def contents(self): def generate(self): super().generate() - if self.get(self.enable.is_connected()): - self.connect(self.enable, self.ic.ce) + if self.get(self.reset.is_connected()): + self.connect(self.reset, self.ic.ce) else: # CE resistor: recommended through a <1M resistor; must not be left open self.ce_res = self.Block(PullupResistor(100*kOhm(tol=0.2))).connected(pwr=self.pwr_in, io=self.ic.ce) diff --git a/electronics_lib/BuckConverter_Ap3418.py b/electronics_lib/BuckConverter_Ap3418.py index 7bd150e58..bd8521028 100644 --- a/electronics_lib/BuckConverter_Ap3418.py +++ b/electronics_lib/BuckConverter_Ap3418.py @@ -39,7 +39,7 @@ def contents(self) -> None: class Ap3418(VoltageRegulatorEnableWrapper, DiscreteBuckConverter): """Adjustable synchronous buck converter in SOT-23-5 with integrated switch""" - def _generator_inner_enable_pin(self) -> Port[DigitalLink]: + def _generator_inner_reset_pin(self) -> Port[DigitalLink]: return self.ic.en def contents(self): diff --git a/electronics_lib/BuckConverter_TexasInstruments.py b/electronics_lib/BuckConverter_TexasInstruments.py index 41517ae1c..d7e05a211 100644 --- a/electronics_lib/BuckConverter_TexasInstruments.py +++ b/electronics_lib/BuckConverter_TexasInstruments.py @@ -40,7 +40,7 @@ def contents(self) -> None: class Tps561201(VoltageRegulatorEnableWrapper, DiscreteBuckConverter): """Adjustable synchronous buck converter in SOT-23-6 with integrated switch""" - def _generator_inner_enable_pin(self) -> Port[DigitalLink]: + def _generator_inner_reset_pin(self) -> Port[DigitalLink]: return self.ic.en def contents(self): @@ -122,14 +122,14 @@ def contents(self) -> None: self.assign(self.actual_basic_part, False) -class Tps54202h(VoltageRegulatorEnable, DiscreteBuckConverter, GeneratorBlock): +class Tps54202h(Resettable, DiscreteBuckConverter, GeneratorBlock): """Adjustable synchronous buck converter in SOT-23-6 with integrated switch, 4.5-24v capable Note: TPS54202 has frequency spread-spectrum operation and internal pull-up on EN TPS54202H has no internal EN pull-up but a Zener diode clamp to limit voltage. """ def contents(self): super().contents() - self.generator_param(self.enable.is_connected()) + self.generator_param(self.reset.is_connected()) self.assign(self.frequency, (390, 590)*kHertz) @@ -169,8 +169,8 @@ def contents(self): def generate(self): super().generate() - if self.get(self.enable.is_connected()): - self.connect(self.enable, self.ic.en) + if self.get(self.reset.is_connected()): + self.connect(self.reset, self.ic.en) else: # by default tie high to enable regulator # an internal 6.9v Zener clamps the enable voltage, datasheet recommends at 510k resistor # a pull-up resistor isn't used because diff --git a/electronics_lib/DebugHeaders.py b/electronics_lib/DebugHeaders.py index cc9b3251f..0106a2cab 100644 --- a/electronics_lib/DebugHeaders.py +++ b/electronics_lib/DebugHeaders.py @@ -3,7 +3,8 @@ from .PassiveConnector_TagConnect import TagConnect -class SwdCortexTargetHeader(SwdCortexTargetWithSwoTdiConnector): +class SwdCortexTargetHeader(SwdCortexTargetConnector, SwdCortexTargetConnectorReset, SwdCortexTargetConnectorSwo, + SwdCortexTargetConnectorTdi): def contents(self): super().contents() self.conn = self.Block(PinHeader127DualShrouded(10)) @@ -15,10 +16,10 @@ def contents(self): self.connect(self.swd.swclk, self.conn.pins.request('4').adapt_to(DigitalSource())) self.connect(self.swo, self.conn.pins.request('6').adapt_to(DigitalBidir())) self.connect(self.tdi, self.conn.pins.request('8').adapt_to(DigitalBidir())) - self.connect(self.swd.reset, self.conn.pins.request('10').adapt_to(DigitalSource())) + self.connect(self.reset, self.conn.pins.request('10').adapt_to(DigitalSource())) -class SwdCortexTargetTagConnect(SwdCortexTargetWithSwoTdiConnector, Block): +class SwdCortexTargetTagConnect(SwdCortexTargetConnector, SwdCortexTargetConnectorReset, SwdCortexTargetConnectorSwo): """OFFICIAL tag connect SWD header using the TC2030 series cables. https://www.tag-connect.com/wp-content/uploads/bsk-pdf-manager/TC2030-CTX_1.pdf""" def contents(self): @@ -26,15 +27,14 @@ def contents(self): self.conn = self.Block(TagConnect(6)) self.connect(self.pwr, self.conn.pins.request('1').adapt_to(VoltageSink())) self.connect(self.swd.swdio, self.conn.pins.request('2').adapt_to(DigitalBidir())) # also TMS - self.connect(self.swd.reset, self.conn.pins.request('3').adapt_to(DigitalSource())) + self.connect(self.reset, self.conn.pins.request('3').adapt_to(DigitalSource())) self.connect(self.swd.swclk, self.conn.pins.request('4').adapt_to(DigitalSource())) self.connect(self.gnd, self.conn.pins.request('5').adapt_to(Ground())) self.connect(self.swo, self.conn.pins.request('6').adapt_to(DigitalBidir())) - # TODO the block shouldn't have TDI at all, but this maintains compatibility - self.require(~self.tdi.is_connected()) -class SwdCortexTargetTc2050(SwdCortexTargetWithSwoTdiConnector, Block): +class SwdCortexTargetTc2050(SwdCortexTargetConnector, SwdCortexTargetConnectorReset, SwdCortexTargetConnectorSwo, + SwdCortexTargetConnectorTdi): """UNOFFICIAL tag connect SWD header, maintaining physical pin compatibility with the 2x05 1.27mm header.""" def contents(self): super().contents() @@ -47,4 +47,4 @@ def contents(self): self.connect(self.swd.swclk, self.conn.pins.request('9').adapt_to(DigitalSource())) self.connect(self.swo, self.conn.pins.request('8').adapt_to(DigitalBidir())) self.connect(self.tdi, self.conn.pins.request('7').adapt_to(DigitalBidir())) - self.connect(self.swd.reset, self.conn.pins.request('6').adapt_to(DigitalSource())) + self.connect(self.reset, self.conn.pins.request('6').adapt_to(DigitalSource())) diff --git a/electronics_lib/LinearRegulators.py b/electronics_lib/LinearRegulators.py index b946dae3b..c2758eeaf 100644 --- a/electronics_lib/LinearRegulators.py +++ b/electronics_lib/LinearRegulators.py @@ -174,7 +174,7 @@ def generate(self): class Ap2204k(VoltageRegulatorEnableWrapper, LinearRegulator): """AP2204K block providing the LinearRegulator interface and optional enable (tied high if not connected). """ - def _generator_inner_enable_pin(self) -> Port[DigitalLink]: + def _generator_inner_reset_pin(self) -> Port[DigitalLink]: return self.ic.en def contents(self): @@ -313,7 +313,7 @@ def generate(self): class Xc6209(VoltageRegulatorEnableWrapper, LinearRegulator): """XC6209F (F: 300mA version, no pull-down resistor; 2: +/-2% accuracy) Low-ESR ceramic cap compatible""" - def _generator_inner_enable_pin(self) -> Port[DigitalLink]: + def _generator_inner_reset_pin(self) -> Port[DigitalLink]: return self.ic.ce def contents(self) -> None: @@ -384,7 +384,7 @@ def generate(self): class Ap2210(VoltageRegulatorEnableWrapper, LinearRegulator): """AP2210 RF ULDO in SOT-23-5 with high PSRR and high(er) voltage tolerant. """ - def _generator_inner_enable_pin(self) -> Port[DigitalLink]: + def _generator_inner_reset_pin(self) -> Port[DigitalLink]: return self.ic.en def contents(self) -> None: @@ -466,7 +466,7 @@ class Lp5907(VoltageRegulatorEnableWrapper, LinearRegulator): - AP139 - TCR2EF """ - def _generator_inner_enable_pin(self) -> Port[DigitalLink]: + def _generator_inner_reset_pin(self) -> Port[DigitalLink]: return self.ic.en def contents(self) -> None: diff --git a/electronics_lib/Microcontroller_Esp.py b/electronics_lib/Microcontroller_Esp.py index f4197eec4..3aab9dd0d 100644 --- a/electronics_lib/Microcontroller_Esp.py +++ b/electronics_lib/Microcontroller_Esp.py @@ -17,7 +17,6 @@ def __init__(self) -> None: self.uart = self.Port(UartPort.empty()) -@abstract_block class EspProgrammingAutoReset(BlockInterfaceMixin[EspProgrammingHeader]): """Mixin for ESP programming header with auto-reset and auto-boot pins""" def __init__(self, *args, **kwargs) -> None: diff --git a/electronics_lib/Microcontroller_Esp32.py b/electronics_lib/Microcontroller_Esp32.py index b26da7293..f5d745916 100644 --- a/electronics_lib/Microcontroller_Esp32.py +++ b/electronics_lib/Microcontroller_Esp32.py @@ -231,11 +231,16 @@ def generate(self) -> None: ) -class Esp32_Wroom_32(Microcontroller, Radiofrequency, HasEspProgramming, Esp32_Interfaces, IoControllerPowerRequired, - BaseIoControllerExportable): +class Esp32_Wroom_32(Microcontroller, Radiofrequency, HasEspProgramming, Resettable, Esp32_Interfaces, + IoControllerPowerRequired, BaseIoControllerExportable, GeneratorBlock): """Wrapper around Esp32c3_Wroom02 with external capacitors and UART programming header. NOT COMPATIBLE WITH QSPI PSRAM VARIANTS - for those, GPIO16 needs to be pulled up. """ + def __init__(self): + super().__init__() + self.ic: Esp32_Wroom_32_Device + self.generator_param(self.reset.is_connected()) + def contents(self) -> None: super().contents() @@ -247,12 +252,19 @@ def contents(self) -> None: self.connect(self.program_uart_node, self.ic.uart0) self.connect(self.program_en_node, self.ic.chip_pu) self.connect(self.program_boot_node, self.ic.io0) + # strapping pins are by default pulled to SPI boot, and can be reconfigured to download boot self.vcc_cap0 = imp.Block(DecouplingCapacitor(22 * uFarad(tol=0.2))) # C1 self.vcc_cap1 = imp.Block(DecouplingCapacitor(0.1 * uFarad(tol=0.2))) # C2 - # strapping pins are by default pulled to SPI boot, and can be reconfigured to download boot - self.en_pull = imp.Block(PullupDelayRc(10 * kOhm(tol=0.05), 10*mSecond(tol=0.2))).connected(io=self.ic.chip_pu) + def generate(self) -> None: + super().generate() + + if self.get(self.reset.is_connected()): + self.connect(self.reset, self.ic.chip_pu) + else: + self.en_pull = self.Block(PullupDelayRc(10 * kOhm(tol=0.05), 10*mSecond(tol=0.2))).connected( + gnd=self.gnd, pwr=self.pwr, io=self.ic.chip_pu) class Freenove_Esp32_Wrover(IoControllerUsbOut, IoControllerPowerOut, Esp32_Ios, IoController, GeneratorBlock, diff --git a/electronics_lib/Microcontroller_Esp32c3.py b/electronics_lib/Microcontroller_Esp32c3.py index fa6503b03..57963b9cc 100644 --- a/electronics_lib/Microcontroller_Esp32c3.py +++ b/electronics_lib/Microcontroller_Esp32c3.py @@ -145,9 +145,14 @@ def generate(self) -> None: self.assign(self.actual_basic_part, False) -class Esp32c3_Wroom02(Microcontroller, Radiofrequency, HasEspProgramming, Esp32c3_Interfaces, IoControllerPowerRequired, - BaseIoControllerExportable): +class Esp32c3_Wroom02(Microcontroller, Radiofrequency, HasEspProgramming, Resettable, Esp32c3_Interfaces, + IoControllerPowerRequired, BaseIoControllerExportable, GeneratorBlock): """Wrapper around Esp32c3_Wroom02 with external capacitors and UART programming header.""" + def __init__(self): + super().__init__() + self.ic: Esp32c3_Wroom02_Device + self.generator_param(self.reset.is_connected()) + def contents(self) -> None: super().contents() @@ -166,7 +171,16 @@ def contents(self) -> None: # Note strapping pins (section 3.3) IO2, 8, 9; IO9 is internally pulled up # IO9 (internally pulled up) is 1 for SPI boot and 0 for download boot # IO2 must be 1 for both SPI and download boot, while IO8 must be 1 for download boot - self.en_pull = imp.Block(PullupDelayRc(10 * kOhm(tol=0.05), 10*mSecond(tol=0.2))).connected(io=self.ic.en) vdd_pull = self.pwr.as_digital_source() self.connect(self.ic.io8, vdd_pull) self.connect(self.ic.io2, vdd_pull) + + + def generate(self) -> None: + super().generate() + + if self.get(self.reset.is_connected()): + self.connect(self.reset, self.ic.en) + else: + self.en_pull = self.Block(PullupDelayRc(10 * kOhm(tol=0.05), 10*mSecond(tol=0.2))).connected( + gnd=self.gnd, pwr=self.pwr, io=self.ic.en) diff --git a/electronics_lib/Microcontroller_Esp32s3.py b/electronics_lib/Microcontroller_Esp32s3.py index 5e1b55582..11f3fd20a 100644 --- a/electronics_lib/Microcontroller_Esp32s3.py +++ b/electronics_lib/Microcontroller_Esp32s3.py @@ -235,10 +235,15 @@ def generate(self) -> None: ) -class Esp32s3_Wroom_1(Microcontroller, Radiofrequency, HasEspProgramming, Esp32s3_Interfaces, IoControllerPowerRequired, - BaseIoControllerExportable): +class Esp32s3_Wroom_1(Microcontroller, Radiofrequency, HasEspProgramming, Resettable, Esp32s3_Interfaces, + IoControllerPowerRequired, BaseIoControllerExportable, GeneratorBlock): """ESP32-S3-WROOM-1 module """ + def __init__(self): + super().__init__() + self.ic: Esp32s3_Wroom_1_Device + self.generator_param(self.reset.is_connected()) + def contents(self) -> None: super().contents() @@ -254,7 +259,15 @@ def contents(self) -> None: self.vcc_cap0 = imp.Block(DecouplingCapacitor(22 * uFarad(tol=0.2))) # C1 self.vcc_cap1 = imp.Block(DecouplingCapacitor(0.1 * uFarad(tol=0.2))) # C2 - self.en_pull = imp.Block(PullupDelayRc(10 * kOhm(tol=0.05), 10*mSecond(tol=0.2))).connected(io=self.ic.chip_pu) + + def generate(self) -> None: + super().generate() + + if self.get(self.reset.is_connected()): + self.connect(self.reset, self.ic.chip_pu) + else: + self.en_pull = self.Block(PullupDelayRc(10 * kOhm(tol=0.05), 10*mSecond(tol=0.2))).connected( + gnd=self.gnd, pwr=self.pwr, io=self.ic.chip_pu) class Freenove_Esp32s3_Wroom(IoControllerUsbOut, IoControllerPowerOut, Esp32s3_Ios, IoController, GeneratorBlock, diff --git a/electronics_lib/Microcontroller_Lpc1549.py b/electronics_lib/Microcontroller_Lpc1549.py index 3742642eb..e54174392 100644 --- a/electronics_lib/Microcontroller_Lpc1549.py +++ b/electronics_lib/Microcontroller_Lpc1549.py @@ -33,7 +33,8 @@ def __init__(self, **kwargs) -> None: self.xtal_rtc = self.Port(CrystalDriver(frequency_limits=(32, 33)*kHertz, voltage_out=self.pwr.link().voltage), optional=True) - self.swd = self.Port(SwdTargetPort().empty()) + self.swd = self.Port(SwdTargetPort.empty()) + self.reset = self.Port(DigitalSink.empty()) # internally pulled up, TODO disable-able and assignable as GPIO self._io_ports.insert(0, self.swd) def _system_pinmap(self) -> Dict[str, CircuitPort]: @@ -51,6 +52,7 @@ def _system_pinmap(self) -> Dict[str, CircuitPort]: 'XTALOUT': self.xtal.xtal_out, # TODO Table 3, note 11, float if not used 'RTCXIN': self.xtal_rtc.xtal_in, # 14.5 can be grounded if RTC not used 'RTCXOUT': self.xtal_rtc.xtal_out, + 'RESET': self.reset }).remap(self.SYSTEM_PIN_REMAP) def _io_pinmap(self) -> PinMapUtil: @@ -91,6 +93,7 @@ def _io_pinmap(self) -> PinMapUtil: impedance=(300, 300) * Ohm # Table 25, "typical" rating ) + self.reset.init_from(DigitalSink.from_bidir(dio_5v_model)) uart_model = UartPort(DigitalBidir.empty()) spi_model = SpiController(DigitalBidir.empty()) spi_peripheral_model = SpiPeripheral(DigitalBidir.empty()) # MISO driven when CS asserted @@ -165,10 +168,9 @@ def _io_pinmap(self) -> PinMapUtil: 'dp': 'USB_DP', 'dm': 'USB_DM' }), - # Figure 49: requires a pull-up on SWDIO and pull-down on SWCLK, but none on RESET. - # Reset has an internal pull-up (or can be configured as unused), except when deep power down is needed + # Figure 49: requires a pull-up on SWDIO and pull-down on SWCLK PeripheralFixedResource('SWD', SwdTargetPort(DigitalBidir.empty()), { - 'swclk': ['PIO0_19'], 'swdio': ['PIO0_20'], 'reset': ['PIO0_21'], + 'swclk': ['PIO0_19'], 'swdio': ['PIO0_20'], }), ]).remap_pins(self.RESOURCE_PIN_REMAP) @@ -203,6 +205,7 @@ class Lpc1549_48_Device(Lpc1549Base_Device): 'XTALOUT': '25', 'RTCXIN': '31', 'RTCXOUT': '32', + 'RESET': '34', } RESOURCE_PIN_REMAP = { 'PIO0_0': '1', @@ -228,7 +231,7 @@ class Lpc1549_48_Device(Lpc1549Base_Device): 'PIO0_18': '13', 'PIO0_19': '29', 'PIO0_20': '33', - 'PIO0_21': '34', + # 'PIO0_21': '34', # RESET 'PIO0_22': '37', 'PIO0_23': '38', 'PIO0_24': '43', @@ -262,6 +265,7 @@ class Lpc1549_64_Device(Lpc1549Base_Device): 'XTALOUT': '35', 'RTCXIN': '42', 'RTCXOUT': '43', + 'RESET': '45', } RESOURCE_PIN_REMAP = { 'PIO0_0': '2', @@ -287,7 +291,7 @@ class Lpc1549_64_Device(Lpc1549Base_Device): 'PIO0_18': '17', 'PIO0_19': '40', 'PIO0_20': '44', - 'PIO0_21': '45', + # 'PIO0_21': '45', 'PIO0_22': '49', 'PIO0_23': '50', 'PIO0_24': '58', @@ -326,21 +330,21 @@ def __init__(self): def contents(self): super().contents() - self.swd.reset.init_from(DigitalSingleSource()) # not connected, ideal model self.swdio = self.Block(PullupResistor((10, 100) * kOhm(tol=0.05))).connected(self.pwr, self.swd.swdio) self.swclk = self.Block(PulldownResistor((10, 100) * kOhm(tol=0.05))).connected(self.gnd, self.swd.swclk) @abstract_block -class Lpc1549Base(IoControllerDac, IoControllerCan, IoControllerUsb, Microcontroller, +class Lpc1549Base(Resettable, IoControllerDac, IoControllerCan, IoControllerUsb, Microcontroller, IoControllerWithSwdTargetConnector, WithCrystalGenerator, IoControllerPowerRequired, - BaseIoControllerExportable): + BaseIoControllerExportable, GeneratorBlock): DEVICE: Type[Lpc1549Base_Device] = Lpc1549Base_Device # type: ignore DEFAULT_CRYSTAL_FREQUENCY = 12*MHertz(tol=0.005) def __init__(self, **kwargs): super().__init__(**kwargs) self.ic: Lpc1549Base_Device + self.generator_param(self.reset.is_connected()) def contents(self): super().contents() @@ -354,6 +358,7 @@ def contents(self): (self.swd_pull, ), _ = self.chain(self.swd_node, imp.Block(Lpc1549SwdPull()), self.ic.swd) + self.connect(self.reset_node, self.ic.reset) # one set of 0.1, 0.01uF caps for each Vdd, Vss pin, per reference schematic self.pwr_cap = ElementDict[DecouplingCapacitor]() @@ -372,6 +377,12 @@ def contents(self): self.vref_cap[1] = imp.Block(DecouplingCapacitor(0.1 * uFarad(tol=0.2))) self.vref_cap[2] = imp.Block(DecouplingCapacitor(10 * uFarad(tol=0.2))) + def generate(self): + super().generate() + + if self.get(self.reset.is_connected()): + self.connect(self.reset, self.ic.reset) + def _crystal_required(self) -> bool: # crystal needed for CAN or USB b/c tighter freq tolerance return len(self.get(self.can.requested())) > 0 or len(self.get(self.usb.requested())) > 0 \ or super()._crystal_required() diff --git a/electronics_lib/Microcontroller_Rp2040.py b/electronics_lib/Microcontroller_Rp2040.py index 853e82e91..be33ab118 100644 --- a/electronics_lib/Microcontroller_Rp2040.py +++ b/electronics_lib/Microcontroller_Rp2040.py @@ -45,14 +45,15 @@ def __init__(self, **kwargs) -> None: voltage_out=self.pwr.link().voltage), optional=True) - self.swd = self.Port(SwdTargetPort().empty()) + self.swd = self.Port(SwdTargetPort.empty()) + self.run = self.Port(DigitalSink.empty()) self._io_ports.insert(0, self.swd) def contents(self) -> None: super().contents() # Port models - self._dio_ft_model = DigitalBidir.from_supply( # Table 623 + self._dio_ft_model = DigitalBidir.from_supply( # Table 624 self.gnd, self.pwr, voltage_limit_tolerance=(-0.3, 0.3) * Volt, current_limits=(-12, 12)*mAmp, # by IOH / IOL modes @@ -63,6 +64,7 @@ def contents(self) -> None: self.qspi.init_from(SpiController(self._dio_std_model)) self.qspi_cs.init_from(self._dio_std_model) + self.run.init_from(DigitalSink.from_bidir(self._dio_ft_model)) # Pin/peripheral resource definitions (table 3) def _system_pinmap(self) -> Dict[str, CircuitPort]: @@ -79,6 +81,7 @@ def _system_pinmap(self) -> Dict[str, CircuitPort]: '24': self.swd.swclk, '25': self.swd.swdio, + '26': self.run, '19': self.gnd, # TESTEN, connect to gnd @@ -190,7 +193,7 @@ def _io_pinmap(self) -> PinMapUtil: }), PeripheralFixedPin('SWD', SwdTargetPort(self._dio_std_model), { - 'swdio': '25', 'swclk': '24', 'reset': '26', # reset is 'run' + 'swdio': '25', 'swclk': '24', }), ]) @@ -229,13 +232,14 @@ def contents(self) -> None: UsbBitBang.digital_external_from_link(self.usb_rp.dp))) -class Rp2040(IoControllerUsb, Microcontroller, IoControllerWithSwdTargetConnector, WithCrystalGenerator, - IoControllerPowerRequired, BaseIoControllerExportable): +class Rp2040(Resettable, IoControllerUsb, Microcontroller, IoControllerWithSwdTargetConnector, WithCrystalGenerator, + IoControllerPowerRequired, BaseIoControllerExportable, GeneratorBlock): DEFAULT_CRYSTAL_FREQUENCY = 12*MHertz(tol=0.005) def __init__(self, **kwargs): super().__init__(**kwargs) self.ic: Rp2040_Device + self.generator_param(self.reset.is_connected()) def contents(self) -> None: super().contents() @@ -248,6 +252,7 @@ def contents(self) -> None: self.ic = imp.Block(Rp2040_Device(pin_assigns=ArrayStringExpr())) self.connect(self.xtal_node, self.ic.xosc) self.connect(self.swd_node, self.ic.swd) + self.connect(self.reset_node, self.ic.run) self.iovdd_cap = ElementDict[DecouplingCapacitor]() for i in range(6): # one per IOVdd, combining USBVdd and IOVdd pin 49 per the example @@ -269,6 +274,12 @@ def contents(self) -> None: self.vreg_out_cap = self.Block(DecouplingCapacitor(1 * uFarad(tol=0.2))).connected(self.gnd, self.ic.dvdd) + def generate(self): + super().generate() + + if self.get(self.reset.is_connected()): + self.connect(self.reset, self.ic.run) + def _make_export_io(self, self_io: Port, inner_io: Port): if isinstance(self_io, UsbDevicePort): # assumed at most one USB port generates (self.usb_res, ), self.usb_chain = self.chain(inner_io, self.Block(Rp2040Usb()), self_io) diff --git a/electronics_lib/Microcontroller_Stm32f103.py b/electronics_lib/Microcontroller_Stm32f103.py index 024f7b846..ccd387f34 100644 --- a/electronics_lib/Microcontroller_Stm32f103.py +++ b/electronics_lib/Microcontroller_Stm32f103.py @@ -40,7 +40,7 @@ def __init__(self, **kwargs) -> None: voltage_out=self.pwr.link().voltage), optional=True) # Table 22 - self.swd = self.Port(SwdTargetPort().empty()) + self.swd = self.Port(SwdTargetPort.empty()) self._io_ports.insert(0, self.swd) def _system_pinmap(self) -> Dict[str, CircuitPort]: @@ -53,6 +53,7 @@ def _system_pinmap(self) -> Dict[str, CircuitPort]: 'BOOT0': self.gnd, 'OSC_IN': self.osc.xtal_in, # TODO remappable to PD0 'OSC_OUT': self.osc.xtal_out, # TODO remappable to PD1 + 'NRST': self.nrst, }).remap(self.SYSTEM_PIN_REMAP) def _io_pinmap(self) -> PinMapUtil: @@ -163,7 +164,7 @@ def _io_pinmap(self) -> PinMapUtil: 'dm': ['PA11'], 'dp': ['PA12'] }), PeripheralFixedPin('SWD', SwdTargetPort(dio_std_model), { # TODO most are FT pins - 'swdio': 'PA13', 'swclk': 'PA14', 'reset': 'NRST' # note: SWO is PB3 + 'swdio': 'PA13', 'swclk': 'PA14', # note: SWO is PB3 }), PeripheralFixedResource('I2C1', i2c_model, { 'scl': ['PB6', 'PB8'], 'sda': ['PB7', 'PB9'] @@ -196,12 +197,12 @@ class Stm32f103_48_Device(Stm32f103Base_Device): 'BOOT0': '44', 'OSC_IN': '5', 'OSC_OUT': '6', + 'NRST': '7', } RESOURCE_PIN_REMAP = { 'PC13': '2', 'PC14': '3', 'PC15': '4', - 'NRST': '7', 'PA0': '10', 'PA1': '11', @@ -261,14 +262,15 @@ def __init__(self, resistance: RangeLike): @abstract_block -class Stm32f103Base(IoControllerCan, IoControllerUsb, Microcontroller, IoControllerWithSwdTargetConnector, - WithCrystalGenerator, IoControllerPowerRequired, BaseIoControllerExportable): +class Stm32f103Base(Resettable, IoControllerCan, IoControllerUsb, Microcontroller, IoControllerWithSwdTargetConnector, + WithCrystalGenerator, IoControllerPowerRequired, BaseIoControllerExportable, GeneratorBlock): DEVICE: Type[Stm32f103Base_Device] = Stm32f103Base_Device # type: ignore DEFAULT_CRYSTAL_FREQUENCY = 12*MHertz(tol=0.005) def __init__(self, **kwargs): super().__init__(**kwargs) self.ic: Stm32f103Base_Device + self.generator_param(self.reset.is_connected()) def contents(self): super().contents() @@ -280,6 +282,7 @@ def contents(self): self.ic = imp.Block(self.DEVICE(pin_assigns=ArrayStringExpr())) self.connect(self.xtal_node, self.ic.osc) self.connect(self.swd_node, self.ic.swd) + self.connect(self.reset_node, self.ic.nrst) self.pwr_cap = ElementDict[DecouplingCapacitor]() # one 0.1uF cap each for Vdd1-5 and one bulk 4.7uF cap @@ -291,6 +294,12 @@ def contents(self): self.vdda_cap_0 = imp.Block(DecouplingCapacitor(10 * nFarad(tol=0.2))) self.vdda_cap_1 = imp.Block(DecouplingCapacitor(1 * uFarad(tol=0.2))) + def generate(self): + super().generate() + + if self.get(self.reset.is_connected()): + self.connect(self.reset, self.ic.nrst) + def _make_export_io(self, self_io: Port, inner_io: Port): if isinstance(self_io, UsbDevicePort): # assumed at most one USB port generates self.usb_pull = self.Block(UsbDpPullUp(resistance=1.5*kOhm(tol=0.01))) # required by datasheet Table 44 # TODO proper tolerancing? diff --git a/electronics_lib/Microcontroller_nRF52840.py b/electronics_lib/Microcontroller_nRF52840.py index 73ceaca9f..ee4d8dacc 100644 --- a/electronics_lib/Microcontroller_nRF52840.py +++ b/electronics_lib/Microcontroller_nRF52840.py @@ -117,7 +117,7 @@ def _io_pinmap(self) -> PinMapUtil: PinResource('P1.00', {'P1.00': dio_model}), # TRACEDATA[0] and SWO, if used as IO must clear TRACECONFIG reg PeripheralFixedPin('SWD', SwdTargetPort(dio_model), { - 'swclk': 'SWCLK', 'swdio': 'SWDIO', 'reset': 'P0.18' + 'swclk': 'SWCLK', 'swdio': 'SWDIO', }), PeripheralFixedPin('USBD', UsbDevicePort(), { 'dp': 'D+', 'dm': 'D-' @@ -180,6 +180,7 @@ def _system_pinmap(self) -> Dict[str, CircuitPort]: 'Vdd': self.pwr, 'Vss': self.gnd, 'Vbus': self.pwr_usb, + 'nRESET': self.nreset, }).remap(self.SYSTEM_PIN_REMAP) def __init__(self, **kwargs) -> None: @@ -203,7 +204,8 @@ def __init__(self, **kwargs) -> None: self.xtal_rtc = self.Port(CrystalDriver(frequency_limits=(32, 33)*kHertz, voltage_out=self.pwr.link().voltage), optional=True) - self.swd = self.Port(SwdTargetPort().empty()) + self.swd = self.Port(SwdTargetPort.empty()) + self.nreset = self.Port(DigitalSink.from_bidir(self._dio_model(self.gnd, self.pwr))) self._io_ports.insert(0, self.swd) @@ -212,6 +214,7 @@ class Holyiot_18010_Device(Nrf52840_Base): 'Vdd': '14', 'Vss': ['1', '25', '37'], 'Vbus': '22', + 'nRESET': '21', } RESOURCE_PIN_REMAP = { # boundary pins only, inner pins ignored 'P1.11': '2', @@ -233,7 +236,6 @@ class Holyiot_18010_Device(Nrf52840_Base): 'P0.23': '18', 'P0.21': '19', 'P0.19': '20', - 'P0.18': '21', 'D-': '23', 'D+': '24', @@ -261,14 +263,15 @@ def generate(self) -> None: ) -class Holyiot_18010(Microcontroller, Radiofrequency, Nrf52840_Interfaces, IoControllerWithSwdTargetConnector, - IoControllerPowerRequired, BaseIoControllerExportable): +class Holyiot_18010(Microcontroller, Radiofrequency, Resettable, Nrf52840_Interfaces, IoControllerWithSwdTargetConnector, + IoControllerPowerRequired, BaseIoControllerExportable, GeneratorBlock): """Wrapper around the Holyiot 18010 that includes supporting components (programming port)""" def __init__(self, **kwargs): super().__init__(**kwargs) self.ic: Holyiot_18010_Device self.ic = self.Block(Holyiot_18010_Device(pin_assigns=ArrayStringExpr())) self.pwr_usb = self.Export(self.ic.pwr_usb, optional=True) + self.generator_param(self.reset.is_connected()) def contents(self): super().contents() @@ -276,13 +279,18 @@ def contents(self): self.connect(self.gnd, self.ic.gnd) self.connect(self.swd_node, self.ic.swd) + self.connect(self.reset_node, self.ic.nreset) + def generate(self): + if self.get(self.reset.is_connected()): + self.connect(self.reset, self.ic.nreset) class Mdbt50q_1mv2_Device(Nrf52840_Base, JlcPart): SYSTEM_PIN_REMAP: Dict[str, Union[str, List[str]]] = { 'Vdd': ['28', '30'], # 28=Vdd, 30=VddH; 31=DccH is disconnected - from section 8.3 for input voltage <3.6v 'Vss': ['1', '2', '15', '33', '55'], 'Vbus': '32', + 'nRESET': '40', } RESOURCE_PIN_REMAP = { # boundary pins only, inner pins ignored 'P1.10': '3', @@ -318,7 +326,6 @@ class Mdbt50q_1mv2_Device(Nrf52840_Base, JlcPart): 'P0.13': '37', 'P0.16': '38', 'P0.15': '39', - 'P0.18': '40', 'P0.17': '41', 'P0.19': '42', 'P0.21': '43', @@ -368,14 +375,15 @@ def __init__(self): self.connect(self.usb_outer.dm, self.res_dm.b.adapt_to(DigitalBidir())) -class Mdbt50q_1mv2(Microcontroller, Radiofrequency, Nrf52840_Interfaces, IoControllerWithSwdTargetConnector, - IoControllerPowerRequired, BaseIoControllerExportable): +class Mdbt50q_1mv2(Microcontroller, Radiofrequency, Resettable, Nrf52840_Interfaces, IoControllerWithSwdTargetConnector, + IoControllerPowerRequired, BaseIoControllerExportable, GeneratorBlock): """Wrapper around the Mdbt50q_1mv2 that includes the reference schematic""" def __init__(self, **kwargs): super().__init__(**kwargs) self.ic: Mdbt50q_1mv2_Device self.ic = self.Block(Mdbt50q_1mv2_Device(pin_assigns=ArrayStringExpr())) # defined in generator to mix in SWO/TDI self.pwr_usb = self.Export(self.ic.pwr_usb, optional=True) + self.generator_param(self.reset.is_connected()) def contents(self) -> None: super().contents() @@ -383,6 +391,7 @@ def contents(self) -> None: self.connect(self.gnd, self.ic.gnd) self.connect(self.swd_node, self.ic.swd) + self.connect(self.reset_node, self.ic.nreset) with self.implicit_connect( ImplicitConnect(self.pwr, [Power]), @@ -390,6 +399,12 @@ def contents(self) -> None: ) as imp: self.vcc_cap = imp.Block(DecouplingCapacitor(10 * uFarad(tol=0.2))) + def generate(self): + super().generate() + + if self.get(self.reset.is_connected()): + self.connect(self.reset, self.ic.nreset) + def _make_export_io(self, self_io: Port, inner_io: Port): if isinstance(self_io, UsbDevicePort): # assumed at most one USB port generates (self.usb_res, ), self.usb_chain = self.chain(inner_io, self.Block(Mdbt50q_UsbSeriesResistor()), self_io) diff --git a/electronics_model/DebugPorts.py b/electronics_model/DebugPorts.py index 2866118ae..324b5e1e8 100644 --- a/electronics_model/DebugPorts.py +++ b/electronics_model/DebugPorts.py @@ -19,8 +19,6 @@ def contents(self) -> None: flatten=True) self.swclk = self.connect(self.host.swclk, self.device.swclk, self.pull.map_extract(lambda port: port.swclk), flatten=True) - self.reset = self.connect(self.host.reset, self.device.reset, self.pull.map_extract(lambda port: port.reset), - flatten=True) class SwdHostPort(Bundle[SwdLink]): @@ -32,7 +30,6 @@ def __init__(self, model: Optional[DigitalBidir] = None) -> None: model = DigitalBidir() # ideal by default self.swdio = self.Port(model) self.swclk = self.Port(DigitalSource.from_bidir(model)) - self.reset = self.Port(DigitalSource.from_bidir(model)) class SwdTargetPort(Bundle[SwdLink]): @@ -44,7 +41,6 @@ def __init__(self, model: Optional[DigitalBidir] = None) -> None: model = DigitalBidir() # ideal by default self.swdio = self.Port(model) self.swclk = self.Port(DigitalSink.from_bidir(model)) - self.reset = self.Port(DigitalSink.from_bidir(model)) class SwdPullPort(Bundle[SwdLink]): @@ -56,4 +52,3 @@ def __init__(self, model: Optional[DigitalSingleSource] = None) -> None: model = DigitalSingleSource() # ideal by default self.swdio = self.Port(model) self.swclk = self.Port(model) - self.reset = self.Port(model) diff --git a/examples/CanAdapter/CanAdapter.net b/examples/CanAdapter/CanAdapter.net index 3a2c4ad41..fe3c167a8 100644 --- a/examples/CanAdapter/CanAdapter.net +++ b/examples/CanAdapter/CanAdapter.net @@ -763,7 +763,7 @@ (node (ref mcu.ic) (pin 29)) (node (ref mcu.swd) (pin 9)) (node (ref mcu.swd_pull.swclk) (pin 2))) -(net (code 34) (name "mcu.swd_node.reset") +(net (code 34) (name "mcu.reset_node") (node (ref mcu.ic) (pin 34)) (node (ref mcu.swd) (pin 6))) (net (code 35) (name "mcu.swd.swo") diff --git a/examples/Datalogger/Datalogger.net b/examples/Datalogger/Datalogger.net index 7dc9145df..4f18500fb 100644 --- a/examples/Datalogger/Datalogger.net +++ b/examples/Datalogger/Datalogger.net @@ -1584,7 +1584,7 @@ (node (ref mcu.ic) (pin 40)) (node (ref mcu.swd) (pin 4)) (node (ref mcu.swd_pull.swclk) (pin 2))) -(net (code 59) (name "mcu.swd_node.reset") +(net (code 59) (name "mcu.reset_node") (node (ref mcu.ic) (pin 45)) (node (ref mcu.swd) (pin 10))) (net (code 60) (name "mcu.swd.swo") diff --git a/examples/Fcml/Fcml.net b/examples/Fcml/Fcml.net index 0bc98c803..6e6a3c201 100644 --- a/examples/Fcml/Fcml.net +++ b/examples/Fcml/Fcml.net @@ -2563,7 +2563,7 @@ (net (code 94) (name "mcu.swd_node.swclk") (node (ref mcu.ic) (pin 24)) (node (ref mcu.swd) (pin 4))) -(net (code 95) (name "mcu.swd_node.reset") +(net (code 95) (name "mcu.reset_node") (node (ref mcu.ic) (pin 26)) (node (ref mcu.swd) (pin 10))) (net (code 96) (name "mcu.ic.qspi.sck") diff --git a/examples/HighSwitch/HighSwitch.net b/examples/HighSwitch/HighSwitch.net index 24e9b5f5a..779c84ee5 100644 --- a/examples/HighSwitch/HighSwitch.net +++ b/examples/HighSwitch/HighSwitch.net @@ -1268,7 +1268,7 @@ (node (ref mcu.ic) (pin 29)) (node (ref mcu.swd) (pin 4)) (node (ref mcu.swd_pull.swclk) (pin 2))) -(net (code 34) (name "mcu.swd_node.reset") +(net (code 34) (name "mcu.reset_node") (node (ref mcu.ic) (pin 34)) (node (ref mcu.swd) (pin 10))) (net (code 35) (name "mcu.swd.swo") diff --git a/examples/IotDisplay/IotDisplay.net b/examples/IotDisplay/IotDisplay.net index f06fc2218..be8410d94 100644 --- a/examples/IotDisplay/IotDisplay.net +++ b/examples/IotDisplay/IotDisplay.net @@ -374,6 +374,17 @@ (property (name "edg_part") (value "CC0603KRX7R9BB104 (YAGEO)")) (sheetpath (names "/mcu/") (tstamps "/02850146/")) (tstamps "0e5a0301")) +(comp (ref "mcu.prog") + (value "") + (footprint "Connector:Tag-Connect_TC2030-IDC-FP_2x03_P1.27mm_Vertical") + (property (name "Sheetname") (value "mcu")) + (property (name "Sheetfile") (value "electronics_lib.Microcontroller_Esp32s3.Esp32s3_Wroom_1")) + (property (name "edg_path") (value "mcu.prog.conn")) + (property (name "edg_short_path") (value "mcu.prog")) + (property (name "edg_refdes") (value "DJ3")) + (property (name "edg_part") (value "")) + (sheetpath (names "/mcu/") (tstamps "/02850146/")) + (tstamps "045f01b9")) (comp (ref "mcu.en_pull.r") (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 10kΩ 0603 Chip Resistor - Surface Mount ROHS") (footprint "Resistor_SMD:R_0603_1608Metric") @@ -396,17 +407,6 @@ (property (name "edg_part") (value "CL10A105KB8NNNC (Samsung Electro-Mechanics)")) (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) (tstamps "00640064")) -(comp (ref "mcu.prog") - (value "") - (footprint "Connector:Tag-Connect_TC2030-IDC-FP_2x03_P1.27mm_Vertical") - (property (name "Sheetname") (value "mcu")) - (property (name "Sheetfile") (value "electronics_lib.Microcontroller_Esp32s3.Esp32s3_Wroom_1")) - (property (name "edg_path") (value "mcu.prog.conn")) - (property (name "edg_short_path") (value "mcu.prog")) - (property (name "edg_refdes") (value "DJ3")) - (property (name "edg_part") (value "")) - (sheetpath (names "/mcu/") (tstamps "/02850146/")) - (tstamps "045f01b9")) (comp (ref "usb_esd") (value "PESD5V0X1BT (Nexperia)") (footprint "Package_TO_SOT_SMD:SOT-23") diff --git a/examples/IotFan/IotFan.net b/examples/IotFan/IotFan.net index 7f1adf4c6..19562fe5f 100644 --- a/examples/IotFan/IotFan.net +++ b/examples/IotFan/IotFan.net @@ -275,6 +275,17 @@ (property (name "edg_part") (value "CC0603KRX7R9BB104 (YAGEO)")) (sheetpath (names "/mcu/") (tstamps "/02850146/")) (tstamps "0e5a0301")) +(comp (ref "mcu.prog") + (value "") + (footprint "Connector:Tag-Connect_TC2030-IDC-NL_2x03_P1.27mm_Vertical") + (property (name "Sheetname") (value "mcu")) + (property (name "Sheetfile") (value "electronics_lib.Microcontroller_Esp32c3.Esp32c3_Wroom02")) + (property (name "edg_path") (value "mcu.prog.conn")) + (property (name "edg_short_path") (value "mcu.prog")) + (property (name "edg_refdes") (value "FJ2")) + (property (name "edg_part") (value "")) + (sheetpath (names "/mcu/") (tstamps "/02850146/")) + (tstamps "045f01b9")) (comp (ref "mcu.en_pull.r") (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 10kΩ 0603 Chip Resistor - Surface Mount ROHS") (footprint "Resistor_SMD:R_0603_1608Metric") @@ -297,17 +308,6 @@ (property (name "edg_part") (value "CL10A105KB8NNNC (Samsung Electro-Mechanics)")) (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) (tstamps "00640064")) -(comp (ref "mcu.prog") - (value "") - (footprint "Connector:Tag-Connect_TC2030-IDC-NL_2x03_P1.27mm_Vertical") - (property (name "Sheetname") (value "mcu")) - (property (name "Sheetfile") (value "electronics_lib.Microcontroller_Esp32c3.Esp32c3_Wroom02")) - (property (name "edg_path") (value "mcu.prog.conn")) - (property (name "edg_short_path") (value "mcu.prog")) - (property (name "edg_refdes") (value "FJ2")) - (property (name "edg_part") (value "")) - (sheetpath (names "/mcu/") (tstamps "/02850146/")) - (tstamps "045f01b9")) (comp (ref "ledr.package") (value "KT-0603R (Hubei KENTO Elec) - Red 615~630nm 1.9~2.2V 0603 Light Emitting Diodes (LED) RoHS") (footprint "LED_SMD:LED_0603_1608Metric") diff --git a/examples/IotKnob/IotKnob.net b/examples/IotKnob/IotKnob.net index 9923c11a6..1570e76c7 100644 --- a/examples/IotKnob/IotKnob.net +++ b/examples/IotKnob/IotKnob.net @@ -176,6 +176,17 @@ (property (name "edg_part") (value "CC0603KRX7R9BB104 (YAGEO)")) (sheetpath (names "/mcu/") (tstamps "/02850146/")) (tstamps "0e5a0301")) +(comp (ref "mcu.prog") + (value "") + (footprint "Connector:Tag-Connect_TC2030-IDC-FP_2x03_P1.27mm_Vertical") + (property (name "Sheetname") (value "mcu")) + (property (name "Sheetfile") (value "electronics_lib.Microcontroller_Esp32s3.Esp32s3_Wroom_1")) + (property (name "edg_path") (value "mcu.prog.conn")) + (property (name "edg_short_path") (value "mcu.prog")) + (property (name "edg_refdes") (value "KJ2")) + (property (name "edg_part") (value "")) + (sheetpath (names "/mcu/") (tstamps "/02850146/")) + (tstamps "045f01b9")) (comp (ref "mcu.en_pull.r") (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 10kΩ 0603 Chip Resistor - Surface Mount ROHS") (footprint "Resistor_SMD:R_0603_1608Metric") @@ -198,17 +209,6 @@ (property (name "edg_part") (value "CL10A105KB8NNNC (Samsung Electro-Mechanics)")) (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) (tstamps "00640064")) -(comp (ref "mcu.prog") - (value "") - (footprint "Connector:Tag-Connect_TC2030-IDC-FP_2x03_P1.27mm_Vertical") - (property (name "Sheetname") (value "mcu")) - (property (name "Sheetfile") (value "electronics_lib.Microcontroller_Esp32s3.Esp32s3_Wroom_1")) - (property (name "edg_path") (value "mcu.prog.conn")) - (property (name "edg_short_path") (value "mcu.prog")) - (property (name "edg_refdes") (value "KJ2")) - (property (name "edg_part") (value "")) - (sheetpath (names "/mcu/") (tstamps "/02850146/")) - (tstamps "045f01b9")) (comp (ref "i2c_pull.scl_res") (value "0603WAF4701T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 4.7kΩ 0603 Chip Resistor - Surface Mount ROHS") (footprint "Resistor_SMD:R_0603_1608Metric") diff --git a/examples/IotLedDriver/IotLedDriver.net b/examples/IotLedDriver/IotLedDriver.net index 12ad5540d..8bc125f4e 100644 --- a/examples/IotLedDriver/IotLedDriver.net +++ b/examples/IotLedDriver/IotLedDriver.net @@ -275,6 +275,17 @@ (property (name "edg_part") (value "CC0603KRX7R9BB104 (YAGEO)")) (sheetpath (names "/mcu/") (tstamps "/02850146/")) (tstamps "0e5a0301")) +(comp (ref "mcu.prog") + (value "") + (footprint "Connector:Tag-Connect_TC2030-IDC-NL_2x03_P1.27mm_Vertical") + (property (name "Sheetname") (value "mcu")) + (property (name "Sheetfile") (value "electronics_lib.Microcontroller_Esp32s3.Esp32s3_Wroom_1")) + (property (name "edg_path") (value "mcu.prog.conn")) + (property (name "edg_short_path") (value "mcu.prog")) + (property (name "edg_refdes") (value "LJ2")) + (property (name "edg_part") (value "")) + (sheetpath (names "/mcu/") (tstamps "/02850146/")) + (tstamps "045f01b9")) (comp (ref "mcu.en_pull.r") (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 10kΩ 0603 Chip Resistor - Surface Mount ROHS") (footprint "Resistor_SMD:R_0603_1608Metric") @@ -297,17 +308,6 @@ (property (name "edg_part") (value "CL10A105KB8NNNC (Samsung Electro-Mechanics)")) (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) (tstamps "00640064")) -(comp (ref "mcu.prog") - (value "") - (footprint "Connector:Tag-Connect_TC2030-IDC-NL_2x03_P1.27mm_Vertical") - (property (name "Sheetname") (value "mcu")) - (property (name "Sheetfile") (value "electronics_lib.Microcontroller_Esp32s3.Esp32s3_Wroom_1")) - (property (name "edg_path") (value "mcu.prog.conn")) - (property (name "edg_short_path") (value "mcu.prog")) - (property (name "edg_refdes") (value "LJ2")) - (property (name "edg_part") (value "")) - (sheetpath (names "/mcu/") (tstamps "/02850146/")) - (tstamps "045f01b9")) (comp (ref "ledr.package") (value "KT-0603R (Hubei KENTO Elec) - Red 615~630nm 1.9~2.2V 0603 Light Emitting Diodes (LED) RoHS") (footprint "LED_SMD:LED_0603_1608Metric") diff --git a/examples/LedMatrix/LedMatrix.net b/examples/LedMatrix/LedMatrix.net index 2499c5af3..d62282732 100644 --- a/examples/LedMatrix/LedMatrix.net +++ b/examples/LedMatrix/LedMatrix.net @@ -176,28 +176,6 @@ (property (name "edg_part") (value "CC0603KRX7R9BB104 (YAGEO)")) (sheetpath (names "/mcu/") (tstamps "/02850146/")) (tstamps "0e5a0301")) -(comp (ref "mcu.en_pull.r") - (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 10kΩ 0603 Chip Resistor - Surface Mount ROHS") - (footprint "Resistor_SMD:R_0603_1608Metric") - (property (name "Sheetname") (value "en_pull")) - (property (name "Sheetfile") (value "electronics_abstract_parts.PassiveFilters.PullupDelayRc")) - (property (name "edg_path") (value "mcu.en_pull.rc.r")) - (property (name "edg_short_path") (value "mcu.en_pull.r")) - (property (name "edg_refdes") (value "R3")) - (property (name "edg_part") (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec))")) - (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) - (tstamps "00730073")) -(comp (ref "mcu.en_pull.c") - (value "CL10A105KB8NNNC (Samsung Electro-Mechanics) - 50V 1uF X5R ±10% 0603 Multilayer Ceramic Capacitors MLCC - SMD/SMT ROHS") - (footprint "Capacitor_SMD:C_0603_1608Metric") - (property (name "Sheetname") (value "en_pull")) - (property (name "Sheetfile") (value "electronics_abstract_parts.PassiveFilters.PullupDelayRc")) - (property (name "edg_path") (value "mcu.en_pull.rc.c")) - (property (name "edg_short_path") (value "mcu.en_pull.c")) - (property (name "edg_refdes") (value "C5")) - (property (name "edg_part") (value "CL10A105KB8NNNC (Samsung Electro-Mechanics)")) - (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) - (tstamps "00640064")) (comp (ref "mcu.prog") (value "PinHeader2.54 1x4 (Generic)") (footprint "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical") @@ -220,6 +198,28 @@ (property (name "edg_part") (value "5.1mm switch")) (sheetpath (names "/mcu/") (tstamps "/02850146/")) (tstamps "042b01b5")) +(comp (ref "mcu.en_pull.r") + (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 10kΩ 0603 Chip Resistor - Surface Mount ROHS") + (footprint "Resistor_SMD:R_0603_1608Metric") + (property (name "Sheetname") (value "en_pull")) + (property (name "Sheetfile") (value "electronics_abstract_parts.PassiveFilters.PullupDelayRc")) + (property (name "edg_path") (value "mcu.en_pull.rc.r")) + (property (name "edg_short_path") (value "mcu.en_pull.r")) + (property (name "edg_refdes") (value "R3")) + (property (name "edg_part") (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec))")) + (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) + (tstamps "00730073")) +(comp (ref "mcu.en_pull.c") + (value "CL10A105KB8NNNC (Samsung Electro-Mechanics) - 50V 1uF X5R ±10% 0603 Multilayer Ceramic Capacitors MLCC - SMD/SMT ROHS") + (footprint "Capacitor_SMD:C_0603_1608Metric") + (property (name "Sheetname") (value "en_pull")) + (property (name "Sheetfile") (value "electronics_abstract_parts.PassiveFilters.PullupDelayRc")) + (property (name "edg_path") (value "mcu.en_pull.rc.c")) + (property (name "edg_short_path") (value "mcu.en_pull.c")) + (property (name "edg_refdes") (value "C5")) + (property (name "edg_part") (value "CL10A105KB8NNNC (Samsung Electro-Mechanics)")) + (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) + (tstamps "00640064")) (comp (ref "sw1") (value "5.1mm switch") (footprint "Button_Switch_SMD:SW_SPST_SKQG_WithoutStem") diff --git a/examples/Multimeter/Multimeter.net b/examples/Multimeter/Multimeter.net index 16727fea0..aded1e2d8 100644 --- a/examples/Multimeter/Multimeter.net +++ b/examples/Multimeter/Multimeter.net @@ -1570,7 +1570,7 @@ (net (code 54) (name "mcu.swd_node.swclk") (node (ref mcu.ic) (pin 53)) (node (ref mcu.swd) (pin 9))) -(net (code 55) (name "mcu.swd_node.reset") +(net (code 55) (name "mcu.reset_node") (node (ref mcu.ic) (pin 40)) (node (ref mcu.swd) (pin 6))) (net (code 56) (name "mcu.usb_chain_0.d_P") diff --git a/examples/RobotCrawler/RobotCrawler.net b/examples/RobotCrawler/RobotCrawler.net index eea1c7bdc..2419c34fc 100644 --- a/examples/RobotCrawler/RobotCrawler.net +++ b/examples/RobotCrawler/RobotCrawler.net @@ -330,6 +330,17 @@ (property (name "edg_part") (value "CC0603KRX7R9BB104 (YAGEO)")) (sheetpath (names "/mcu/") (tstamps "/02850146/")) (tstamps "0e5a0301")) +(comp (ref "mcu.prog") + (value "") + (footprint "Connector:Tag-Connect_TC2030-IDC-FP_2x03_P1.27mm_Vertical") + (property (name "Sheetname") (value "mcu")) + (property (name "Sheetfile") (value "electronics_lib.Microcontroller_Esp32s3.Esp32s3_Wroom_1")) + (property (name "edg_path") (value "mcu.prog.conn")) + (property (name "edg_short_path") (value "mcu.prog")) + (property (name "edg_refdes") (value "RJ6")) + (property (name "edg_part") (value "")) + (sheetpath (names "/mcu/") (tstamps "/02850146/")) + (tstamps "045f01b9")) (comp (ref "mcu.en_pull.r") (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 10kΩ 0603 Chip Resistor - Surface Mount ROHS") (footprint "Resistor_SMD:R_0603_1608Metric") @@ -352,17 +363,6 @@ (property (name "edg_part") (value "CL10A105KB8NNNC (Samsung Electro-Mechanics)")) (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) (tstamps "00640064")) -(comp (ref "mcu.prog") - (value "") - (footprint "Connector:Tag-Connect_TC2030-IDC-FP_2x03_P1.27mm_Vertical") - (property (name "Sheetname") (value "mcu")) - (property (name "Sheetfile") (value "electronics_lib.Microcontroller_Esp32s3.Esp32s3_Wroom_1")) - (property (name "edg_path") (value "mcu.prog.conn")) - (property (name "edg_short_path") (value "mcu.prog")) - (property (name "edg_refdes") (value "RJ6")) - (property (name "edg_part") (value "")) - (sheetpath (names "/mcu/") (tstamps "/02850146/")) - (tstamps "045f01b9")) (comp (ref "i2c_pull.scl_res") (value "0603WAF4701T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 4.7kΩ 0603 Chip Resistor - Surface Mount ROHS") (footprint "Resistor_SMD:R_0603_1608Metric") diff --git a/examples/RobotDriver/RobotDriver.net b/examples/RobotDriver/RobotDriver.net index 6bb3f1fe2..90dac2ccb 100644 --- a/examples/RobotDriver/RobotDriver.net +++ b/examples/RobotDriver/RobotDriver.net @@ -264,28 +264,6 @@ (property (name "edg_part") (value "CC0603KRX7R9BB104 (YAGEO)")) (sheetpath (names "/mcu/") (tstamps "/02850146/")) (tstamps "0e5a0301")) -(comp (ref "mcu.en_pull.r") - (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 10kΩ 0603 Chip Resistor - Surface Mount ROHS") - (footprint "Resistor_SMD:R_0603_1608Metric") - (property (name "Sheetname") (value "en_pull")) - (property (name "Sheetfile") (value "electronics_abstract_parts.PassiveFilters.PullupDelayRc")) - (property (name "edg_path") (value "mcu.en_pull.rc.r")) - (property (name "edg_short_path") (value "mcu.en_pull.r")) - (property (name "edg_refdes") (value "R8")) - (property (name "edg_part") (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec))")) - (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) - (tstamps "00730073")) -(comp (ref "mcu.en_pull.c") - (value "CL10A105KB8NNNC (Samsung Electro-Mechanics) - 50V 1uF X5R ±10% 0603 Multilayer Ceramic Capacitors MLCC - SMD/SMT ROHS") - (footprint "Capacitor_SMD:C_0603_1608Metric") - (property (name "Sheetname") (value "en_pull")) - (property (name "Sheetfile") (value "electronics_abstract_parts.PassiveFilters.PullupDelayRc")) - (property (name "edg_path") (value "mcu.en_pull.rc.c")) - (property (name "edg_short_path") (value "mcu.en_pull.c")) - (property (name "edg_refdes") (value "C6")) - (property (name "edg_part") (value "CL10A105KB8NNNC (Samsung Electro-Mechanics)")) - (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) - (tstamps "00640064")) (comp (ref "mcu.prog") (value "PinHeader2.54 1x4 (Generic)") (footprint "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical") @@ -308,6 +286,28 @@ (property (name "edg_part") (value "5.1mm switch")) (sheetpath (names "/mcu/") (tstamps "/02850146/")) (tstamps "042b01b5")) +(comp (ref "mcu.en_pull.r") + (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 10kΩ 0603 Chip Resistor - Surface Mount ROHS") + (footprint "Resistor_SMD:R_0603_1608Metric") + (property (name "Sheetname") (value "en_pull")) + (property (name "Sheetfile") (value "electronics_abstract_parts.PassiveFilters.PullupDelayRc")) + (property (name "edg_path") (value "mcu.en_pull.rc.r")) + (property (name "edg_short_path") (value "mcu.en_pull.r")) + (property (name "edg_refdes") (value "R8")) + (property (name "edg_part") (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec))")) + (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) + (tstamps "00730073")) +(comp (ref "mcu.en_pull.c") + (value "CL10A105KB8NNNC (Samsung Electro-Mechanics) - 50V 1uF X5R ±10% 0603 Multilayer Ceramic Capacitors MLCC - SMD/SMT ROHS") + (footprint "Capacitor_SMD:C_0603_1608Metric") + (property (name "Sheetname") (value "en_pull")) + (property (name "Sheetfile") (value "electronics_abstract_parts.PassiveFilters.PullupDelayRc")) + (property (name "edg_path") (value "mcu.en_pull.rc.c")) + (property (name "edg_short_path") (value "mcu.en_pull.c")) + (property (name "edg_refdes") (value "C6")) + (property (name "edg_part") (value "CL10A105KB8NNNC (Samsung Electro-Mechanics)")) + (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) + (tstamps "00640064")) (comp (ref "tof.elt[0]") (value "B6B-PH-K (JST)") (footprint "Connector_JST:JST_PH_B6B-PH-K_1x06_P2.00mm_Vertical") diff --git a/examples/SevenSegment/SevenSegment.net b/examples/SevenSegment/SevenSegment.net index dca1c5664..e02372955 100644 --- a/examples/SevenSegment/SevenSegment.net +++ b/examples/SevenSegment/SevenSegment.net @@ -154,6 +154,17 @@ (property (name "edg_part") (value "CC0603KRX7R9BB104 (YAGEO)")) (sheetpath (names "/mcu/") (tstamps "/02850146/")) (tstamps "0e5a0301")) +(comp (ref "mcu.prog") + (value "") + (footprint "Connector:Tag-Connect_TC2030-IDC-FP_2x03_P1.27mm_Vertical") + (property (name "Sheetname") (value "mcu")) + (property (name "Sheetfile") (value "electronics_lib.Microcontroller_Esp32s3.Esp32s3_Wroom_1")) + (property (name "edg_path") (value "mcu.prog.conn")) + (property (name "edg_short_path") (value "mcu.prog")) + (property (name "edg_refdes") (value "CJ2")) + (property (name "edg_part") (value "")) + (sheetpath (names "/mcu/") (tstamps "/02850146/")) + (tstamps "045f01b9")) (comp (ref "mcu.en_pull.r") (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 10kΩ 0603 Chip Resistor - Surface Mount ROHS") (footprint "Resistor_SMD:R_0603_1608Metric") @@ -176,17 +187,6 @@ (property (name "edg_part") (value "CL10A105KB8NNNC (Samsung Electro-Mechanics)")) (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) (tstamps "00640064")) -(comp (ref "mcu.prog") - (value "") - (footprint "Connector:Tag-Connect_TC2030-IDC-FP_2x03_P1.27mm_Vertical") - (property (name "Sheetname") (value "mcu")) - (property (name "Sheetfile") (value "electronics_lib.Microcontroller_Esp32s3.Esp32s3_Wroom_1")) - (property (name "edg_path") (value "mcu.prog.conn")) - (property (name "edg_short_path") (value "mcu.prog")) - (property (name "edg_refdes") (value "CJ2")) - (property (name "edg_part") (value "")) - (sheetpath (names "/mcu/") (tstamps "/02850146/")) - (tstamps "045f01b9")) (comp (ref "ledr.package") (value "KT-0603R (Hubei KENTO Elec) - Red 615~630nm 1.9~2.2V 0603 Light Emitting Diodes (LED) RoHS") (footprint "LED_SMD:LED_0603_1608Metric") diff --git a/examples/SwdDebugger/SwdDebugger.net b/examples/SwdDebugger/SwdDebugger.net index 745adf50d..9a702c34b 100644 --- a/examples/SwdDebugger/SwdDebugger.net +++ b/examples/SwdDebugger/SwdDebugger.net @@ -319,17 +319,6 @@ (property (name "edg_part") (value "0402WGF4701TCE (UNI-ROYAL(Uniroyal Elec))")) (sheetpath (names "/") (tstamps "/")) (tstamps "0b9c02f0")) -(comp (ref "target_drv.reset_res") - (value "0402WGF220JTCE (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/16W Thick Film Resistors 50V ±200ppm/℃ -55℃~+155℃ 22Ω 0402 Chip Resistor - Surface Mount ROHS") - (footprint "Resistor_SMD:R_0402_1005Metric") - (property (name "Sheetname") (value "target_drv")) - (property (name "Sheetfile") (value "examples.test_swd_debugger.SwdSourceBitBang")) - (property (name "edg_path") (value "target_drv.reset_res")) - (property (name "edg_short_path") (value "target_drv.reset_res")) - (property (name "edg_refdes") (value "SR7")) - (property (name "edg_part") (value "0402WGF220JTCE (UNI-ROYAL(Uniroyal Elec))")) - (sheetpath (names "/target_drv/") (tstamps "/17000433/")) - (tstamps "130903cd")) (comp (ref "target_drv.swclk_res") (value "0402WGF220JTCE (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/16W Thick Film Resistors 50V ±200ppm/℃ -55℃~+155℃ 22Ω 0402 Chip Resistor - Surface Mount ROHS") (footprint "Resistor_SMD:R_0402_1005Metric") @@ -337,7 +326,7 @@ (property (name "Sheetfile") (value "examples.test_swd_debugger.SwdSourceBitBang")) (property (name "edg_path") (value "target_drv.swclk_res")) (property (name "edg_short_path") (value "target_drv.swclk_res")) - (property (name "edg_refdes") (value "SR8")) + (property (name "edg_refdes") (value "SR7")) (property (name "edg_part") (value "0402WGF220JTCE (UNI-ROYAL(Uniroyal Elec))")) (sheetpath (names "/target_drv/") (tstamps "/17000433/")) (tstamps "132f03ce")) @@ -348,7 +337,7 @@ (property (name "Sheetfile") (value "examples.test_swd_debugger.SwdSourceBitBang")) (property (name "edg_path") (value "target_drv.swdio_res")) (property (name "edg_short_path") (value "target_drv.swdio_res")) - (property (name "edg_refdes") (value "SR9")) + (property (name "edg_refdes") (value "SR8")) (property (name "edg_part") (value "0402WGF220JTCE (UNI-ROYAL(Uniroyal Elec))")) (sheetpath (names "/target_drv/") (tstamps "/17000433/")) (tstamps "133803d0")) @@ -359,10 +348,21 @@ (property (name "Sheetfile") (value "examples.test_swd_debugger.SwdSourceBitBang")) (property (name "edg_path") (value "target_drv.swdio_drv_res")) (property (name "edg_short_path") (value "target_drv.swdio_drv_res")) - (property (name "edg_refdes") (value "SR10")) + (property (name "edg_refdes") (value "SR9")) (property (name "edg_part") (value "0402WGF1000TCE (UNI-ROYAL(Uniroyal Elec))")) (sheetpath (names "/target_drv/") (tstamps "/17000433/")) (tstamps "2682057b")) +(comp (ref "target_drv.reset_res") + (value "0402WGF220JTCE (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/16W Thick Film Resistors 50V ±200ppm/℃ -55℃~+155℃ 22Ω 0402 Chip Resistor - Surface Mount ROHS") + (footprint "Resistor_SMD:R_0402_1005Metric") + (property (name "Sheetname") (value "target_drv")) + (property (name "Sheetfile") (value "examples.test_swd_debugger.SwdSourceBitBang")) + (property (name "edg_path") (value "target_drv.reset_res")) + (property (name "edg_short_path") (value "target_drv.reset_res")) + (property (name "edg_refdes") (value "SR10")) + (property (name "edg_part") (value "0402WGF220JTCE (UNI-ROYAL(Uniroyal Elec))")) + (sheetpath (names "/target_drv/") (tstamps "/17000433/")) + (tstamps "130903cd")) (comp (ref "target_drv.swo_res") (value "0402WGF220JTCE (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/16W Thick Film Resistors 50V ±200ppm/℃ -55℃~+155℃ 22Ω 0402 Chip Resistor - Surface Mount ROHS") (footprint "Resistor_SMD:R_0402_1005Metric") @@ -571,12 +571,12 @@ (net (code 16) (name "target_drv.swd.swclk") (node (ref target_drv.swclk_res) (pin 2)) (node (ref target) (pin 4))) -(net (code 17) (name "target_drv.swd.reset") - (node (ref target_drv.reset_res) (pin 2)) - (node (ref target) (pin 10))) -(net (code 18) (name "target_drv.swo_in") +(net (code 17) (name "target_drv.swo_in") (node (ref target_drv.swo_res) (pin 2)) (node (ref target) (pin 6))) +(net (code 18) (name "target_drv.reset_out") + (node (ref target_drv.reset_res) (pin 2)) + (node (ref target) (pin 10))) (net (code 19) (name "target_sense.output") (node (ref mcu.ic) (pin 10)) (node (ref target_sense.top_res) (pin 2)) @@ -599,7 +599,7 @@ (net (code 25) (name "mcu.swd_node.swclk") (node (ref mcu.ic) (pin 37)) (node (ref mcu.swd) (pin 4))) -(net (code 26) (name "mcu.swd_node.reset") +(net (code 26) (name "mcu.reset_node") (node (ref mcu.ic) (pin 7)) (node (ref mcu.swd) (pin 10))) (net (code 27) (name "mcu.swd.swo") diff --git a/examples/SwitchController/SwitchController.net b/examples/SwitchController/SwitchController.net index a801d1a8c..8b4b7ad2b 100644 --- a/examples/SwitchController/SwitchController.net +++ b/examples/SwitchController/SwitchController.net @@ -176,28 +176,6 @@ (property (name "edg_part") (value "CC0603KRX7R9BB104 (YAGEO)")) (sheetpath (names "/mcu/") (tstamps "/02850146/")) (tstamps "0e5a0301")) -(comp (ref "mcu.en_pull.r") - (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 10kΩ 0603 Chip Resistor - Surface Mount ROHS") - (footprint "Resistor_SMD:R_0603_1608Metric") - (property (name "Sheetname") (value "en_pull")) - (property (name "Sheetfile") (value "electronics_abstract_parts.PassiveFilters.PullupDelayRc")) - (property (name "edg_path") (value "mcu.en_pull.rc.r")) - (property (name "edg_short_path") (value "mcu.en_pull.r")) - (property (name "edg_refdes") (value "R3")) - (property (name "edg_part") (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec))")) - (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) - (tstamps "00730073")) -(comp (ref "mcu.en_pull.c") - (value "CL10A105KB8NNNC (Samsung Electro-Mechanics) - 50V 1uF X5R ±10% 0603 Multilayer Ceramic Capacitors MLCC - SMD/SMT ROHS") - (footprint "Capacitor_SMD:C_0603_1608Metric") - (property (name "Sheetname") (value "en_pull")) - (property (name "Sheetfile") (value "electronics_abstract_parts.PassiveFilters.PullupDelayRc")) - (property (name "edg_path") (value "mcu.en_pull.rc.c")) - (property (name "edg_short_path") (value "mcu.en_pull.c")) - (property (name "edg_refdes") (value "C5")) - (property (name "edg_part") (value "CL10A105KB8NNNC (Samsung Electro-Mechanics)")) - (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) - (tstamps "00640064")) (comp (ref "mcu.prog") (value "PinHeader2.54 1x4 (Generic)") (footprint "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical") @@ -220,6 +198,28 @@ (property (name "edg_part") (value "5.1mm switch")) (sheetpath (names "/mcu/") (tstamps "/02850146/")) (tstamps "042b01b5")) +(comp (ref "mcu.en_pull.r") + (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec)) - ±1% 1/10W Thick Film Resistors 75V ±100ppm/℃ -55℃~+155℃ 10kΩ 0603 Chip Resistor - Surface Mount ROHS") + (footprint "Resistor_SMD:R_0603_1608Metric") + (property (name "Sheetname") (value "en_pull")) + (property (name "Sheetfile") (value "electronics_abstract_parts.PassiveFilters.PullupDelayRc")) + (property (name "edg_path") (value "mcu.en_pull.rc.r")) + (property (name "edg_short_path") (value "mcu.en_pull.r")) + (property (name "edg_refdes") (value "R3")) + (property (name "edg_part") (value "0603WAF1002T5E (UNI-ROYAL(Uniroyal Elec))")) + (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) + (tstamps "00730073")) +(comp (ref "mcu.en_pull.c") + (value "CL10A105KB8NNNC (Samsung Electro-Mechanics) - 50V 1uF X5R ±10% 0603 Multilayer Ceramic Capacitors MLCC - SMD/SMT ROHS") + (footprint "Capacitor_SMD:C_0603_1608Metric") + (property (name "Sheetname") (value "en_pull")) + (property (name "Sheetfile") (value "electronics_abstract_parts.PassiveFilters.PullupDelayRc")) + (property (name "edg_path") (value "mcu.en_pull.rc.c")) + (property (name "edg_short_path") (value "mcu.en_pull.c")) + (property (name "edg_refdes") (value "C5")) + (property (name "edg_part") (value "CL10A105KB8NNNC (Samsung Electro-Mechanics)")) + (sheetpath (names "/mcu/en_pull/") (tstamps "/02850146/0b9c02f0/")) + (tstamps "00640064")) (comp (ref "sw1") (value "5.1mm switch") (footprint "Button_Switch_SMD:SW_SPST_SKQG_WithoutStem") diff --git a/examples/TofArray/TofArray.net b/examples/TofArray/TofArray.net index beeb8b035..ab47a9390 100644 --- a/examples/TofArray/TofArray.net +++ b/examples/TofArray/TofArray.net @@ -1124,7 +1124,7 @@ (net (code 44) (name "mcu.swd_node.swclk") (node (ref mcu.ic) (pin 37)) (node (ref mcu.swd) (pin 9))) -(net (code 45) (name "mcu.swd_node.reset") +(net (code 45) (name "mcu.reset_node") (node (ref mcu.ic) (pin 7)) (node (ref mcu.swd) (pin 6))) (net (code 46) (name "mcu.swd.swo") diff --git a/examples/UsbSourceMeasure/UsbSourceMeasure.net b/examples/UsbSourceMeasure/UsbSourceMeasure.net index c301c4ea7..b9978b3f4 100644 --- a/examples/UsbSourceMeasure/UsbSourceMeasure.net +++ b/examples/UsbSourceMeasure/UsbSourceMeasure.net @@ -1891,7 +1891,7 @@ (node (ref mcu.ic) (pin 29)) (node (ref mcu.swd) (pin 9)) (node (ref mcu.swd_pull.swclk) (pin 2))) -(net (code 79) (name "mcu.swd_node.reset") +(net (code 79) (name "mcu.reset_node") (node (ref mcu.ic) (pin 34)) (node (ref mcu.swd) (pin 6))) (net (code 80) (name "mcu.swd.swo") diff --git a/examples/test_multimeter.py b/examples/test_multimeter.py index 89fa276c1..98eb63a44 100644 --- a/examples/test_multimeter.py +++ b/examples/test_multimeter.py @@ -488,7 +488,7 @@ def refinements(self) -> Refinements: (AnalogSwitchTree, ['switch_size'], 2), ], class_refinements=[ - (SwdCortexTargetWithSwoTdiConnector, SwdCortexTargetTc2050), + (SwdCortexTargetConnector, SwdCortexTargetTc2050), (TagConnect, TagConnectNonLegged), (Opamp, Tlv9061), # higher precision opamps (BananaSafetyJack, Fcr7350), diff --git a/examples/test_swd_debugger.py b/examples/test_swd_debugger.py index cf90ffe13..4944f1c26 100644 --- a/examples/test_swd_debugger.py +++ b/examples/test_swd_debugger.py @@ -10,6 +10,7 @@ def __init__(self) -> None: self.pwr = self.Port(VoltageSink.empty(), [Power]) self.gnd = self.Port(Ground.empty(), [Common]) # TODO pin at 0v self.swd = self.Port(SwdTargetPort.empty(), [Input]) + self.reset = self.Port(DigitalSink.empty(), optional=True) self.swo = self.Port(DigitalBidir.empty(), optional=True) self.tdi = self.Port(DigitalBidir.empty(), optional=True) @@ -25,7 +26,7 @@ def contents(self): self.connect(self.swd.swclk, self.conn.pins.request('4').adapt_to(DigitalSink())) self.connect(self.swo, self.conn.pins.request('6').adapt_to(DigitalBidir())) self.connect(self.tdi, self.conn.pins.request('8').adapt_to(DigitalBidir())) - self.connect(self.swd.reset, self.conn.pins.request('10').adapt_to(DigitalSink())) + self.connect(self.reset, self.conn.pins.request('10').adapt_to(DigitalSink())) class SwdCortexSourceTagConnect(ProgrammingConnector, FootprintBlock): @@ -35,6 +36,7 @@ def __init__(self) -> None: self.pwr = self.Port(VoltageSink.empty(), [Power]) self.gnd = self.Port(Ground.empty(), [Common]) # TODO pin at 0v self.swd = self.Port(SwdTargetPort.empty(), [Input]) + self.reset = self.Port(DigitalSink.empty(), optional=True) self.swo = self.Port(DigitalBidir.empty(), optional=True) def contents(self): @@ -43,7 +45,7 @@ def contents(self): self.conn = self.Block(PinHeader254DualShroudedInline(6)) self.connect(self.pwr, self.conn.pins.request('1').adapt_to(VoltageSink())) self.connect(self.swd.swdio, self.conn.pins.request('2').adapt_to(DigitalBidir())) # also TMS - self.connect(self.swd.reset, self.conn.pins.request('3').adapt_to(DigitalSink())) + self.connect(self.reset, self.conn.pins.request('3').adapt_to(DigitalSink())) self.connect(self.swd.swclk, self.conn.pins.request('4').adapt_to(DigitalSink())) self.connect(self.gnd, self.conn.pins.request('5').adapt_to(Ground())) self.connect(self.swo, self.conn.pins.request('6').adapt_to(DigitalBidir())) @@ -56,6 +58,7 @@ def __init__(self) -> None: self.swclk_in = self.Port(DigitalSink.empty()) self.swdio_in = self.Port(DigitalSink.empty()) # driving side self.swdio_out = self.Port(DigitalSource.empty()) # target side + self.reset_out = self.Port(DigitalSource.empty()) self.swo_out = self.Port(DigitalSource.empty()) self.swd = self.Port(SwdHostPort.empty(), [Output]) @@ -64,15 +67,13 @@ def __init__(self) -> None: def contents(self) -> None: super().contents() - self.reset_res = self.Block(Resistor(resistance=22*Ohm(tol=0.05))) self.swclk_res = self.Block(Resistor(resistance=22*Ohm(tol=0.05))) self.swdio_res = self.Block(Resistor(resistance=22*Ohm(tol=0.05))) self.swdio_drv_res = self.Block(Resistor(resistance=100*Ohm(tol=0.05))) + self.reset_res = self.Block(Resistor(resistance=22*Ohm(tol=0.05))) self.swo_res = self.Block(Resistor(resistance=22*Ohm(tol=0.05))) - self.connect(self.reset_res.a.adapt_to(DigitalSink()), self.reset_in) - self.connect(self.reset_res.b.adapt_to(DigitalSource()), self.swd.reset) self.connect(self.swclk_res.a.adapt_to(DigitalSink()), self.swclk_in) self.connect(self.swclk_res.b.adapt_to(DigitalSource()), self.swd.swclk) self.connect(self.swdio_drv_res.a.adapt_to(DigitalSink()), self.swdio_in) @@ -80,6 +81,9 @@ def contents(self) -> None: self.swdio_drv_res.b.adapt_to(DigitalBidir()), self.swdio_out) self.connect(self.swdio_res.b.adapt_to(DigitalSink()), self.swd.swdio) + + self.connect(self.reset_res.a.adapt_to(DigitalSink()), self.reset_in) + self.connect(self.reset_res.b.adapt_to(DigitalSource()), self.reset_out) self.connect(self.swo_res.a.adapt_to(DigitalSource()), self.swo_out) self.connect(self.swo_res.b.adapt_to(DigitalSink()), self.swo_in) @@ -103,7 +107,6 @@ def contents(self) -> None: self.v3v3 = self.connect(self.usb_reg.pwr_out) self.target_reg = imp.Block(VoltageRegulator(3.3*Volt(tol=0.05))) - target_reg_en = self.target_reg.with_mixin(VoltageRegulatorEnable()) self.vtarget = self.connect(self.target_reg.pwr_out) with self.implicit_connect( @@ -121,8 +124,8 @@ def contents(self) -> None: imp.Block(IndicatorLed(Led.White))) (self.en_pull, ), _ = self.chain(self.mcu.gpio.request('target_reg_en'), - imp.Block(PullupResistor(4.7*kOhm(tol=0.1))), - target_reg_en.enable) + imp.Block(PullupResistor(4.7*kOhm(tol=0.1))), + self.target_reg.with_mixin(Resettable()).reset) self.target_drv = imp.Block(SwdSourceBitBang()) self.connect(self.mcu.gpio.request('target_swclk'), self.target_drv.swclk_in) # TODO BMP uses pin 15 @@ -141,6 +144,7 @@ def contents(self) -> None: self.target = imp.Block(SwdCortexSourceHeader()) self.connect(self.target_drv.swd, self.target.swd) self.connect(self.target_drv.swo_in, self.target.swo) + self.connect(self.target_drv.reset_out, self.target.reset) self.led_target = imp.Block(VoltageIndicatorLed(Led.Green)) (self.target_sense, ), _ = self.chain( diff --git a/examples/test_tofarray.py b/examples/test_tofarray.py index 79bedd14f..98c5074eb 100644 --- a/examples/test_tofarray.py +++ b/examples/test_tofarray.py @@ -159,7 +159,7 @@ def refinements(self) -> Refinements: (['mcu', 'swd_swo_pin'], 'PB3'), ], class_refinements=[ - (SwdCortexTargetWithSwoTdiConnector, SwdCortexTargetTc2050), + (SwdCortexTargetConnector, SwdCortexTargetTc2050), (Speaker, ConnectorSpeaker), ], ) diff --git a/examples/test_usb_source_measure.py b/examples/test_usb_source_measure.py index b98523b2e..4d26a0e0f 100644 --- a/examples/test_usb_source_measure.py +++ b/examples/test_usb_source_measure.py @@ -450,7 +450,7 @@ def refinements(self) -> Refinements: (['control', 'int', 'c', 'footprint_spec'], 'Capacitor_SMD:C_0603_1608Metric'), ], class_refinements=[ - (SwdCortexTargetWithSwoTdiConnector, SwdCortexTargetTc2050), + (SwdCortexTargetConnector, SwdCortexTargetTc2050), (Opamp, Tlv9061), # higher precision opamps (SolidStateRelay, G3VM_61GR2), (BananaSafetyJack, Ct3151),