Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/UNO.m4

raw
1 .PS
2 # UNO.m4
3 # https://learn.circuit.rocks/the-basic-arduino-schematic-diagram ?
4 log_init
5 include(ics.m4)
6 sinclude(UNO.m4def)
7 sinclude(../UNO.m4def)
8 finalscale = 0.72
9 textht = 0.1/finalscale
10 textoffset = 1.5bp__ * 2
11 ifpostscript(,latexcommand({\tiny\sf))
12
13 [
14
15 define(`pinlen',`30bp__')
16 define(`lg_pinsep',(1.2*lg_pinsep))
17 del = lg_pinsep
18 define(`pindiam',0.1)
19
20 define(`egnd',`ground(,,E); "GND" at last line.c below')
21
22 U3: ATMEGA16U2
23 `"ATMEGA16U2-MU(R)"' at U3.Chip.s below
24 `"U3"' at U3.Chip.nw ljust above
25 ZU4: ATMEGA328P with .Chip.nw at U3.Chip.sw+(-2.5,-10*del)
26 `"ATMEGA328P-PU"' at ZU4.Chip.s below
27 `"ZU4"' at ZU4.Chip.nw ljust above
28
29 dot(at U3.Pin2.end)
30 R1: resistor(down_ 2*lg_pinsep,,E)
31 rlabel(,"R1" rjust "1M" rjust)
32 dot
33 dot(at R1.start-(2*del,0))
34 xtal(down_ 2*lg_pinsep)
35 rlabel(,16,"MHz"); dot
36 XT2: dot(at last line.start-(2*del,0)); { "XT2" at last [].n above }
37
38 Br1: jumper(left_ from U3.Pin33.end to (XT2,U3.Pin33))
39 rlabel(1,,2); llabel(,"GROUND")
40 BRE: dot
41 line to (Here,U3.Pin28) then to U3.Pin28.end
42 {"UGND" at (Br1,Here) above}
43
44 XT1: dot(at XT2-(del,R1.len)); { "XT1" at last [].n above }
45 line from XT1 to U3.Pin1.end
46 line from U3.Pin2.end to (XT1,XT2)
47 C11: capacitor(left_ 3*del); rlabel(,"C11"); llabel(,"22`'pF")
48 C9: capacitor(from XT1 to (Here,XT1)); {"C9" "22`'pF" at last [].s+(0,-11bp__)}
49 { line to C11.end }
50 dot
51 G1: egnd
52 line from XT1 down_ 3*del; continue to (G1,Here); dot(,,1)
53 {"XT3" at last [].n above}
54 dot(at Here+(0,-3/2*del),,1); {"XT4" at last [].n above}
55 { line to (XT2,Here) then to XT2 chop dotrad_ chop 0 }
56 USBVCC: dot(at Here+(0,-7/2*del),,1)
57 {"USBVCC" at last [].n-(3/2*del,0) above ljust}
58 { line to (Here,U3.Pin31) chop dotrad_ chop 0; continue to U3.Pin31.end }
59 dot(at Here+(2*del,0),,1); {"VUCAP" at last [].e+(0,-5bp__) ljust}
60 line to (Here,U3.Pin27) chop dotrad_ chop 0; dot
61 line from U3.Pin27.end to (G1.x-4.5*del,U3.Pin27.y)
62 C8: capacitor(down_ to (Here,Br1)); llabel("C8",,1`\,'\mu)
63 Bus1: dot
64
65 dot(at U3.Pin33.end)
66 move to U3.Pin3.end; line to (Here,U3.Chip.s)
67 G2: ground(,T,E); {"GND" at last line.c below }
68
69 dot(at U3.Pin32.end)
70 {line to U3.Pin4.end; dot}
71 line left del; ground(,,E,U); {"$+5`\,'$V" at last line.c above}
72
73 line from U3.Pin4.end left_ 2*del
74 capacitor(down_ 3*del); { llabel("C7",,100n) }
75 G3: ground(,T,E); {"GND" at last line.c below }
76
77 line from U3.Pin30.end to (G1.x-2*del,U3.Pin30.y); TD: Here
78 continue to (Here,U3.Pin32)
79 { "RD$-$" above rjust }; continue left_ 1.5*del
80 RN3A: resistor(left_ 3/2*dimen_,,E); rlabel(,"22R RN3A")
81 Dm: line left_ 7*del
82
83 USB: [ K: box invis wid dimen_/2 ht 5*lg_pinsep
84 "USB" rjust at K.e
85 line thick 1.5 from K.nw to K.ne then to K.se then to K.sw
86 foreach_(`x',
87 `Pin`'m4Lx: K.ne-(0,m4Lx/5*K.ht)
88 "x" at Pin`'m4Lx ljust above',
89 1 XUSB, 2 D$-$, 3 D$+$, 4 UGND)
90 P_1: K.sw; {"P1" at P_1 below rjust}
91 P_2: K.s; {"P2" at P_2 below ljust}
92 ] with .Pin2 at Here; "X2" at USB.ne above rjust
93
94 move to U3.Pin29.end
95 line to (TD.x-del,Here.y); continue to (Here,Dm-(0,lg_pinsep))
96 { "RD$+$" above rjust}
97 continue to (RN3A.start,Here)
98 RN3D: resistor(left_ 3/2*dimen_,,E); llabel(,"22R RN3D")
99 line to USB.Pin3
100
101 dot(at RN3A.end); line to (Here,RN3D)
102 Z2: variable(`resistor(down_ to (Here,U3.Pin27),,E); rlabel("Z2")',NN)
103 dot(at RN3D.end-(2*del,0))
104 Z1: variable(`resistor(to (Here,U3.Pin27),,E); rlabel("Z1")',NN)
105 dot; line to (Z2,Here)
106 move up Z1.len/4 from last line.c; "CG0603MLC-05E" "X 2"
107
108 line down_ del from USB.P_1; continue to (USB.P_2,Here); dot
109 line from USB.P_2 to (USB.P_2,Z1.end) then to Z1.end
110 dot(at (USB.P_2,Here)+(3/2*del,0)); line to (Here,USBVCC)
111 dot(,,1); {"USHIELD" at last [].n+(4bp__,0) above}
112
113 L1: reversed(`inductor',down_ from Z1.end to (Z1,C8.end),W,,)
114 rlabel(,"L1"); llabel("BLM21" ljust); dot
115 { dot(at (Z2,Here)); line to (Here,U3.Pin28); dot(,,1)
116 "UGND" at last [].n above }
117 line from USB.Pin1 to (Z2,USB.Pin1) then up 2*del
118 XUSB: dot(,,1); {"XUSB" at last [].n above}
119 line from (Z1,USB.Pin3) to (Z1,XUSB);
120 DP: dot(,,1); {"D$+$" at last [].n above}
121 dot(at (DP,USB.Pin2)-(2*del,0)); line to (Here,XUSB)
122 DM: dot(,,1); "D$-$" at last [].n above
123 line from USB.Pin4 to (DM,USB.Pin4) then to (DM,BRE) then to BRE
124
125 line from U3.Pin18.end right_ 3.5*del
126 JP2: Header(A2,2,4*del,2*lg_pinsep,,0.2;pindiam) with .P3.end at Here
127 "JP2" at JP2.Block.nw above ljust
128 "2X2M - NM" at JP2.s below
129 "1" at JP2.P3.end above ljust; "3" at JP2.P1.end above ljust
130 "2" at JP2.P4.end above rjust; "4" at JP2.P2.end above rjust
131 line from JP2.P1.end to (JP2.P1.end,U3.Pin19) then to U3.Pin19.end
132 dot(at JP2.P1.end); line up 3.5*del
133 TPPB5: dot(,,1); {"PB5" at last [].e ljust}
134 TPPB4: dot(at TPPB5-(del*3/2,0),,1); {"PB4" at last [].w rjust}
135 line to (Here,JP2.P3); dot
136 line from JP2.P2.end to (JP2.P2.end,TPPB4)
137 TPPB7: dot(,,1); {"PB7" at last [].w rjust}
138 line from JP2.P4.end right del*3/2; continue to (Here,TPPB4)
139 TPPB6: dot(,,1); {"PB6" at last [].n above}
140 line from U3.Pin20.end right del then up del; continue to (TPPB6,Here); dot
141 line from U3.Pin21.end up del; continue to (TPPB7,Here); dot
142
143 ICSP1: Header(A2,3,4*del,2.5*lg_pinsep,,0.2;pindiam) \
144 with .P1.end at (JP2.P1.end,U3.Pin14)
145 "ICSP1" at last [].Block.nw above ljust
146 "3X2 M" at last [].Block.sw below ljust
147 for_(1,5,2,`"m4x" at ICSP1.P`'m4x.end above ljust')
148 for_(2,6,2,`"m4x" at ICSP1.P`'m4x.end above rjust')
149 line from ICSP1.P1.end to (ICSP1.P1.end,U3.Pin17) then to U3.Pin17.end
150 line from ICSP1.P3.end left del; continue to (Here,U3.Pin15) \
151 then to U3.Pin15.end
152
153 dot(at U3.Pin24.end);
154 RN1C: resistor(up_ 5*lg_pinsep,,E); rlabel(,"10K","RN1C"); llabel(5,,3) dot
155 line up_ 2*del; ground(,T,E,U); {"+5 V" at last line.w rjust}
156 dot(at U3.Pin24.end-(del,0));
157 D3: diode(up_ RN1C.len); llabel(,,"D3")
158 line to (TPPB6.x+del,Here.y)
159 continue to (Here,ICSP1.P2.end) then to ICSP1.P2.end
160 line from ICSP1.P5.end down 2*del; continue to (TPPB6.x+2*del,Here.y)
161 TRESET2: Here
162 continue to (Here.x,D3.end.y+del) then to (RN1C.end.x-2*del,D3.end.y+del)
163 continue to (Here,U3.Pin24) then to U3.Pin24.end
164 G4: ground(at ICSP1.P6.end,,E); {"GND" at last line.c below }
165 line from ICSP1.P4.end right del then up U3.Pin16.y-ICSP1.P4.y \
166 then to U3.Pin16.end
167 dot(at ICSP1.P1.end); line left_ 2.5*del then down_ 5*del
168 MISO2: dot(,,1); {"MISO2" at last [].s below }
169 dot(at ICSP1.P3.end-(del,0)); line to (Here,MISO2)
170 SCK2: dot(,,1); {"SCK2" at last [].s below ljust }
171 dot(at TRESET2); line to (Here,SCK2)
172 RESET2: dot(,,1); {"RESET2" wid 36bp__ at last [].s below }
173 dot(at ICSP1.P4.end+(del,0)); line to (Here,RESET2)
174 MOSI2: dot(,,1); {"MOSI2" at last [].s-(del,0) below }
175
176 line right_ del from U3.Pin11.end then up_ del*3/2
177 TXLED: reversed(`diode',right_ elen_,LER)
178 rlabel(,"YELLOW"); llabel("TX"); dot
179 {line up_ del; TPTXL: dot(,,1); "TXL" at last [].n above}
180 RN2C: resistor(right_ elen_,,E); llabel(,"1 K RN2C"); rlabel(6,,3); dot
181 line from U3.Pin10.end to (TXLED.start,U3.Pin10)
182 RXLED: reversed(`diode',to (TXLED.end,Here),LER)
183 rlabel(,"YELLOW"); llabel("RX"); dot
184 {line up_ del; dot(,,1); "RXL" at last [].n above}
185 RN2B: resistor(right_ elen_,,E); llabel(,"1 K RN2B"); rlabel(7,,2)
186 line to (Here,TPTXL); ground(,T,E,U); "+5 V" at last line.c above
187
188 # ZU4 connections
189 line left_ del*3/2 from ZU4.Pin7.end; dot
190 {line up_ del; G4: ground(,T,E,U); "+5 V" at last line.c above }
191 C6: capacitor(down dimen_); llabel("100n",,"C6"); dot
192 { dot(at ZU4.Pin8.end) }; dot(at (ZU4.Pin8.end,Here))
193 { G4: ground(at Here+(0,-del),,E); {"GND" at last line.c below }
194 line to ZU4.Pin22.end }
195 line left_ Here.x-C6.x + dimen_*5/4
196 C10: capacitor(up_ C6.len); llabel("100n",,"C10"); dot
197 { line to (Here,ZU4.Pin20) then to ZU4.Pin20.end }
198 L2: inductor(right_ to C6.start,W); rlabel(,"L2"); llabel(,"100$`\,'\mu$H")
199
200 line left 2*del from ZU4.Pin9.end; PE: dot
201 R2: resistor(up_ to (Here,ZU4.Pin10),,E); llabel(,"R2"); rlabel(,"1 M"); dot
202 dot(at Here-(del*4.0,0)); { "XTAL2" above ljust }
203 XTAL: xtal(down_ R2.len); llabel("16 MHz"); dot; { "XTAL1" below ljust }
204 pushdef(`dimen_',dimen_/2)
205 capacitor(left_ del from 0.2 between XTAL.start and XTAL.end)
206 capacitor(left_ del from 0.8 between XTAL.start and XTAL.end)
207 popdef(`dimen_')
208 line up XTAL.len*0.6
209 line left del from last line.c then down del
210 G5: ground(,T,E); "GND" at last line.c below
211 line down_ del from XTAL.end; dot(,,1); "XT1" at last [].s below
212 line up del from XTAL.start; dot(,,1); "XT2" at last [].n above
213 line from XTAL.start to ZU4.Pin10.end
214 line from XTAL.end to ZU4.Pin9.end
215 line left 2*del from ZU4.Pin1.end; dot
216 D2: diode(up_ dimen_); rlabel(,"D2")
217 dot(at D2.start-(2.5*del,0))
218 RN1D: resistor(up_ D2.len,,E); rlabel("10 K",,"RN1D"); dot
219 { line to D2.end }
220 line up_ del; ground(,T,E,U); "+5 V" at last line.c above
221
222 line from ZU4.Pin1.end to (RN1D-(1.5*del,0),ZU4.Pin1) then up 7*del
223 continue to (ZU4.Chip.w,Here)+(del,0); BRB: dot
224 { line down_ 2*del; Br2: jumper(right_ dimen_)
225 llabel(1,,2); rlabel(,"RESET\_EN"); line up_ 2*del; dot }
226 line right_ dimen_+del
227 C5: capacitor(right_ dimen_); llabel(,"C5"); rlabel("100n"); dot
228 { RN2D: resistor(down_ dimen_,,E); rlabel(,"1 K"); llabel(,"RN2D")
229 G6: ground(,T,E); "GND" at last line below }
230 { line up_ del; DTR: dot(,,1); "DTR" at last [].e ljust }
231 line from U3.Pin13.end right del/2; continue to (Here,U3.Chip.s) \
232 then left+2*del; continue to (Here,BRB) then to C5.end
233 TP2: Here; continue to C5.end
234
235 line up 3*del from BRB
236 TP1: dot #; line left BRB.x-RN1D.x
237 RESET: rswitch( right_ dimen_ from (USB.e,Here)+(del/2,0))
238 { "RESET" at RESET+(-del*1.7,1.0*del) above }
239 line left del from RESET.start then down del
240 G7: ground(,T,E); "GND" at last line.c below
241
242 ICSP: Header(A2,3,4*del,2.5*lg_pinsep,,0.2;pindiam) \
243 with .Block.sw at ZU4.Pin19.end+(2*del,del*3)
244 "ICSP" at ICSP.Block.nw above ljust
245 "3X2 M" at ICSP.Block.sw below ljust
246 for_(1,5,2,`"m4x" at ICSP.P`'m4x.end above ljust')
247 for_(2,6,2,`"m4x" at ICSP.P`'m4x.end above rjust')
248 dot(at ZU4.Pin19.end); line to (Here,ICSP.P3) then to ICSP.P3.end
249 line from ZU4.Pin18.end right del; dot
250 line to (Here,ICSP.P1) then to ICSP.P1.end
251 move to ICSP.P5.end; line to (ZU4.Pin19.end,Here)-(del,0);
252 continue to (Here,TP1); dot
253 line from ICSP.P2.end up_ del; ground(,T,E,U); "+5 V" at last line.c above
254 line from ICSP.P6.end down_ del; G9: ground(,T,E); "GND" at last line.c below
255 move to ICSP.P4.end; line right_ del then down Here.y - ZU4.Pin17.y; dot
256
257 line right_ from RESET.end to (U3.Chip.e+(12*del,0),TP1)
258 POWER: Header(A1,8,1.5*del,7*lg_pinsep,,0.2;pindiam) with .P3.end at Here
259 "POWER" wid 36bp__ at POWER.Block.nw above ljust
260 "8X1F-H8.5" at POWER.Block.sw below ljust
261 for_(1,8,1,`"m4x" at POWER.P`'m4x.end above ljust')
262 line from POWER.P2.end left del/2 then down POWER.P2.y-POWER.P5.y ; dot
263 line from POWER.P4.end left 2.5*del; "+3V3" above ljust
264 dot(at POWER.P3.end-(del*1.5,0)); line up 2*del
265 dot(,,1); "RESET" at last [].n above
266 line from POWER.P5.end left 3.5*del then up 4*del; ground(,T,E,U)
267 "+5 V" at last line.c above
268 line left del*2 from POWER.P8.end; "VIN" above ljust
269 line left del/2 from POWER.P7.end; dot
270 line from POWER.P6.end to (Here,POWER.P6.end) then to Here+(0,-2.5*del)
271 G10: ground(,T,E); "GND" at last line.c below
272
273 right_
274
275 IOH: Header(A1,10,1.5*del,10*lg_pinsep,,0.2;pindiam) \
276 with .P10.end at ZU4.Pin14.end + (del*15,0)
277 "IOH" at IOH.Block.nw above ljust
278 "10X1F-H8.5" at IOH.Block.se below ljust
279 for_(0,9,1,`
280 { "incr(m4x)" above ljust at IOH.P`'eval(10-m4x).end }
281 move to IOH.P`'eval(10-m4x).start-(pindiam/2+dotrad_/2,0)
282 ifelse(m4x,6,,`dot')
283 move to IOH.P`'eval(10-m4x).end
284 ifelse(eval(m4x<6),1,`line from ZU4.Pin`'eval(14+m4x).end to Here ')
285 ifelse(m4x,6,,` line right del*4; dot(,pindiam/2,1) ')
286 ifelse(eval(m4x<6),1,`"eval(8+m4x)" at last [].e ljust ')')
287 "SCL" at last [].e ljust
288 "SDA" at 3rd last [].e ljust
289 "AREF" at 5th last [].e ljust
290
291 AD: Header(A1,6,1.5*del,6*lg_pinsep,,0.2;pindiam) \
292 with .P6.end at (IOH.P10.end,ZU4.Pin23) #.end + (del*6,0)
293 "AD" at AD.Block.nw above ljust
294 "6X1F-H8.5" at AD.Block.se below ljust
295 for_(0,5,1,`
296 dot(at AD.P`'eval(6-m4x).start-(pindiam/2+dotrad_/2,0))
297 line from ZU4.Pin`'eval(23+m4x).end \
298 to AD.P`'eval(6-m4x).end; {"incr(m4x)" above ljust}
299 line right del*4; dot(,pindiam/2,1)
300 "A`'m4x" at last [].e ljust ')
301
302 IOL: Header(A1,8,1.5*del,8*lg_pinsep,,0.2;pindiam) \
303 with .P8.end at (AD.P1.end,ZU4.Pin2)
304 "IOL" at IOL.Block.nw above ljust
305 "8X1F-H8.5" at IOL.Block.sw ljust below
306 for_(0,7,1,`
307 dot(at IOL.P`'eval(8-m4x).start-(pindiam/2+dotrad_/2,0))
308 line from ZU4.Pin`'eval(ifelse(eval(m4x<5),1,2,6)+m4x).end \
309 to IOL.P`'eval(8-m4x).end; {"incr(m4x)" above ljust}
310 line right del*4; dot(,pindiam/2,1)
311 "m4x" at last [].e ljust ')
312
313 line from ZU4.Pin21.end up RESET.y-ZU4.Pin21.y-del \
314 then right ICSP.P4.end.x-ZU4.Pin21.end.x + 2*del
315 continue to (Here,IOH.P3)+(0,del*3/2); dot
316 { C4: capacitor(down_ 3.0*del); llabel("C4",,"100n")
317 { ground(,T,E); "GND" at last line.e ljust}
318 line from IOH.P4.end to (Here,IOH.P4); dot }
319 line right del*3/2; continue to (Here,IOH.P3) then to IOH.P3.end
320
321 line left del/2 from IOH.P2.end; continue to (Here,AD.P2); dot
322 line left del*3/2 from IOH.P1.end; continue to (Here,AD.P1); dot
323
324 line right_ del*2 from U3.Pin9.end then down_ 3.5*lg_pinsep; dot
325 { line right_ 2*del; dot(,,1); "RX" at last [].e ljust }
326 line to (Here,RESET)-(0,del)
327 RN4B: resistor(down_ dimen_,,E); llabel(7,"RN4B" ljust "1 K" ljust,2)
328 line down_ del then left_ Here.x - IOH.P9.end.x + del*2.5
329 continue to (Here,ZU4.Pin2); dot
330
331 line right_ del from U3.Pin8.end; dot
332 { line right_ 3*del; dot(,,1); "TX" at last [].e ljust }
333 line to (Here,RN4B.start)
334 RN4A: resistor(down_ dimen_,,E); rlabel(8,"RN4A" rjust "1 K" rjust,1)
335 line to (IOH.P9.end,Here)-(del*3.5,0); continue to (Here,ZU4.Pin3); dot
336
337 Pwr: [
338 Vin: line right 2*del "VIN" above
339 RN1A: resistor(down_ dimen_*5/4,,E); rlabel(8, "RN1A" rjust "10 K" rjust ,1)
340 CMP: dot
341 RN1B: resistor(down_ dimen_*5/4,,E); rlabel(2, "RN1B" rjust "10 K" rjust ,7)
342 B12: ground(,T,E); "GND" at last line below
343
344 line right_ 2*del from CMP; dot
345 { line up_ 2*del; dot(,,1); "CMP" at last [].n above }
346 line right_ del
347 POA: opamp(,"+" ljust,"-" ljust) with .In1 at Here
348 "U5A" at last [].n; "1" at POA.Out above rjust
349 "3" at POA.In1 rjust above; "2" at POA.In2 rjust above
350 line left_ del from POA.In2 then down_ del; "+3V3" below
351 dot(at POA.Out); {line up_ 2*del; dot(,,1); "GATE" at last [].n above }
352 T1: mosfet(down_ dimen_*1.5,R,dMdPyEDSQdB,) with .G at Here
353 "T1" at T1 + (-dimen_/4,del*5/4)
354 "FDN340P" at T1 + (0,-del*5/4) rjust
355 dot(at T1.S); { line up_ 2*del; ground(,T,E,U); "+5 V" at last line above }
356 ] with .RN1B at (USB.e.x+del,RN1C.y-2*del)
357 dot(at XUSB+(0,-del/2))
358 F1: fuse(right_ to (Pwr.T1.D,Here)); { "500 mA" ljust }
359 { "MF-MSMF050-2" at last [].sw below ljust }
360 line to Pwr.T1.D
361
362 line from Pwr.T1.S right_ 2.5*lg_pinsep
363 { U2:box ht 3*lg_pinsep wid 5*lg_pinsep with .nw at Here+(0,lg_pinsep/2) }
364 {"1" above rjust}; {"IN" ljust}
365 "LP2985-33DBVR" at U2.s below
366 "U2" above ljust at U2.nw
367 "3" above rjust at U2.w; line left del from U2.w then up_ lg_pinsep; dot
368 "ON/$\overline{\hbox{OFF}}$" at U2.w ljust
369 U2P2: U2.w+(0,-lg_pinsep); "2" at U2P2 above rjust; "GND" at U2P2 ljust
370 line from U2P2 left del then down_ del
371 G15: ground(,T,E); "GND" at last line.c below
372 U2P5: (U2.e.x,U2.e.y+lg_pinsep)
373 "OUT" at U2P5 rjust; "5" at U2P5 above ljust
374 line from U2P5 right 2*del "+3V3" below; dot
375 { line up_ del; dot(,,1); "3V3" at last [].n above }
376 C3: capacitor(down_ to(Here,G15)); rlabel(,"C3" rjust "1$`\,'\mu$" rjust)
377 ground(,T,E); "GND" at last line.c below
378 "NC/FB" at (U2.e.x,U2P2.y) rjust
379
380 "SCK" above ljust at Pwr.Vin + (0,4*del)
381 line right_ 3*del
382 U5B: opamp(,"+" ljust, "-" ljust) with .In1 at Here
383 "5" at U5B.In1 above rjust; "6" at U5B.In2 above rjust
384 "U5B" at last [].n; "7" at U5B.Out above rjust
385 line from U5B.In2 left del then down del then right U5B.Out.x-U5B.In1.x+del
386 TD2: dot
387 dot(at U5B.Out); dot(at Here+(0,2*del),,1); "LCMD" at last [].e ljust
388 line down_ from last [].s to TD2
389 RN2A: resistor(right_ dimen_*5/4,,E); llabel(8,"1K",1); rlabel(,"RN2A")
390 dot; {line up_ 2*del; dot(,,1); "LL" at last [].n above }
391 diode(right_ dimen_*5/4,LE); rlabel(,"YELLOW")
392 line down_ dimen_/4; egnd
393
394 X1:box ht 3*lg_pinsep wid 5*lg_pinsep with .w at (U2.x,U5B.y+del)
395 "X1 DC21MMX" at X1.nw below ljust "PWR SUPPLY" at X1.nw ljust
396 X1P1: 1/3 between X1.sw and X1.se; "1" at X1P1 rjust below
397 X1P2: 2/3 between X1.sw and X1.se; "2" at X1P2 rjust below
398 line down_ del from X1P1; dot; { egnd }
399 line right X1.e.x+del - Here.x then up_ X1.e.y-Here.y then to X1.e
400 "3" above ljust at X1.e
401 line from X1P2 down del/2 then right X1.e.x+del*2 - X1P2.x \
402 then up X1.n.y - X1P2.y + del/2; dot
403 { line up_ 2*del; PWRIN: dot(,,1); "PWRIN" at last [].w rjust }
404 D1: diode(right_ dimen_); llabel(,"D1"); rlabel(,"M7"); dot
405 { PC1: capacitor(down_ dimen_,C); llabel(,"PC1" ljust "47$`\,'\mu$" ljust)
406 G16: egnd }
407 { line to (Here,PWRIN); dot(,,1); "VIN" at last [].e ljust }
408 line right 3*del; { "3" above rjust }
409 U1P1: Here
410 U1: box ht 3*lg_pinsep wid 4*lg_pinsep with .nw at Here+(0,lg_pinsep/2)
411 "IN" at U1P1 ljust; "OUT" at (U1.e,U1P1) rjust
412 "1" below rjust at U1.s
413 "U1" at U1.nw + (0,textht*1.5) above ljust "NCP1117ST50T3G" ljust
414 line from U1.s to (U1.s,G16); egnd
415 U1P4: (U1.e,U1P1); U1P2: U1P4+(0,-del)
416 { "4" at U1P4 above ljust }; { "2" at U1P2 above ljust };
417 line right_ 2*del from U1P4; dot;
418 line from U1P2 to (Here,U1P2); dot; { line to (Here,U1P4) }
419 { PC2: capacitor(down_ to (Here,G16),C)
420 llabel(,"PC2" ljust "47$`\,'\mu$" ljust); egnd }
421 line right_ del*3/2 from (Here,U1P4); dot
422 { line to (Here,PWRIN); ground(,T,E,U); "+5V" at last line.c above }
423 line right_ del*3/2; dot; { line to (Here,PC2.start)
424 C2: capacitor(down_ to (Here,G16),C)
425 llabel(,"C2" ljust "100$`\,'\mu$" ljust); egnd }
426 { line to (Here,PWRIN); dot(,,1); "5V" at last [].n above }
427 line right_ del*3/2 then to (Here.x+del*3/2,PWRIN.y); dot(,,1)
428 "5V1" at last [].n above
429
430 ] scaled finalscale
431 #howbox_
432
433
434 ifpostscript(,latexcommand(}%))
435 .PE