profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/jeremywrnr/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
jeremywrnr @berkeleyhci Oakland, CA https://jeremywrnr.com attentive illumination

jeremywrnr/git-reclone 11

reclone local git repo from remote

jeremywrnr/booker 10

:bookmark: cli chrome bookmark parser

jeremywrnr/codepilot 9

:arrows_counterclockwise: synchronous git collaboration tool

jeremywrnr/deepmap 7

:milky_way: deep ruby hash/array map

jeremywrnr/tv.rb 4

:tv: dynamic fuzzy tv terminal art :gem:

jeremywrnr/scholar-rename 2

pdf renaming tool

j-curtis/nist-app 1

Repository for development of NIST app (see contest for more details).

jeremywrnr/hci-prelims 1

hci prelim prep

jeremywrnr/mrcoffi 1

:coffee: Mr. Coffee meets IoT

push eventBerkeleyHCI/PolymorphicBlocks

josephinekoe

commit sha 44cd810c1edab682b6d69fee0180a7436c57a5d2

Battery protection IC and low-input-voltage boost converter (#37)

view details

push time in 4 hours

push eventBerkeleyHCI/PolymorphicBlocks

josephinekoe

commit sha ce4d801e81bc8dbc13e60a968de99e03f15ac3b4

hopefully last round of revisions

view details

push time in 18 hours

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

 def contents(self):       },       mfr='Keystone', part='1042'     )++class AABattery(Battery, FootprintBlock):+  def __init__(self):+    # This actually initializes in the parent, TODO unhackify this by removing spec processing, see issue #28+    super().__init__(voltage=(1.3, 1.7)*Volt)++  def contents(self):+    super().contents()++    # TODO can this be assigned self.pwr == VoltageSource(...) directly?+    self.assign(self.pwr.current_limits, (0, 1)*Amp)+    self.assign(self.capacity, (2, 3)*Amp)  # TODO should be A*h++    self.footprint(+      'U', 'Battery:BatteryHolder_Keystone_2461_1x57mm',

Sadly this doesn't look like a KiCad part. But I think you can use BatteryHolder_Keystone_2460_1xAA instead - see the online KiCad footprint list.

josephinekoe

comment created time in 19 hours

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

+from electronics_abstract_parts import *+++class BatteryProtector_S8200A_Device(DiscreteChip, FootprintBlock):+  def __init__(self):+    super().__init__()++    self.vss = self.Port(Ground())+    self.vdd = self.Port(VoltageSink(+      voltage_limits=self.vss.voltage_limits + RangeExpr._to_expr_type((-0.3, 12) * Volt),+      current_draw=(0.7, 5.5) * uAmp+    ))++    self.vm = self.Port(Passive())+    self.do = self.Port(Passive())+    self.co = self.Port(Passive())+++  def contents(self):+    super().contents()+    self.footprint(+      'U', 'Package_TO_SOT_SMD:SOT-23-6',+      {+        '1': self.do,+        '2': self.vm,+        '3': self.co,+        # '4': no connection pin,+        '5': self.vdd,+        '6': self.vss,+      },+      mfr='ABLIC', part='S-8200ABE-M6T1U',+      datasheet='https://www.mouser.com/datasheet/2/360/S8200A_E-1365901.pdf'+    )++class BatteryProtector_S8200A(Block):+  @init_in_parent+  def __init__(self) -> None:+    super().__init__()++    self.ic = self.Block(BatteryProtector_S8200A_Device())++    self.pwr_out = self.Port(VoltageSource())+    self.gnd_out = self.Port(GroundSource())+    self.pwr_in = self.Port(VoltageSink(+      voltage_limits=self.ic.vdd.voltage_limits,

This actually is discarded, because the pin is connected (so it derives its properties from the inner connections.

If the system was a bit smarter about defaults processing, it would warn you if a non-default was specified.

josephinekoe

comment created time in 19 hours

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

 class Tps54202h(DiscreteBuckConverter, GeneratorBlock):   def contents(self):     super().contents() +    self.require(self.pwr_out.voltage_out.lower() <= self.pwr_in.voltage_limits.lower())

similarly, use upper

josephinekoe

comment created time in 19 hours

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

+import unittest++from edg import *+from electronics_lib.Batteries import AABattery+from electronics_lib.DcDcConverters import Tps61023+++class AABatteryCircuit(SimpleBoardTop):+  def contents(self) -> None:+    super().contents()+    self.mcu = self.Block(Stm32f103_48())+    self.li_ion_bat = self.Block(AABattery())

It's not lithium here, perhaps just bat?

josephinekoe

comment created time in 19 hours

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

 def contents(self):       },       mfr='Keystone', part='1042'     )++class AABattery(Battery, FootprintBlock):+  def __init__(self):+    # This actually initializes in the parent, TODO unhackify this by removing spec processing, see issue #28+    super().__init__(voltage=(1.3, 1.7)*Volt)++  def contents(self):+    super().contents()++    # TODO can this be assigned self.pwr == VoltageSource(...) directly?+    self.assign(self.pwr.current_limits, (0, 1)*Amp)+    self.assign(self.capacity, (2, 3)*Amp)  # TODO should be A*h++    self.footprint(+      'U', 'Battery:BatteryHolder_Keystone_2461_1x57mm',+      {+        '1': self.pwr,+        '2': self.gnd,+      },+      mfr='Keystone', part='2461'+    )

Newline

josephinekoe

comment created time in 19 hours

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

 def contents(self):     super().contents()      self.require(self.pwr_out.voltage_out.within((1, 24)*Volt))+    self.require(self.pwr_out.voltage_out.lower() <= self.pwr_in.voltage_limits.lower())

similarly, use upper

josephinekoe

comment created time in 19 hours

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

 def contents(self):     super().contents()      self.require(self.pwr_out.voltage_out.within((0.76, 17)*Volt))+    self.require(self.pwr_out.voltage_out.lower() <= self.pwr_in.voltage_limits.lower())

I think here it's output voltage upper <= input voltage upper

josephinekoe

comment created time in 19 hours

push eventBerkeleyHCI/PolymorphicBlocks

josephinekoe

commit sha 93323c94a5bda0a7cace640b8d1f51bcd4f06308

fixed a name

view details

push time in a day

push eventBerkeleyHCI/PolymorphicBlocks

josephinekoe

commit sha 60784a82c187e0a20b98ea11434eca17951929f6

made separate circuits and AA battery

view details

push time in a day

push eventBerkeleyHCI/PolymorphicBlocks

josephinekoe

commit sha 32f4268c7beaceaec8b2462fce76ee94bc8ef665

renamed battery protector circuit

view details

push time in a day

push eventBerkeleyHCI/PolymorphicBlocks

josephinekoe

commit sha cc0236427e0dc5a4ab8c251d384677985fecba8a

fixed one name

view details

push time in a day

push eventBerkeleyHCI/PolymorphicBlocks

josephinekoe

commit sha 9badb395cbd78eb5fc67ea7eaaaa9c7cff0545c4

fixed second round of comments

view details

push time in a day

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

 from electronics_abstract_parts import * +class Tps61023_Device(DiscreteChip, FootprintBlock):+  @init_in_parent+  def __init__(self, current_draw: RangeLike = RangeExpr()):+    super().__init__()+    self.vin = self.Port(VoltageSink(+      voltage_limits=(0.5, 5.5)*Volt,+      current_draw=current_draw+    ))+    self.gnd = self.Port(Ground())+    self.sw = self.Port(VoltageSource())+    self.fb = self.Port(AnalogSink(impedance=(8000, float('inf')) * kOhm))+    self.vout = self.Port(Passive()) # TODO model as voltage source++  def contents(self) -> None:+    super().contents()+    self.footprint(+      'U', 'Package_TO_SOT_SMD:SOT-23-6',+      {+        '1': self.fb,+        '2': self.vin, # en+        '3': self.vin,+        '4': self.gnd,+        '5': self.sw,+        '6': self.vout,+      },+      mfr='Texas Instruments', part='TPS61023',+      datasheet='https://www.ti.com/lit/ds/symlink/tps61023.pdf'+    )++class Tps61023(DiscreteBoostConverter, GeneratorBlock):++  def contents(self):+    super().contents()+    self.assign(self.frequency, (0.5, 1)*MHertz)+    self.assign(self.efficiency, (0.7, 0.97))+

Can you also add a require on the output voltage here? It's 2.2-5.5v per the datasheet.

josephinekoe

comment created time in a day

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

 from electronics_abstract_parts import * +class Tps61023_Device(DiscreteChip, FootprintBlock):+  @init_in_parent+  def __init__(self, current_draw: RangeLike = RangeExpr()):+    super().__init__()+    self.vin = self.Port(VoltageSink(+      voltage_limits=(0.5, 5.5)*Volt,+      current_draw=current_draw+    ))+    self.gnd = self.Port(Ground())+    self.sw = self.Port(VoltageSource())+    self.fb = self.Port(AnalogSink(impedance=(8000, float('inf')) * kOhm))+    self.vout = self.Port(Passive()) # TODO model as voltage source++  def contents(self) -> None:+    super().contents()+    self.footprint(+      'U', 'Package_TO_SOT_SMD:SOT-23-6',+      {+        '1': self.fb,+        '2': self.vin, # en+        '3': self.vin,+        '4': self.gnd,+        '5': self.sw,+        '6': self.vout,+      },+      mfr='Texas Instruments', part='TPS61023',+      datasheet='https://www.ti.com/lit/ds/symlink/tps61023.pdf'+    )++class Tps61023(DiscreteBoostConverter, GeneratorBlock):++  def contents(self):+    super().contents()+    self.assign(self.frequency, (0.5, 1)*MHertz)+    self.assign(self.efficiency, (0.7, 0.97))++    self.fb = self.Block(FeedbackVoltageDivider(+      output_voltage=(580, 610) * mVolt,+      impedance=(1, 300) * kOhm,+      assumed_input_voltage=self.spec_output_voltage+    ))+    self.assign(self.pwr_out.voltage_out,+                (580*mVolt / self.fb.ratio.upper(),+                 610*mVolt / self.fb.ratio.lower()))++    self.generator(self.generate_converter,+                   self.pwr_in.link().voltage, self.spec_output_voltage,+                   self.pwr_out.link().current_drawn,+                   self.frequency, self.output_ripple_limit, self.input_ripple_limit, self.ripple_current_factor,+                   targets=[self.fb, self.pwr_in, self.pwr_out, self.gnd])+++  def generate_converter(self, input_voltage: RangeVal, output_voltage: RangeVal,+                         output_current: RangeVal, frequency: RangeVal,+                         spec_output_ripple: float, spec_input_ripple: float, ripple_factor: RangeVal) -> None:+    self.ic = self.Block(Tps61023_Device(+      current_draw=(self.pwr_out.link().current_drawn.lower() * self.pwr_out.voltage_out.lower() / self.pwr_in.link().voltage.upper() / self.efficiency.upper(),+                    self.pwr_out.link().current_drawn.upper() * self.pwr_out.voltage_out.upper() / self.pwr_in.link().voltage.lower() / self.efficiency.lower())+    ))+    self.connect(self.pwr_in, self.ic.vin)+    self.connect(self.gnd, self.ic.gnd)++    self.connect(self.fb.input, self.pwr_out)+    self.connect(self.fb.gnd, self.gnd)+    self.connect(self.fb.output, self.ic.fb)++    self._generate_converter(self.ic.sw, 0.5,+                             input_voltage=input_voltage, output_voltage=output_voltage,+                             output_current_max=output_current[1], frequency=frequency,+                             spec_output_ripple=spec_output_ripple, spec_input_ripple=spec_input_ripple,+                             ripple_factor=ripple_factor)++    self.connect(self.pwr_out, self.ic.vout.as_voltage_source(+      voltage_out=self.pwr_out.voltage_out,  # TODO cyclic dependency?+      current_limits=(0, 1.2)*Amp

This chip seems to have a higher current limit - "valley switch current limit" of 3.7A. You might also want to update the rated_current_limit in _generate_converter.

I'm not sure what valley switching current is, but if you have the interest see if you can understand how that translates into the EDG model, and if not, leave it as a TODO.

josephinekoe

comment created time in a day

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

+from electronics_abstract_parts import *+++class BatteryProtector_S8200A_Device(DiscreteChip, FootprintBlock):+  def __init__(self):+    super().__init__()++    self.vss = self.Port(Ground())+    self.vdd = self.Port(VoltageSink(+      voltage_limits=self.vss.voltage_limits + RangeExpr._to_expr_type((-0.3, 12) * Volt),+      current_draw=(0.7, 5.5) * uAmp+    ))++    self.nc = self.Port(Passive(), optional=True) # no connection+    self.vm = self.Port(Passive())+    self.do = self.Port(Passive())+    self.co = self.Port(Passive())+++  def contents(self):+    super().contents()+    self.footprint(+      'U', 'Package_TO_SOT_SMD:SOT-23-6',+      {+        '1': self.do,+        '2': self.vm,+        '3': self.co,+        '4': self.nc,+        '5': self.vdd,+        '6': self.vss,+      },+      mfr='ABLIC', part='S-8200ABE-M6T1U',+      datasheet='https://www.mouser.com/datasheet/2/360/S8200A_E-1365901.pdf'+    )++class BatteryProtector_S8200A(FootprintBlock):+  @init_in_parent+  def __init__(self) -> None:+    super().__init__()++    self.battery_protector = self.Block(BatteryProtector_S8200A_Device())++    self.pwr_out = self.Port(VoltageSource())+    self.gnd_out = self.Port(GroundSource())+    self.pwr_in = self.Port(VoltageSink(+      voltage_limits=self.battery_protector.vdd.voltage_limits,+    ))+    self.gnd_in = self.Export(self.battery_protector.vss)++    self.do_fet = self.Block(NFet(+      drain_current=self.pwr_in.link().current_drawn,+      power=RangeExpr.ZERO,+      gate_voltage=self.pwr_in.link().voltage.upper(),

Does this actually run? Or type-check? I thought it would need a range here?

josephinekoe

comment created time in a day

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

+from edg import *+from electronics_lib.BatteryProtector_S8200A import BatteryProtector_S8200A+from electronics_lib.DcDcConverters import Tps61023+++class BLECircuit(SimpleBoardTop):+  def contents(self) -> None:+    super().contents()+    self.battery_voltage = (1, 1.5) * Volt+    self.mcu = self.Block(Stm32f103_48())+    self.battery_protector = self.Block(BatteryProtector_S8200A())+    self.li_ion_bat = self.Block(Li18650(voltage=self.battery_voltage))+    self.led = self.Block(VoltageIndicatorLed())+    self.boost = self.Block(Tps61023(output_voltage=3.3 * Volt(tol=0.07)))+    self.swd = self.Block(SwdCortexTargetHeader())++    self.link_bat_neg = self.connect(self.li_ion_bat.gnd, self.battery_protector.gnd_in)+    self.link_bat_pos = self.connect(self.li_ion_bat.pwr, self.battery_protector.pwr_in)++    self.link_protect_neg = self.connect(self.battery_protector.gnd_out, self.boost.gnd)+    self.link_protect_pos = self.connect(self.battery_protector.pwr_out, self.boost.pwr_in)++    self.link_boost_neg = self.connect(self.boost.gnd, self.mcu.gnd)+    self.link_boost_pos = self.connect(self.boost.pwr_out, self.mcu.pwr)++    self.connect(self.mcu.gnd, self.led.gnd)+    self.connect(self.led.signal, self.mcu.pwr)++    self.connect(self.swd.swd, self.mcu.swd)+    self.connect(self.mcu.gnd, self.swd.gnd)+    self.connect(self.mcu.pwr, self.swd.pwr)+++if __name__ == "__main__":+  compile_board_inplace(BLECircuit)

Can you also add the unit test boilerplate like the other examples, so this can run as part of the unit test suite?

josephinekoe

comment created time in a day

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

 def __init__(self, voltage: RangeLike = RangeExpr(),     self.gnd = self.Port(GroundSource())      self.capacity = self.Parameter(RangeExpr())+    self.voltage = self.Parameter(RangeExpr(voltage))      self.require(self.pwr.voltage_out.within(voltage))     self.require(self.pwr.current_limits.contains(current))     self.require(self.capacity.lower() >= capacity)++    self.assign(self.pwr.voltage_out, self.voltage)

newline at end of file

josephinekoe

comment created time in a day

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

 from electronics_abstract_parts import * +class Tps61023_Device(DiscreteChip, FootprintBlock):+  @init_in_parent+  def __init__(self, current_draw: RangeLike = RangeExpr()):+    super().__init__()+    self.vin = self.Port(VoltageSink(+      voltage_limits=(0.5, 5.5)*Volt,+      current_draw=current_draw+    ))+    self.gnd = self.Port(Ground())+    self.sw = self.Port(VoltageSource())+    self.fb = self.Port(AnalogSink(impedance=(8000, float('inf')) * kOhm))+    self.vout = self.Port(Passive()) # TODO model as voltage source++  def contents(self) -> None:+    super().contents()+    self.footprint(+      'U', 'Package_TO_SOT_SMD:SOT-23-6',+      {+        '1': self.fb,+        '2': self.vin, # en+        '3': self.vin,+        '4': self.gnd,+        '5': self.sw,+        '6': self.vout,+      },+      mfr='Texas Instruments', part='TPS61023',+      datasheet='https://www.ti.com/lit/ds/symlink/tps61023.pdf'+    )++class Tps61023(DiscreteBoostConverter, GeneratorBlock):++  def contents(self):+    super().contents()+    self.assign(self.frequency, (0.5, 1)*MHertz)+    self.assign(self.efficiency, (0.7, 0.97))++    self.fb = self.Block(FeedbackVoltageDivider(+      output_voltage=(580, 610) * mVolt,+      impedance=(1, 300) * kOhm,+      assumed_input_voltage=self.spec_output_voltage+    ))+    self.assign(self.pwr_out.voltage_out,+                (580*mVolt / self.fb.ratio.upper(),+                 610*mVolt / self.fb.ratio.lower()))++    self.generator(self.generate_converter,+                   self.pwr_in.link().voltage, self.spec_output_voltage,+                   self.pwr_out.link().current_drawn,+                   self.frequency, self.output_ripple_limit, self.input_ripple_limit, self.ripple_current_factor,+                   targets=[self.fb, self.pwr_in, self.pwr_out, self.gnd])+++  def generate_converter(self, input_voltage: RangeVal, output_voltage: RangeVal,+                         output_current: RangeVal, frequency: RangeVal,+                         spec_output_ripple: float, spec_input_ripple: float, ripple_factor: RangeVal) -> None:+    self.ic = self.Block(Tps61023_Device(+      current_draw=(self.pwr_out.link().current_drawn.lower() * self.pwr_out.voltage_out.lower() / self.pwr_in.link().voltage.upper() / self.efficiency.upper(),+                    self.pwr_out.link().current_drawn.upper() * self.pwr_out.voltage_out.upper() / self.pwr_in.link().voltage.lower() / self.efficiency.lower())+    ))+    self.connect(self.pwr_in, self.ic.vin)+    self.connect(self.gnd, self.ic.gnd)++    self.connect(self.fb.input, self.pwr_out)+    self.connect(self.fb.gnd, self.gnd)+    self.connect(self.fb.output, self.ic.fb)++    self._generate_converter(self.ic.sw, 0.5,+                             input_voltage=input_voltage, output_voltage=output_voltage,+                             output_current_max=output_current[1], frequency=frequency,+                             spec_output_ripple=spec_output_ripple, spec_input_ripple=spec_input_ripple,+                             ripple_factor=ripple_factor)++    self.connect(self.pwr_out, self.ic.vout.as_voltage_source(+      voltage_out=self.pwr_out.voltage_out,  # TODO cyclic dependency?+      current_limits=(0, 1.2)*Amp+    ))

Perhaps also a constraint on the effective inductance and capacitance range? (this can be a todo - we don't have great support for this right now, but my understanding is that modern converters run with relatively high current ripple, and get away with smaller inductors)

josephinekoe

comment created time in a day

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

 from electronics_abstract_parts import * +class Tps61023_Device(DiscreteChip, FootprintBlock):+  @init_in_parent+  def __init__(self, current_draw: RangeLike = RangeExpr()):+    super().__init__()+    self.vin = self.Port(VoltageSink(+      voltage_limits=(0.5, 5.5)*Volt,+      current_draw=current_draw+    ))+    self.gnd = self.Port(Ground())+    self.sw = self.Port(VoltageSource())+    self.fb = self.Port(AnalogSink(impedance=(8000, float('inf')) * kOhm))+    self.vout = self.Port(Passive()) # TODO model as voltage source++  def contents(self) -> None:+    super().contents()+    self.footprint(+      'U', 'Package_TO_SOT_SMD:SOT-23-6',+      {+        '1': self.fb,+        '2': self.vin, # en+        '3': self.vin,+        '4': self.gnd,+        '5': self.sw,+        '6': self.vout,+      },+      mfr='Texas Instruments', part='TPS61023',+      datasheet='https://www.ti.com/lit/ds/symlink/tps61023.pdf'+    )++class Tps61023(DiscreteBoostConverter, GeneratorBlock):++  def contents(self):+    super().contents()+    self.assign(self.frequency, (0.5, 1)*MHertz)+    self.assign(self.efficiency, (0.7, 0.97))++    self.fb = self.Block(FeedbackVoltageDivider(+      output_voltage=(580, 610) * mVolt,+      impedance=(1, 300) * kOhm,

I recommend setting the lower bound at 10k (unless the datasheet says otherwise?) The main drawback of a lower impedance is higher power draw through the resistive divider. It will result in a 'stronger' signal, but past some point it doesn't matter and would just consume more power.

josephinekoe

comment created time in a day

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

+from electronics_abstract_parts import *+++class BatteryProtector_S8200A_Device(DiscreteChip, FootprintBlock):+  def __init__(self):+    super().__init__()++    self.vss = self.Port(Ground())+    self.vdd = self.Port(VoltageSink(+      voltage_limits=self.vss.voltage_limits + RangeExpr._to_expr_type((-0.3, 12) * Volt),+      current_draw=(0.7, 5.5) * uAmp+    ))++    self.nc = self.Port(Passive(), optional=True) # no connection+    self.vm = self.Port(Passive())+    self.do = self.Port(Passive())+    self.co = self.Port(Passive())+++  def contents(self):+    super().contents()+    self.footprint(+      'U', 'Package_TO_SOT_SMD:SOT-23-6',+      {+        '1': self.do,+        '2': self.vm,+        '3': self.co,+        '4': self.nc,+        '5': self.vdd,+        '6': self.vss,+      },+      mfr='ABLIC', part='S-8200ABE-M6T1U',+      datasheet='https://www.mouser.com/datasheet/2/360/S8200A_E-1365901.pdf'+    )++class BatteryProtector_S8200A(FootprintBlock):+  @init_in_parent+  def __init__(self) -> None:+    super().__init__()++    self.battery_protector = self.Block(BatteryProtector_S8200A_Device())

Style: we typically use self.ic for the main chip in a subcircuit. Part of the reason is that the name becomes part of the path name of the part which may be displayed during the board layout process, so a short path (within reason) is helpful.

(this is somewhat in contrast to building software, where length isn't as important, and descriptive but long names may be preferred)

josephinekoe

comment created time in a day

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

 def contents(self): 

Can you also make sure that the Cr2032 class is fixed from the Battery refactor?

josephinekoe

comment created time in a day

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

+from electronics_abstract_parts import *+++class BatteryProtector_S8200A_Device(DiscreteChip, FootprintBlock):+  def __init__(self):+    super().__init__()++    self.vss = self.Port(Ground())+    self.vdd = self.Port(VoltageSink(+      voltage_limits=self.vss.voltage_limits + RangeExpr._to_expr_type((-0.3, 12) * Volt),+      current_draw=(0.7, 5.5) * uAmp+    ))++    self.nc = self.Port(Passive(), optional=True) # no connection+    self.vm = self.Port(Passive())+    self.do = self.Port(Passive())+    self.co = self.Port(Passive())+++  def contents(self):+    super().contents()+    self.footprint(+      'U', 'Package_TO_SOT_SMD:SOT-23-6',+      {+        '1': self.do,+        '2': self.vm,+        '3': self.co,+        '4': self.nc,

You can just omit this pin. (maybe have a comment saying NC or something)

In the future, maybe we could have a dedicated NC construct and verify that everything is pinned, but that's not now...

josephinekoe

comment created time in a day

Pull request review commentBerkeleyHCI/PolymorphicBlocks

BLE Parts

+from electronics_abstract_parts import *+++class BatteryProtector_S8200A_Device(DiscreteChip, FootprintBlock):+  def __init__(self):+    super().__init__()++    self.vss = self.Port(Ground())+    self.vdd = self.Port(VoltageSink(+      voltage_limits=self.vss.voltage_limits + RangeExpr._to_expr_type((-0.3, 12) * Volt),+      current_draw=(0.7, 5.5) * uAmp+    ))++    self.nc = self.Port(Passive(), optional=True) # no connection+    self.vm = self.Port(Passive())+    self.do = self.Port(Passive())+    self.co = self.Port(Passive())+++  def contents(self):+    super().contents()+    self.footprint(+      'U', 'Package_TO_SOT_SMD:SOT-23-6',+      {+        '1': self.do,+        '2': self.vm,+        '3': self.co,+        '4': self.nc,+        '5': self.vdd,+        '6': self.vss,+      },+      mfr='ABLIC', part='S-8200ABE-M6T1U',+      datasheet='https://www.mouser.com/datasheet/2/360/S8200A_E-1365901.pdf'+    )++class BatteryProtector_S8200A(FootprintBlock):

This can just be a Block instead of a FootprintBlock?

josephinekoe

comment created time in a day

push eventBerkeleyHCI/PolymorphicBlocks

josephinekoe

commit sha 9c29387cab6f56d4e827f68a1373d8adb0ab7109

fixed FET params

view details

push time in a day

push eventBerkeleyHCI/PolymorphicBlocks

josephinekoe

commit sha 241cd9c4d640770da80308ba413d25ef82f506ed

finally no errors

view details

push time in a day

push eventBerkeleyHCI/PolymorphicBlocks

josephinekoe

commit sha 21ac4751c2c2a9debb1a9c49bcf5370f60c3a000

partially through Richard's comments

view details

josephinekoe

commit sha dc101e06cc5b2e5d63b6c9bb58fd8a87aa771898

5 errors from vm_res

view details

josephinekoe

commit sha 05f74e9caf2a9109f2c98b59b6175258c73b4cba

we are confused

view details

push time in a day

startedalvarop/dkbc

started time in 2 days