| 1 |
.PS |
| 2 |
# Spec555.m4 |
| 3 |
# https://tex.stackexchange.com/questions/64801/display-ics-with-circuitikz?rq=1 |
| 4 |
log_init |
| 5 |
textoffset += 1bp__ |
| 6 |
|
| 7 |
define(`spec555',`[ Chip: box wid 8*lg_pinsep ht 10*lg_pinsep fill_(0.9) |
| 8 |
command "{\scriptsize\sf" |
| 9 |
Pin1: "1" at 3/4<Chip.sw,Chip.se> below rjust; "GND" above |
| 10 |
Pin5: "5" at Chip.s below rjust ; "CTRL" above |
| 11 |
Pin2: "2" at 1/8<Chip.sw,Chip.nw> above rjust; "TRG" ljust |
| 12 |
Pin6: "6" at 3/8<Chip.sw,Chip.nw> above rjust; "THR" ljust |
| 13 |
Pin7: "7" at 7/8<Chip.sw,Chip.nw> above rjust; "DIS" ljust |
| 14 |
Pin3: "3" at Chip.e above ljust ; "OUT" rjust |
| 15 |
Pin4: "4" at 3/4<Chip.nw,Chip.ne> above rjust; "\phantom{M}RESET" below |
| 16 |
Pin8: "8" at Chip.n above rjust ; "Vcc" below |
| 17 |
"NE-555" at Chip.c |
| 18 |
command "}%" |
| 19 |
line left dimen_ from Pin7; X:dot |
| 20 |
{ R1:resistor(up_ Pin7.y-Pin6.y); rlabel(,\SI{68}{\kilo\ohm}); dot } |
| 21 |
R2:resistor(down_ Pin7.y-Pin6.y); llabel(,\SI{68}{\kilo\ohm}); dot |
| 22 |
{line to Pin6} |
| 23 |
line to (Here,Pin2); SW: dot; {line to Pin2} |
| 24 |
line from Pin8 to (Pin8,R1.end); dot ]') |
| 25 |
|
| 26 |
command "{\small\sf" |
| 27 |
T1: spec555; "U1" at T1.Chip.nw above ljust |
| 28 |
T2: spec555 with .Chip.w at T1.Chip.e+(2.5*dimen_,0) |
| 29 |
"U2" at T2.Chip.nw above ljust |
| 30 |
{line left_ dimen_/2 from (T1.X,T1.Pin7); diode(down_ T1.Pin7.y-T1.Pin6.y) |
| 31 |
rlabel(,\shortstack{D1\\1N4148}) |
| 32 |
line to (T1.X,Here); dot} |
| 33 |
capacitor(down_ elen_ from T1.SW,E+); llabel(,\SI{10}{\micro\farad}); dot |
| 34 |
dot(at Here-(dimen_/2,0),,1); G: dot(,,1); "GND" rjust at G.w |
| 35 |
capacitor(from T1.Pin5 to (T1.Pin5,G),E+); rlabel(,\SI{0.01}{\nano\farad}) |
| 36 |
dot; line from T1.Pin1 to (T1.Pin1,G); dot |
| 37 |
Vcc: dot(at (G,T1.R1.end),,1); "Vcc" rjust at Vcc.w |
| 38 |
dot(at (T1.Pin4,Vcc)); line to T1.Pin4 |
| 39 |
line right_ dimen_/2 from T1.Pin3; |
| 40 |
R3: resistor(down_ to (Here,T2.s-(0,dimen_/4))); llabel(,\SI{10}{\kilo\ohm}) |
| 41 |
line to (T2.Pin5,Here) then to T2.Pin5 |
| 42 |
dot(at (T2.X,G)); ground |
| 43 |
reversed(`capacitor',up_ to (Here,T2.Pin5),E+); rlabel(,\SI{100}{\nano\farad}) |
| 44 |
line to (Here,T2.Pin2) |
| 45 |
line from T2.Pin1 to (T2.Pin1,G); dot |
| 46 |
line from T2.Pin4 to (T2.Pin4,Vcc) then to Vcc chop 0 chop dotrad_ |
| 47 |
dot(at (T2.X,T2.R1.end)+(0,dimen_/2),,1); {line to T2.R1.end chop dotrad_} |
| 48 |
"$+$\SI{5}{\volt} to $+$\SI{15}{\volt}" at last [].n above |
| 49 |
capacitor(right_ dimen_ from T2.Pin3,C); llabel(,\SI{100}{\micro\farad}) |
| 50 |
Pot1: potentiometer(down_ (Here.y-G.y)/2) with .Start at Here |
| 51 |
"Rx" at Pot1.T1 ljust |
| 52 |
Sp: speaker(R,,,fill_(0.9)) with .In5 at Pot1.End |
| 53 |
"1" above rjust at Sp.In5; "2" below rjust at Sp.In7; "E1" at Sp.In2 rjust |
| 54 |
line from Sp.In7 to (Sp.In7,G) then to G chop 0 chop dotrad_ |
| 55 |
command "}%" |
| 56 |
|
| 57 |
.PE |