summaryrefslogtreecommitdiffstatshomepage
path: root/nl_examples/bjt_eb.c
diff options
context:
space:
mode:
author Couriersud <couriersud@users.noreply.github.com>2014-01-06 14:40:43 +0000
committer Couriersud <couriersud@users.noreply.github.com>2014-01-06 14:40:43 +0000
commit093e3f5f21227801f907a5cd0fd3dca4222a0174 (patch)
treedef2d3f22838086823305f4d646d2583559c20d9 /nl_examples/bjt_eb.c
parentf7856a86540f42232973d1000e74e22ed82a0c0e (diff)
Some more netlist examples.
Diffstat (limited to 'nl_examples/bjt_eb.c')
-rw-r--r--nl_examples/bjt_eb.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/nl_examples/bjt_eb.c b/nl_examples/bjt_eb.c
new file mode 100644
index 00000000000..cff1783edf3
--- /dev/null
+++ b/nl_examples/bjt_eb.c
@@ -0,0 +1,36 @@
+/*
+ * bjt.c
+ *
+ */
+
+
+#include "netlist/devices/net_lib.h"
+
+NETLIST_START(bjt)
+ /* Standard stuff */
+
+ NETDEV_CLOCK(clk)
+ NETDEV_PARAM(clk.FREQ, 1000) // 1000 Hz
+ NETDEV_SOLVER(Solver)
+ NETDEV_PARAM(Solver.FREQ, 48000)
+ NETDEV_PARAM(Solver.ACCURACY, 1e-4)
+ NETDEV_ANALOG_CONST(V5, 5)
+ NETDEV_ANALOG_CONST(V3, 3.5)
+
+ /* NPN - example */
+
+ NETDEV_QNPN_EB(Q, BC237B)
+ NETDEV_R(RB, 1000)
+ NETDEV_R(RC, 1000)
+
+ NET_C(RC.1, V5)
+ NET_C(RC.2, Q.C)
+ NET_C(RB.1, clk)
+ //NET_C(RB.1, V3)
+ NET_C(RB.2, Q.B)
+ NET_C(Q.E, GND)
+
+ NETDEV_LOG(logB, Q.B)
+ NETDEV_LOG(logC, Q.C)
+
+NETLIST_END()