From 37ed38c8d6584e647c391c34403daa40a19a2bc0 Mon Sep 17 00:00:00 2001 From: emard Date: Fri, 15 Feb 2019 11:20:15 +0100 Subject: [PATCH] run spice interactively without nutmeg --- spice/Makefile | 5 ++++- spice/powersection-v20.spice | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/spice/Makefile b/spice/Makefile index 25fda3c..6618ab4 100644 --- a/spice/Makefile +++ b/spice/Makefile @@ -1,6 +1,6 @@ #all: powersection-v17.plot #all: powersection-v188.plot -all: powersection-v20.plot +all: powersection-v20.plot2 #SPICE=spice3 #SCOPE=rlwrap nutmeg @@ -17,5 +17,8 @@ bin: switch.m %.plot: %.raw $(SCOPE) $< +%.plot2: %.spice + $(SPICE) < $< + clean: rm -f *.raw *~ DEADJOE diff --git a/spice/powersection-v20.spice b/spice/powersection-v20.spice index c722a48..cb402ad 100644 --- a/spice/powersection-v20.spice +++ b/spice/powersection-v20.spice @@ -124,6 +124,19 @@ CL P3V3 0 1000uF .MODEL BC857 PNP (BF=150) .MODEL N7002 NMOS (LEVEL=1, VTO=2.5, KP=40, RS=0.033, RD=0.034) +* .control card accepts commands like from interactive mode see: +* http://bwrcs.eecs.berkeley.edu/Classes/IcBook/SPICE/UserGuide/interactive_fr.html +.CONTROL +* white background (color0) +*set color0 = white +* black text and grid +*set color1 = black +* run transient analysis +tran 1ms 3.3s +* plot results +plot v(pwrbtn_pulse),v(shutdown_pulse),v(wake_pulse),v(p3v3),v(ftdi_nsleep),v(pwren) +.ENDC + * todo * [x] delay: switch power 3.3V doesn't start immediately simulated with Rsmps=10 ohm * [ ] control signals should be derived from P3V3 line