Skip to content

Commit

Permalink
IoT e-ink driver v1.1 (#358)
Browse files Browse the repository at this point in the history
IoT e-ink driver v1.1 board with library fixes:
- Revise Waveshare eink driver subcircuit to be consistent with the v2.2
schematic: raise input capacitance to 4.7uF and change resistor to 3ohm
- Fix PMOS reverse protection subcircuit
- Add implicit tags on Waveshare eink driver, PMOS reverse protection
subcircuit
- Fix W25Q power consumption, it's mA not uA

Changes to the example:
- Add high-side single-PMOS switch as a device-specific library. In the
future (dependent on #357) HighSideSwitch should automatically generate
a single-PMOS switch under the right input voltage conditions.
- Add input reverse polarity protection
- Remove 3.3v zener (too much leakage current)
- Change LED colors to not use OOS LEDs
- Add PMOS power gates to memory (SPI flash + SD card) and eink blocks
- Add SPI flash
- Change power input to horizontal connector
- Increase resistance of 3.3v converter to reduce quiescent current

Resolves #356
  • Loading branch information
ducky64 authored Jun 11, 2024
1 parent 1539d80 commit 6836756
Show file tree
Hide file tree
Showing 12 changed files with 6,925 additions and 4,470 deletions.
2 changes: 1 addition & 1 deletion edg/abstract_parts/AbstractFets.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class BaseTableFet(Fet):
VDS_RATING = PartsTableColumn(Range)
IDS_RATING = PartsTableColumn(Range)
VGS_RATING = PartsTableColumn(Range)
VGS_DRIVE = PartsTableColumn(Range)
VGS_DRIVE = PartsTableColumn(Range) # negative for PMOS
RDS_ON = PartsTableColumn(Range)
POWER_RATING = PartsTableColumn(Range)
GATE_CHARGE = PartsTableColumn(Range) # units of C
Expand Down
7 changes: 5 additions & 2 deletions edg/parts/EInk_WaveshareDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(self) -> None:
super().__init__()
self.device = self.Block(Waveshare_Epd_Device())
self.gnd = self.Export(self.device.vss, [Common])
self.pwr = self.Export(self.device.vdd)
self.pwr = self.Export(self.device.vdd, [Power])
self.reset = self.Export(self.device.rst)
self.spi = self.Export(self.device.spi)
self.cs = self.Export(self.device.csb)
Expand Down Expand Up @@ -115,10 +115,13 @@ def contents(self):

# current limit based on 200mA saturation current of reference inductor
self.boost = self.Block(EInkBoostPowerPath(20*Volt(tol=0), (0, 200)*mAmp, 68*uHenry(tol=0.2),
1*uFarad(tol=0.2), 4.7*uFarad(tol=0.2), 2.2*Ohm(tol=0.01)))
4.7*uFarad(tol=0.2), 4.7*uFarad(tol=0.2), 3*Ohm(tol=0.01)))
self.connect(self.gnd, self.boost.gnd)
self.connect(self.pwr, self.boost.pwr_in)
self.connect(self.device.gdr, self.boost.gate)
self.gate_pdr = self.Block(Resistor(10*kOhm(tol=0.05)))
self.connect(self.gate_pdr.a, self.boost.gate)
self.connect(self.gate_pdr.b.adapt_to(Ground()), self.gnd)
self.connect(self.device.rese, self.boost.isense)
self.connect(self.boost.pos_out, self.device.prevgh)
self.connect(self.boost.neg_out, self.device.prevgl)
Expand Down
9 changes: 4 additions & 5 deletions edg/parts/PowerConditioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ class PmosReverseProtection(PowerConditioner, KiCadSchematicBlock, Block):
def __init__(self, gate_resistor: RangeLike = 10 * kOhm(tol=0.05), rds_on: RangeLike = (0, 0.1) * Ohm):
super().__init__()
self.gnd = self.Port(Ground.empty(), [Common])
self.pwr_in = self.Port(VoltageSink.empty())
self.pwr_out = self.Port(VoltageSource.empty())
self.pwr_in = self.Port(VoltageSink.empty(), [Input])
self.pwr_out = self.Port(VoltageSource.empty(), [Output])

self.gate_resistor = self.ArgParameter(gate_resistor)
self.rds_on = self.ArgParameter(rds_on)
Expand All @@ -288,12 +288,11 @@ def contents(self):
self.fet = self.Block(Fet.PFet(
drain_voltage=(0, self.pwr_out.link().voltage.upper()),
drain_current=output_current_draw,
gate_voltage=(- self.pwr_out.link().voltage.upper(), self.pwr_out.link().voltage.upper()),
gate_voltage=(-self.pwr_out.link().voltage.upper(), self.pwr_out.link().voltage.upper()),
rds_on=self.rds_on,
))

self.res = self.Block(Resistor(self.gate_resistor))
# TODO: generate zener diode for high voltage applications
# TODO: generate zener diode + resistor for high voltage applications
# self.diode = self.Block(ZenerDiode(self.clamp_voltage))

self.import_kicad(
Expand Down
2 changes: 1 addition & 1 deletion edg/parts/SpiMemory_W25q.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, size: RangeLike):
super().__init__()
self.vcc = self.Port(VoltageSink(
voltage_limits=(2.7, 3.6)*Volt, # relaxed range that goes up to 104MHz
current_draw=(0.001, 25)*uAmp # typ. power down to max write / erase
current_draw=(0.001, 25)*mAmp # typ. power down to max write / erase
), [Power])
self.gnd = self.Port(Ground(), [Common])

Expand Down
189 changes: 2 additions & 187 deletions edg/parts/resources/PmosReverseProtection.kicad_sch
Original file line number Diff line number Diff line change
Expand Up @@ -150,126 +150,17 @@
)
)
)
(symbol "Device:R" (pin_names (offset 0)) (in_bom yes) (on_board yes)
(property "Reference" "R" (at 2.032 0 90)
(effects (font (size 1.27 1.27)))
)
(property "Value" "R" (at 0 0 90)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (at -1.778 0 90)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_keywords" "R res resistor" (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_description" "Resistor" (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_fp_filters" "R_*" (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "R_0_1"
(rectangle (start -1.016 -2.54) (end 1.016 2.54)
(stroke (width 0.254) (type default))
(fill (type none))
)
)
(symbol "R_1_1"
(pin passive line (at 0 3.81 270) (length 1.27)
(name "~" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin passive line (at 0 -3.81 90) (length 1.27)
(name "~" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
)
)
(symbol "power:GND" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes)
(property "Reference" "#PWR" (at 0 -6.35 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "GND" (at 0 -3.81 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_keywords" "power-flag" (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_description" "Power symbol creates a global label with name \"GND\" , ground" (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "GND_0_1"
(polyline
(pts
(xy 0 0)
(xy 0 -1.27)
(xy 1.27 -1.27)
(xy 0 -2.54)
(xy -1.27 -1.27)
(xy 0 -1.27)
)
(stroke (width 0) (type default))
(fill (type none))
)
)
(symbol "GND_1_1"
(pin power_in line (at 0 0 270) (length 0) hide
(name "GND" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
)
)
)
(junction (at 154.94 81.28) (diameter 0) (color 0 0 0 0)
(uuid ad2e6530-e11d-4796-af13-3f73c9483a30)
)
(junction (at 166.37 73.66) (diameter 0) (color 0 0 0 0)
(uuid bdf646d3-3319-455c-a057-19facb99407a)
)
(wire (pts (xy 154.94 90.17) (xy 154.94 93.98))
(stroke (width 0) (type default))
(uuid 39d00e79-8786-405f-877f-7b931bf682dc)
)
(wire (pts (xy 143.51 73.66) (xy 149.86 73.66))
(stroke (width 0) (type default))
(uuid 70f1537a-8375-476b-abc3-0ffcb6d8444b)
)
(wire (pts (xy 154.94 81.28) (xy 154.94 82.55))
(stroke (width 0) (type default))
(uuid 72b4400a-873d-41c8-886d-c6197d219246)
)
(wire (pts (xy 135.89 91.44) (xy 138.43 91.44))
(stroke (width 0) (type default))
(uuid 864c531c-87c9-485b-a44e-d9aa537f522b)
)
(wire (pts (xy 154.94 81.28) (xy 166.37 81.28))
(stroke (width 0) (type default))
(uuid 969932bb-d653-468e-8fa7-ae1280b9e924)
)
(wire (pts (xy 166.37 73.66) (xy 166.37 81.28))
(stroke (width 0) (type default))
(uuid 9b064dfc-a209-46b5-8578-00d04636e159)
)
(wire (pts (xy 160.02 73.66) (xy 166.37 73.66))
(wire (pts (xy 160.02 73.66) (xy 176.53 73.66))
(stroke (width 0) (type default))
(uuid c7edf471-f510-4ced-ae0e-fa0b4de75aca)
)
(wire (pts (xy 166.37 73.66) (xy 176.53 73.66))
(stroke (width 0) (type default))
(uuid f3627e85-27db-4178-ab45-ee4f7a187e6a)
)
(text "The PMOS circuit for reverse protection can be used without a Zener diode. \nHowever, in that case you need ensure that the Vgs (gate-source voltage) does not exceed the maximum rating of the PMOS transistor to prevent damage. "
(at 77.47 106.68 0)
Expand All @@ -295,62 +186,11 @@
(effects (font (size 1.27 1.27)) (justify left))
(uuid a47934db-1933-4fca-a88e-84db51cda995)
)
(hierarchical_label "gnd" (shape input) (at 135.89 91.44 180) (fields_autoplaced)
(hierarchical_label "gnd" (shape input) (at 154.94 81.28 180) (fields_autoplaced)
(effects (font (size 1.27 1.27)) (justify right))
(uuid ffdf205e-8c01-42f5-9c74-59c89b39b0dd)
)
(symbol (lib_id "Device:R") (at 154.94 86.36 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no)
(uuid 11d043ae-68aa-42cf-8f1f-28f159fc26c5)
(property "Reference" "res" (at 156.21 83.82 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "~" (at 157.48 87.6299 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "" (at 153.162 86.36 90)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (at 154.94 86.36 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid b02e1948-9b37-4cb6-bf64-0c78c0d46648))
(pin "2" (uuid ee2b34a0-a4b8-49c0-8f51-691ed039f813))
(instances
(project "PmosReverseProtection"
(path "/b55f6c44-5d5d-4524-bb86-893662f64598"
(reference "res") (unit 1)
)
)
)
)
(symbol (lib_id "power:GND") (at 154.94 93.98 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no)
(uuid 249a0bbc-9f7c-4275-b4f3-393dbf37d48b)
(property "Reference" "#PWR0101" (at 154.94 100.33 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "GND" (at 152.4 93.98 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (at 154.94 93.98 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (at 154.94 93.98 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid 93cb6b9d-dc3c-4212-bdb2-14b9fbce5dfd))
(instances
(project "PmosReverseProtection"
(path "/b55f6c44-5d5d-4524-bb86-893662f64598"
(reference "#PWR0101") (unit 1)
)
)
)
)
(symbol (lib_id "Device:Q_PMOS_DGS") (at 154.94 76.2 90) (unit 1)
(in_bom yes) (on_board yes) (dnp no)
(uuid 39f44928-01d2-4e2e-9e28-a7bb035b6c2b)
Expand Down Expand Up @@ -378,31 +218,6 @@
)
)
(symbol (lib_id "power:GND") (at 138.43 91.44 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no)
(uuid bc23023a-7276-47fe-a42c-9a7cdbf61866)
(property "Reference" "#PWR0102" (at 138.43 97.79 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "GND" (at 142.24 92.71 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (at 138.43 91.44 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (at 138.43 91.44 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid fcb25af1-9e79-4795-8ac6-618ea9d6ddb8))
(instances
(project "PmosReverseProtection"
(path "/b55f6c44-5d5d-4524-bb86-893662f64598"
(reference "#PWR0102") (unit 1)
)
)
)
)
(sheet_instances
(path "/" (page "1"))
)
Expand Down
Loading

0 comments on commit 6836756

Please sign in to comment.