From 1bd446a1920a3ff194b7249360705f0e86c5ab43 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 23 Aug 2020 20:11:56 +0200 Subject: netlist: in devices folder all DIP devices were removed. * NE555 and MC1455P were the last devices with DIP definitions in devices. --- src/lib/netlist/devices/net_lib.cpp | 2 - src/lib/netlist/devices/nld_ne555.cpp | 76 ---------------------------- src/lib/netlist/devices/nld_ne555.h | 16 +++--- src/lib/netlist/macro/nlm_otheric_lib.cpp | 84 +++++++++++++++++++++++++++++++ src/lib/netlist/macro/nlm_otheric_lib.h | 8 +++ 5 files changed, 98 insertions(+), 88 deletions(-) diff --git a/src/lib/netlist/devices/net_lib.cpp b/src/lib/netlist/devices/net_lib.cpp index 2ae4fd72442..9d7577a5d41 100644 --- a/src/lib/netlist/devices/net_lib.cpp +++ b/src/lib/netlist/devices/net_lib.cpp @@ -264,9 +264,7 @@ namespace devices LIB_ENTRY(4538) LIB_ENTRY(schmitt_trigger) LIB_ENTRY(NE555) - LIB_ENTRY(NE555_dip) LIB_ENTRY(MC1455P) - LIB_ENTRY(MC1455P_dip) LIB_ENTRY(TMS4800) LIB_ENTRY(r2r_dac) LIB_ENTRY(tristate) diff --git a/src/lib/netlist/devices/nld_ne555.cpp b/src/lib/netlist/devices/nld_ne555.cpp index 25ef0998d23..2175ae2c7f5 100644 --- a/src/lib/netlist/devices/nld_ne555.cpp +++ b/src/lib/netlist/devices/nld_ne555.cpp @@ -1,58 +1,6 @@ // license:GPL-2.0+ // copyright-holders:Couriersud -//- Identifier: NE555_DIP -//- Title: NE555 PRECISION TIMERS -//- Description: -//- These devices are precision timing circuits capable of producing accurate -//- time delays or oscillation. In the time-delay or monostable mode of -//- operation, the timed interval is controlled by a single external resistor -//- and capacitor network. In the astable mode of operation, the frequency and -//- duty cycle can be controlled independently with two external resistors and -//- a single external capacitor. -//- -//- The threshold and trigger levels normally are two-thirds and one-third, -//- respectively, of V CC. These levels can be altered by use of the -//- control-voltage terminal. When the trigger input falls below the trigger -//- level, the flip-flop is set and NC – No internal connection the output -//- goes high. If the trigger input is above the trigger level and the -//- threshold input is above the threshold level, the flip-flop is reset and -//- the output is low. The reset (RESET) input can override all other -//- inputs and can be used to initiate a new timing cycle. When RESET goes -//- low, the flip-flop is reset and the output goes low. When the output is low, -//- a low-impedance path is provided between discharge (DISCH) and ground. -//- -//- The output circuit is capable of sinking or sourcing current up to 200 mA. -//- Operation is specified for supplies of 5 V to 15 V. With a 5-V supply, -//- output levels are compatible with TTL inputs. -//- -//- The NE555 is characterized for operation from 0°C to 70°C. The SA555 is -//- characterized for operation from –40°C to 85°C. The SE555 is characterized -//- for operation over the full military range of –55°C to 125°C. -//- -//- Pinalias: GND,TRIG,OUT,RESET,CONT,THRES,DISCH,VCC -//- Package: DIP -//- NamingConvention: Naming conventions follow Texas instrument datasheet -//- Limitations: Internal resistor network currently fixed to 5k -//- If TRIG and TRESH are connected overshoot compensation will be enabled. -//- The approach is raw but delivers results (at 5 to 10 steps per discharge/charge) -//- within a couple of percent. Please take into account that any datasheet -//- formulas are idealistic. Neither capacitor, resistor, internal resistor -//- tolerances are taken into account. Nor are ambient temperature and chip -//- temperature. Thus the result is considered acceptable. -//- The datasheet states a maximum discharge of 200mA, this is not modelled -//- Instead an impedance of 1 Ohm is used. -//- -//- Example: ne555_astable.c,ne555_example -//- FunctionTable: -//- -//- |RESET|TRIGGER VOLTAGE|THRESHOLD VOLTAGE|OUTPUT|DISCHARGE SWITCH| -//- |:---:|:-------------:|:---------------:|:----:|:--------------:| -//- |Low | Irrelevant | Irrelevant | Low | On | -//- |High | <1/3 VDD | Irrelevant | High | Off | -//- |High | >1/3 VDD | >2/3 VDD | Low | On | -//- |High | >1/3 VDD | <2/3 VDD | As previously established|| -//- #include "nld_ne555.h" #include "netlist/analog/nlid_twoterm.h" @@ -211,32 +159,8 @@ namespace netlist } }; - NETLIB_OBJECT(NE555_dip) - { - NETLIB_CONSTRUCTOR(NE555_dip) - , A(*this, "A") - { - register_subalias("1", "A.GND"); // Pin 1 - register_subalias("2", "A.TRIG"); // Pin 2 - register_subalias("3", "A.OUT"); // Pin 3 - register_subalias("4", "A.RESET"); // Pin 4 - register_subalias("5", "A.CONT"); // Pin 5 - register_subalias("6", "A.THRESH"); // Pin 6 - register_subalias("7", "A.DISCH"); // Pin 7 - register_subalias("8", "A.VCC"); // Pin 8 - } - // FIXME: R_base needs to be removed from the code base - // The reset on R_Base executed after NE555 reset will - // overwrite values. - NETLIB_RESETI() { A.reset(); } - private: - NETLIB_SUB(NE555) A; - }; - NETLIB_DEVICE_IMPL(NE555, "NE555", "") - NETLIB_DEVICE_IMPL(NE555_dip, "NE555_DIP", "") NETLIB_DEVICE_IMPL_ALIAS(MC1455P, NE555, "MC1455P", "") - NETLIB_DEVICE_IMPL_ALIAS(MC1455P_dip, NE555_dip, "MC1455P_DIP", "") } //namespace devices } // namespace netlist diff --git a/src/lib/netlist/devices/nld_ne555.h b/src/lib/netlist/devices/nld_ne555.h index fc575d914b7..2c7fc8c22aa 100644 --- a/src/lib/netlist/devices/nld_ne555.h +++ b/src/lib/netlist/devices/nld_ne555.h @@ -6,16 +6,12 @@ #include "netlist/nl_setup.h" -#define NE555(name) \ - NET_REGISTER_DEV(NE555, name) +// usage : NE555(name) +#define NE555(...) \ + NET_REGISTER_DEVEXT(NE555, __VA_ARGS__) -#define NE555_DIP(name) \ - NET_REGISTER_DEV(NE555_DIP, name) - -#define MC1455P(name) \ - NET_REGISTER_DEV(MC1455P, name) - -#define MC1455P_DIP(name) \ - NET_REGISTER_DEV(MC1455P_DIP, name) +/// usage : MC1455P(name) +#define MC1455P(...) \ + NET_REGISTER_DEVEXT(MC1455P, __VA_ARGS__) #endif /* NLD_NE555_H_ */ diff --git a/src/lib/netlist/macro/nlm_otheric_lib.cpp b/src/lib/netlist/macro/nlm_otheric_lib.cpp index 327b57faa62..2879829fc99 100644 --- a/src/lib/netlist/macro/nlm_otheric_lib.cpp +++ b/src/lib/netlist/macro/nlm_otheric_lib.cpp @@ -153,6 +153,88 @@ static NETLIST_START(NE566_DIP) NETLIST_END() +//- Identifier: NE555_DIP +//- Title: NE555 PRECISION TIMERS +//- Description: +//- These devices are precision timing circuits capable of producing accurate +//- time delays or oscillation. In the time-delay or monostable mode of +//- operation, the timed interval is controlled by a single external resistor +//- and capacitor network. In the astable mode of operation, the frequency and +//- duty cycle can be controlled independently with two external resistors and +//- a single external capacitor. +//- +//- The threshold and trigger levels normally are two-thirds and one-third, +//- respectively, of V CC. These levels can be altered by use of the +//- control-voltage terminal. When the trigger input falls below the trigger +//- level, the flip-flop is set and NC – No internal connection the output +//- goes high. If the trigger input is above the trigger level and the +//- threshold input is above the threshold level, the flip-flop is reset and +//- the output is low. The reset (RESET) input can override all other +//- inputs and can be used to initiate a new timing cycle. When RESET goes +//- low, the flip-flop is reset and the output goes low. When the output is low, +//- a low-impedance path is provided between discharge (DISCH) and ground. +//- +//- The output circuit is capable of sinking or sourcing current up to 200 mA. +//- Operation is specified for supplies of 5 V to 15 V. With a 5-V supply, +//- output levels are compatible with TTL inputs. +//- +//- The NE555 is characterized for operation from 0°C to 70°C. The SA555 is +//- characterized for operation from –40°C to 85°C. The SE555 is characterized +//- for operation over the full military range of –55°C to 125°C. +//- +//- Pinalias: GND,TRIG,OUT,RESET,CONT,THRES,DISCH,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow Texas instrument datasheet +//- Limitations: Internal resistor network currently fixed to 5k +//- If TRIG and TRESH are connected overshoot compensation will be enabled. +//- The approach is raw but delivers results (at 5 to 10 steps per discharge/charge) +//- within a couple of percent. Please take into account that any datasheet +//- formulas are idealistic. Neither capacitor, resistor, internal resistor +//- tolerances are taken into account. Nor are ambient temperature and chip +//- temperature. Thus the result is considered acceptable. +//- The datasheet states a maximum discharge of 200mA, this is not modelled +//- Instead an impedance of 1 Ohm is used. +//- +//- Example: ne555_astable.c,ne555_example +//- FunctionTable: +//- +//- |RESET|TRIGGER VOLTAGE|THRESHOLD VOLTAGE|OUTPUT|DISCHARGE SWITCH| +//- |:---:|:-------------:|:---------------:|:----:|:--------------:| +//- |Low | Irrelevant | Irrelevant | Low | On | +//- |High | <1/3 VDD | Irrelevant | High | Off | +//- |High | >1/3 VDD | >2/3 VDD | Low | On | +//- |High | >1/3 VDD | <2/3 VDD | As previously established|| +//- +static NETLIST_START(NE555_DIP) + + NE555(A) + + ALIAS(1, A.GND) // Pin 1 + ALIAS(2, A.TRIG) // Pin 2 + ALIAS(3, A.OUT) // Pin 3 + ALIAS(4, A.RESET) // Pin 4 + ALIAS(5, A.CONT) // Pin 5 + ALIAS(6, A.THRESH) // Pin 6 + ALIAS(7, A.DISCH) // Pin 7 + ALIAS(8, A.VCC) // Pin 8 + +NETLIST_END() + +static NETLIST_START(MC1455P_DIP) + + MC1455P(A) + + ALIAS(1, A.GND) // Pin 1 + ALIAS(2, A.TRIG) // Pin 2 + ALIAS(3, A.OUT) // Pin 3 + ALIAS(4, A.RESET) // Pin 4 + ALIAS(5, A.CONT) // Pin 5 + ALIAS(6, A.THRESH) // Pin 6 + ALIAS(7, A.DISCH) // Pin 7 + ALIAS(8, A.VCC) // Pin 8 + +NETLIST_END() + NETLIST_START(otheric_lib) TRUTHTABLE_START(MC14584B_GATE, 1, 1, "") TT_HEAD(" A | Q ") @@ -164,5 +246,7 @@ NETLIST_START(otheric_lib) LOCAL_LIB_ENTRY(MC14584B_DIP) LOCAL_LIB_ENTRY(NE566_DIP) + LOCAL_LIB_ENTRY(NE555_DIP) + LOCAL_LIB_ENTRY(MC1455P_DIP) NETLIST_END() diff --git a/src/lib/netlist/macro/nlm_otheric_lib.h b/src/lib/netlist/macro/nlm_otheric_lib.h index c69b4d61224..c0e22cba635 100644 --- a/src/lib/netlist/macro/nlm_otheric_lib.h +++ b/src/lib/netlist/macro/nlm_otheric_lib.h @@ -27,6 +27,14 @@ #define NE566_DIP(name) \ NET_REGISTER_DEV(NE566_DIP, name) +// usage : NE555_DIP(name) +#define NE555_DIP(...) \ + NET_REGISTER_DEVEXT(NE555_DIP, __VA_ARGS__) + +// usage : MC1455P_DIP(name) +#define MC1455P_DIP(...) \ + NET_REGISTER_DEVEXT(MC1455P_DIP, __VA_ARGS__) + #endif /* ---------------------------------------------------------------------------- -- cgit v1.2.3