Subversion Repositories svn.mios32

Compare Revisions

Ignore whitespace Rev 1339 → Rev 1340

/trunk/apps/examples/cv_autotune/schematics/comparator_circuit.pdf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/apps/examples/cv_autotune/schematics/comparator_circuit.ps
File deleted
/trunk/apps/examples/cv_autotune/schematics/comparator_circuit_lpc17.ps
New file
0,0 → 1,350
%!PS-Adobe-3.0
%%Title: comparator_circuit_lpc17
%%Creator: XCircuit v3.6 rev144
%%CreationDate: Mon Oct 3 19:33:17 2011
%%Pages: 1
%%BoundingBox: 0 0 612 792
%%DocumentNeededResources: font Helvetica Times-Roman Courier
%%EndComments
%%BeginProlog
%
% PostScript prolog for output from xcircuit
% Version: 3.3
%
% Electrical circuit (and otherwise general) drawing program
%
% Written by Tim Edwards 8/5/93--7/13/05 (tim.edwards@multigig.com)
% The Johns Hopkins University (1993-2004)
% MultiGiG, Inc. (2004-present)
%
%%BeginResource: procset XCIRCproc 3.3 0
%
% supporting definitions --- these are the primary xcircuit types.
 
/XCIRCsave save def
/topmat matrix currentmatrix def
 
/fontslant { /slant exch def [1 0 slant 1 0 0]
exch findfont exch makefont dup length dict /ndict exch def
{ 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall
ndict definefont pop} def
/ul { dup type /stringtype eq showflag 1 eq and { gsave
currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_)
false charpath flattenpath pathbbox grestore exch pop 1 index
sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0
rlineto stroke moveto } if } def
/ol { dup type /stringtype eq showflag 1 eq and { gsave gsave
currentpoint topmat setmatrix 2 index stringwidth pop 3 index
true charpath flattenpath pathbbox grestore exch pop
exch pop topmat setmatrix (_) true charpath pathbbox grestore
exch pop 1 index sub setlinewidth exch pop currentpoint
exch 4 1 roll exch sub add moveto pop 0 rlineto stroke
moveto } if } def
/stW { gsave currentpoint newpath moveto true charpath flattenpath
pathbbox pop exch pop sub grestore } def
/Ts {mark Tabs aload pop counttomark 1 add array astore /Tabs exch def Tabs
0 currentpoint pop put} def
/Tbn {mark Tabs aload pop counttomark dup 2 add 1 roll cleartomark 1 sub} def
/Tb { 0 1 Tbn {Tabs exch get dup currentpoint pop lt
{currentpoint exch pop moveto exit} {pop} ifelse } for } def
/Tf { Tbn -1 0 {Tabs exch get dup currentpoint pop gt
{currentpoint exch pop moveto exit} {pop} ifelse } for } def
/qS { (aa) stW (a a) stW sub 4 div 0 Kn } def
/hS { qS qS } def
/pspc 0 def
/cf0 { scalefont setfont } bind def
/Kn { dup kY add /kY exch def rmoveto } bind def
/ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul
0.33 mul neg Kn} def
/Ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul
0.67 mul Kn } def
/ns { 0 kY neg Kn /kY 0 def /fscale 1.0 def xfont0 1.0 cf0 } def
/CR { ns 0 /Bline Bline fscale0 neg add def Bline moveto } def
/cf { dup type /realtype ne {1.0} if exch findfont exch kY 0 eq
{ 40 mul dup /fscale0 exch def cf0 /xfont0 currentfont def}
{fscale0 mul fscale mul cf0} ifelse } def
/ctmk { counttomark dup 2 add -1 roll pop } bind def
/label { gsave translate 0 0 moveto dup scale neg /rotval exch def
/just exch def just 384 and 0 gt {/mshow {pop} def} {/mshow {show}
def} ifelse just 16 and 0 gt {gsave rotval rotate 0 1 dtransform
gsave pagemat setmatrix idtransform exch grestore 1 0 dtransform
gsave pagemat setmatrix idtransform exch grestore dup abs 1e-9 lt
{pop mul 0 gt} {3 1 roll pop pop 0 lt} ifelse grestore {-1 /rotval
rotval neg def /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse
exch -1e-9 lt {-1 /rotval rotval neg def /just just dup 12 and
4 ne {12 xor} if def} {1} ifelse scale } if /showflag 0 def
/fspc pspc def /Bline 0 def /Tabs 0 array def /fscale 1.0 def
/kY 0 def gsave dup 1 add copy 0 exch 1 0 dtransform exch atan rotate
{exch dup type /stringtype eq {true charpath flattenpath} {dup type
/arraytype eq {exec} {12 string cvs true charpath flattenpath} ifelse}
ifelse} repeat pop pathbbox grestore 3 -1 roll pop 3 1 roll just
1 and 0 gt {just 2 and 0 gt {exch pop neg fspc sub} {exch sub 0.5
mul neg} ifelse} {pop neg fspc add} ifelse exch Bline exch just 4
and 0 gt {just 8 and 0 gt {exch pop neg fspc sub} {add 0.5 mul neg}
ifelse} {pop neg fspc add} ifelse rotval rotate Kn currentpoint
translate /showflag 1 def /Bline 0 def /Tabs 0 array def /fscale
1.0 def /kY 0 def {dup type /stringtype eq {mshow} {dup type
/arraytype eq {exec} {12 string cvs mshow} ifelse} ifelse} repeat
grestore } def
/pinlabel { 4 index 32 and 0 ne hlevel 0 eq or { /pspc 10 def label
/pspc 0 def } { pop pop pop pop pop {pop} repeat } ifelse } def
/pinglobal { pinlabel } def
/infolabel { pinlabel } def
/graphic { gsave 4 index cvx exec /DataSource get resetfile translate
0 0 moveto neg rotate dup scale cvx exec image grestore } def
 
/scb { setrgbcolor } bind def /sce { defColor aload pop scb } bind def
/cRedef {/defColor currentcolor 3 array astore def} def
/begingate {dup type /dicttype ne {1 dict} if begin % default params
dup type /dicttype ne {1 dict} if begin % instanced params
/hlevel hlevel 1 add def /defColor currentcolor sce 3 array
astore def gsave sce translate 0 0 moveto neg rotate dup abs scale
} bind def
/endgate { /hlevel hlevel 1 sub def grestore defColor aload pop cRedef
scb end end} bind def
 
/hlevel 0 def
/tmpa [1 0 0 1 0 0] def
/gar {8 8 true tmpa {<c0 c0 00 00 0c 0c 00 00>} imagemask} bind
{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind
{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind
{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind
{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind
{8 8 true tmpa {<df cf 8f 9f fd fc f8 f9>} imagemask} bind
{8 8 true tmpa {<ff 3f 3f ff ff f3 f3 ff>} imagemask} bind 7 array astore def
/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll
neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy
gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll
{ 3 index exch 5 exch put dup -8 3 index { 3 index
exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def
/setstyles {
currentlinewidth mul setlinewidth /style exch def
style 1 and 0 gt not {closepath} if
style 1024 and 0 gt {2 setlinecap} if
style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if
style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if
gsave style 16 and 0 gt { style 224 and -5 bitshift style 256 and 0 gt {
7 exch sub 8 div dup 1 exch sub currentrgbcolor 3 array astore
{3 copy mul add 4 1 roll pop} forall pop pop setrgbcolor eofill}
{dup 7 lt {gar exch get ppaint} {pop eofill} ifelse} ifelse}
{style 256 and 0 gt {1 setgray eofill} if} ifelse grestore style 8 and 0 gt
style 512 eq or {newpath} {stroke} ifelse grestore} def
 
/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def
/xcarc { gsave newpath arc setstyles } def
/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll
3 index div 1 scale } def
/ele { 0 4 1 roll 0 4 1 roll } bind def
/ellipse { gsave elb newpath ele arc setmatrix setstyles } def
/pellip { elb ele arc setmatrix } def
/nellip { elb ele arcn setmatrix } def
/spline { gsave moveto curveto setstyles } def
/polyc { {lineto} repeat } bind def
/beginpath { gsave moveto } bind def
/endpath { setstyles } bind def
/bop { 1 setlinecap 0 setlinejoin 6 setmiterlimit 0 0 0 scb cRedef } def
/psinsertion {/PSobj save def /showpage {} def /setpagedevice {pop} def bop
rotate translate dup scale} def
/end_insert {PSobj restore} def
/setpagemat {/pagemat matrix currentmatrix def} def
/inchscale {setpagemat 0.375 mul dup scale} def
/cmscale {setpagemat 0.35433071 mul dup scale} def
 
%%EndResource
%%EndProlog
 
% XCircuit output starts here.
 
%%BeginSetup
 
/analog::resistor {
begingate
1 1.000 0 64 0 36 2 polygon
1 1.000 0 -64 0 -36 2 polygon
1 1.000 0 -36 14 -30 -14 -18 14 -6 -14 6 14 18 -14 30 0 36 8 polygon
1.000 0.000 0.000 scb
(r.1) {/Times-Roman cf} 2 9 0 1.000 0 64 pinlabel
(r.2) {/Times-Roman cf} 2 13 0 1.000 0 -64 pinlabel
0.180 0.545 0.341 scb
(spice:R%i %pr.1 %pr.2 1.0K) {/Times-Roman cf} 2 0 0 1.000 -208 -160 infolabel
(sim:r %pr.1 %pr.2) {/Times-Roman cf} 2 0 0 1.000 -208 -208 infolabel
endgate
} def
 
/generic::dot {
% trivial
begingate
248 1.000 0 0 6 0.000 360.000 xcarc
1.000 0.000 0.000 scb
(x) {/Times-Roman cf} 2 29 0 1.000 0 0 pinlabel
endgate
} def
 
/generic::circle {
% trivial
begingate
1 1.000 16 0 6 0.000 360.000 xcarc
1 1.000 0 0 10 0 2 polygon
1.000 0.000 0.000 scb
(out) {/Times-Roman cf} 2 4 0 1.000 16 0 pinlabel
(out) {/Times-Roman cf} 2 7 0 1.000 0 0 pinlabel
endgate
} def
 
/analog::gnd {
% trivial
begingate
1 1.000 0 0 0 -32 2 polygon
1 1.000 -32 -32 32 -32 2 polygon
1 1.000 -18 -46 18 -46 2 polygon
1 1.000 -4 -60 4 -60 2 polygon
0.933 0.604 0.000 scb
(GND) {/Times-Roman cf} 2 1 0 1.000 0 0 pinglobal
endgate
} def
 
 
%%EndSetup
 
%%Page: 1 1
%%PageOrientation: Landscape
%%PageBoundingBox: 0 0 612 792
/pgsave save def bop
% 32.00 8.00 gridspace
90 rotate -21 -590 translate
1.3846 inchscale
2.6000 setlinewidth 1288 320 translate
 
0 3.000 96 352 96 -144 -96 -144 -96 352 4 polygon
0 1.000 -112 256 -112 224 -96 224 -96 256 4 polygon
0 1.000 -112 192 -112 160 -96 160 -96 192 4 polygon
0 1.000 -112 128 -112 96 -96 96 -96 128 4 polygon
0 1.000 96 256 96 224 112 224 112 256 4 polygon
0 1.000 96 192 96 160 112 160 112 192 4 polygon
0 1.000 96 128 96 96 112 96 112 128 4 polygon
0 1.000 -32 352 -32 320 32 320 32 352 4 polygon
(IC1 LM339) {/Courier cf} 2 16 90 1.000 -6 216 label
(I3-) {/Courier cf} 2 23 0 0.750 88 -80 label
(GND) {/Courier cf} 2 23 0 0.750 88 176 label
(O4) {/Courier cf} 2 23 0 0.750 88 240 label
(I1-) {/Courier cf} 2 20 0 0.750 -88 112 label
(Vcc) {/Courier cf} 2 20 0 0.750 -88 176 label
(O1) {/Courier cf} 2 20 0 0.750 -88 240 label
0 1.000 -112 64 -112 32 -96 32 -96 64 4 polygon
0 1.000 -112 0 -112 -32 -96 -32 -96 0 4 polygon
0 1.000 -112 -64 -112 -96 -96 -96 -96 -64 4 polygon
0 1.000 96 -64 96 -96 112 -96 112 -64 4 polygon
0 1.000 96 0 96 -32 112 -32 112 0 4 polygon
0 1.000 96 64 96 32 112 32 112 64 4 polygon
(I3+) {/Courier cf} 2 23 0 0.750 88 -16 label
(I4-) {/Courier cf} 2 23 0 0.750 88 48 label
(I4+) {/Courier cf} 2 23 0 0.750 88 112 label
(I2-) {/Courier cf} 2 20 0 0.750 -88 -16 label
(I1+) {/Courier cf} 2 20 0 0.750 -88 48 label
0 1.000 96 320 96 288 112 288 112 320 4 polygon
0 1.000 -112 320 -112 288 -96 288 -96 320 4 polygon
(O3) {/Courier cf} 2 23 0 0.750 88 304 label
(O2) {/Courier cf} 2 20 0 0.750 -88 304 label
(8) {/Courier cf} 2 20 0 0.500 128 -64 label
(9) {/Courier cf} 2 20 0 0.500 128 0 label
(10) {/Courier cf} 2 20 0 0.500 128 64 label
(11) {/Courier cf} 2 20 0 0.500 128 128 label
(12) {/Courier cf} 2 20 0 0.500 128 192 label
(13) {/Courier cf} 2 20 0 0.500 128 256 label
(7) {/Courier cf} 2 23 0 0.500 -128 -64 label
(6) {/Courier cf} 2 23 0 0.500 -128 0 label
(5) {/Courier cf} 2 23 0 0.500 -128 64 label
(4) {/Courier cf} 2 23 0 0.500 -128 128 label
(3) {/Courier cf} 2 23 0 0.500 -128 192 label
(2) {/Courier cf} 2 23 0 0.500 -128 256 label
(1) {/Courier cf} 2 23 0 0.500 -128 320 label
(14) {/Courier cf} 2 20 0 0.500 128 320 label
(I2+) {/Courier cf} 2 20 0 0.750 -88 -80 label
1 1.000 112 176 160 176 2 polygon
1 1.000 -112 112 -352 112 2 polygon
1.000 0 -352 40 analog::resistor
(22k) {/Courier cf} 2 23 0 0.750 -272 8 label
1.000 0 -352 184 analog::resistor
(47k) {/Courier cf} 2 23 0 0.750 -272 152 label
1 1.000 -352 136 -352 96 2 polygon
1 1.000 -352 248 -352 288 2 polygon
1 1.000 -360 288 -344 288 -352 304 -360 288 4 polygon
1 1.000 -352 -64 -352 -24 2 polygon
1.000 0.000 0.000 scb
(+12V) {/Courier cf} 2 23 0 0.750 -320 320 label
sce
1.000 0 -352 112 generic::dot
(R1) {/Courier cf} 2 21 0 0.750 -392 224 label
(R2) {/Courier cf} 2 21 0 0.750 -392 72 label
1 1.000 -112 48 -224 48 -224 -192 -480 -192 4 polygon
1.000 180 -480 -192 generic::circle
1.000 0.000 0.000 scb
(WAVE) {/Courier cf} 2 23 0 0.750 -512 -176 label
(IN) {/Courier cf} 2 23 0 0.750 -512 -208 label
0.600 0.600 0.600 scb
1.000 0 -696 448 analog::resistor
(1k) {/Courier cf} 2 23 0 0.750 -648 432 label
sce
0.500 0 -352 -48 analog::gnd
0.500 0 160 176 analog::gnd
0.600 0.600 0.600 scb
1.000 0 -696 384 generic::dot
1.000 0.000 0.000 scb
(DIG) {/Courier cf} 2 20 0 0.750 -576 360 label
(OUT) {/Courier cf} 2 20 0 0.750 -576 328 label
sce
1 1.000 112 112 160 112 2 polygon
0.500 0 160 112 analog::gnd
1 1.000 112 48 160 48 2 polygon
0.500 0 160 48 analog::gnd
1 1.000 112 -16 160 -16 2 polygon
0.500 0 160 -16 analog::gnd
1 1.000 112 -80 160 -80 2 polygon
0.500 0 160 -80 analog::gnd
1 1.000 -160 -80 -112 -80 2 polygon
1 1.000 -160 -16 -112 -16 2 polygon
0.500 0 -160 -80 analog::gnd
0.500 0 -160 -16 analog::gnd
1.000 0.000 0.000 scb
(Compare Level in this case:) {/Courier cf} 2 20 0 0.750 -560 504 label
(12V * \(R2 / \(R1+R2\)\) = 3.8V) {/Courier cf} 2 20 0 0.750 -560 472 label
(Supply Voltage can also be +5V) {/Courier cf} 2 20 0 0.750 -552 592 label
(instead of +12V) {/Courier cf} 2 20 0 0.750 -552 560 label
sce
1 1.000 -784 384 11 0.000 360.000 xcarc
1 1.000 -784 320 11 0.000 360.000 xcarc
0 2.000 -824 416 -824 272 -752 272 -752 416 4 polygon
0.000 0.000 1.000 scb
(CAN) {/Courier cf} 2 23 0 0.500 -784 368 label
(Vs) {/Courier cf} 2 23 0 0.500 -784 304 label
0.933 0.604 0.000 scb
3 3.000 -624 672 -624 -128 2 polygon
(MBHP_CORE_LPC17) {/Helvetica cf} 2 16 0 1.000 -1120 568 label
sce
1.000 180 -480 384 generic::circle
0.000 0.000 0.000 scb
1 1.000 -488 384 -224 384 -224 240 -112 240 4 polygon
1 1.000 -496 384 -784 384 2 polygon
1 1.000 -784 320 -784 -24 2 polygon
1 1.000 -784 -24 -352 -24 2 polygon
sce
1.000 0 -352 -24 generic::dot
0.000 0.000 0.000 scb
1 1.000 -112 176 -256 176 -256 256 -352 256 4 polygon
sce
1.000 0 -352 256 generic::dot
0.600 0.600 0.600 scb
1 1.000 -696 488 -696 528 2 polygon
1 1.000 -704 528 -688 528 -696 544 -704 528 4 polygon
(Vdd) {/Courier cf} 2 23 0 0.750 -664 560 label
1.000 0.000 0.000 scb
(Pull-Up already part of) {/Courier cf} 2 20 0 0.750 -1144 528 label
(Core Module!) {/Courier cf} 2 20 0 0.750 -944 496 label
(DIG OUT requires Pull-Up!!!) {/Courier cf} 2 20 0 0.750 -560 416 label
0.000 0.000 0.000 scb
(J18) {/Courier cf} 2 23 0 0.750 -760 440 label
pgsave restore showpage
 
%%Trailer
XCIRCsave restore
%%EOF
/trunk/apps/examples/cv_autotune/schematics/comparator_circuit_stm32.ps
New file
0,0 → 1,374
%!PS-Adobe-3.0
%%Title: comparator_circuit_stm32
%%Creator: XCircuit v3.6 rev144
%%CreationDate: Mon Oct 3 19:33:11 2011
%%Pages: 1
%%BoundingBox: 0 0 612 792
%%DocumentNeededResources: font Helvetica Times-Roman Courier
%%EndComments
%%BeginProlog
%
% PostScript prolog for output from xcircuit
% Version: 3.3
%
% Electrical circuit (and otherwise general) drawing program
%
% Written by Tim Edwards 8/5/93--7/13/05 (tim.edwards@multigig.com)
% The Johns Hopkins University (1993-2004)
% MultiGiG, Inc. (2004-present)
%
%%BeginResource: procset XCIRCproc 3.3 0
%
% supporting definitions --- these are the primary xcircuit types.
 
/XCIRCsave save def
/topmat matrix currentmatrix def
 
/fontslant { /slant exch def [1 0 slant 1 0 0]
exch findfont exch makefont dup length dict /ndict exch def
{ 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall
ndict definefont pop} def
/ul { dup type /stringtype eq showflag 1 eq and { gsave
currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_)
false charpath flattenpath pathbbox grestore exch pop 1 index
sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0
rlineto stroke moveto } if } def
/ol { dup type /stringtype eq showflag 1 eq and { gsave gsave
currentpoint topmat setmatrix 2 index stringwidth pop 3 index
true charpath flattenpath pathbbox grestore exch pop
exch pop topmat setmatrix (_) true charpath pathbbox grestore
exch pop 1 index sub setlinewidth exch pop currentpoint
exch 4 1 roll exch sub add moveto pop 0 rlineto stroke
moveto } if } def
/stW { gsave currentpoint newpath moveto true charpath flattenpath
pathbbox pop exch pop sub grestore } def
/Ts {mark Tabs aload pop counttomark 1 add array astore /Tabs exch def Tabs
0 currentpoint pop put} def
/Tbn {mark Tabs aload pop counttomark dup 2 add 1 roll cleartomark 1 sub} def
/Tb { 0 1 Tbn {Tabs exch get dup currentpoint pop lt
{currentpoint exch pop moveto exit} {pop} ifelse } for } def
/Tf { Tbn -1 0 {Tabs exch get dup currentpoint pop gt
{currentpoint exch pop moveto exit} {pop} ifelse } for } def
/qS { (aa) stW (a a) stW sub 4 div 0 Kn } def
/hS { qS qS } def
/pspc 0 def
/cf0 { scalefont setfont } bind def
/Kn { dup kY add /kY exch def rmoveto } bind def
/ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul
0.33 mul neg Kn} def
/Ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul
0.67 mul Kn } def
/ns { 0 kY neg Kn /kY 0 def /fscale 1.0 def xfont0 1.0 cf0 } def
/CR { ns 0 /Bline Bline fscale0 neg add def Bline moveto } def
/cf { dup type /realtype ne {1.0} if exch findfont exch kY 0 eq
{ 40 mul dup /fscale0 exch def cf0 /xfont0 currentfont def}
{fscale0 mul fscale mul cf0} ifelse } def
/ctmk { counttomark dup 2 add -1 roll pop } bind def
/label { gsave translate 0 0 moveto dup scale neg /rotval exch def
/just exch def just 384 and 0 gt {/mshow {pop} def} {/mshow {show}
def} ifelse just 16 and 0 gt {gsave rotval rotate 0 1 dtransform
gsave pagemat setmatrix idtransform exch grestore 1 0 dtransform
gsave pagemat setmatrix idtransform exch grestore dup abs 1e-9 lt
{pop mul 0 gt} {3 1 roll pop pop 0 lt} ifelse grestore {-1 /rotval
rotval neg def /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse
exch -1e-9 lt {-1 /rotval rotval neg def /just just dup 12 and
4 ne {12 xor} if def} {1} ifelse scale } if /showflag 0 def
/fspc pspc def /Bline 0 def /Tabs 0 array def /fscale 1.0 def
/kY 0 def gsave dup 1 add copy 0 exch 1 0 dtransform exch atan rotate
{exch dup type /stringtype eq {true charpath flattenpath} {dup type
/arraytype eq {exec} {12 string cvs true charpath flattenpath} ifelse}
ifelse} repeat pop pathbbox grestore 3 -1 roll pop 3 1 roll just
1 and 0 gt {just 2 and 0 gt {exch pop neg fspc sub} {exch sub 0.5
mul neg} ifelse} {pop neg fspc add} ifelse exch Bline exch just 4
and 0 gt {just 8 and 0 gt {exch pop neg fspc sub} {add 0.5 mul neg}
ifelse} {pop neg fspc add} ifelse rotval rotate Kn currentpoint
translate /showflag 1 def /Bline 0 def /Tabs 0 array def /fscale
1.0 def /kY 0 def {dup type /stringtype eq {mshow} {dup type
/arraytype eq {exec} {12 string cvs mshow} ifelse} ifelse} repeat
grestore } def
/pinlabel { 4 index 32 and 0 ne hlevel 0 eq or { /pspc 10 def label
/pspc 0 def } { pop pop pop pop pop {pop} repeat } ifelse } def
/pinglobal { pinlabel } def
/infolabel { pinlabel } def
/graphic { gsave 4 index cvx exec /DataSource get resetfile translate
0 0 moveto neg rotate dup scale cvx exec image grestore } def
 
/scb { setrgbcolor } bind def /sce { defColor aload pop scb } bind def
/cRedef {/defColor currentcolor 3 array astore def} def
/begingate {dup type /dicttype ne {1 dict} if begin % default params
dup type /dicttype ne {1 dict} if begin % instanced params
/hlevel hlevel 1 add def /defColor currentcolor sce 3 array
astore def gsave sce translate 0 0 moveto neg rotate dup abs scale
} bind def
/endgate { /hlevel hlevel 1 sub def grestore defColor aload pop cRedef
scb end end} bind def
 
/hlevel 0 def
/tmpa [1 0 0 1 0 0] def
/gar {8 8 true tmpa {<c0 c0 00 00 0c 0c 00 00>} imagemask} bind
{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind
{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind
{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind
{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind
{8 8 true tmpa {<df cf 8f 9f fd fc f8 f9>} imagemask} bind
{8 8 true tmpa {<ff 3f 3f ff ff f3 f3 ff>} imagemask} bind 7 array astore def
/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll
neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy
gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll
{ 3 index exch 5 exch put dup -8 3 index { 3 index
exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def
/setstyles {
currentlinewidth mul setlinewidth /style exch def
style 1 and 0 gt not {closepath} if
style 1024 and 0 gt {2 setlinecap} if
style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if
style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if
gsave style 16 and 0 gt { style 224 and -5 bitshift style 256 and 0 gt {
7 exch sub 8 div dup 1 exch sub currentrgbcolor 3 array astore
{3 copy mul add 4 1 roll pop} forall pop pop setrgbcolor eofill}
{dup 7 lt {gar exch get ppaint} {pop eofill} ifelse} ifelse}
{style 256 and 0 gt {1 setgray eofill} if} ifelse grestore style 8 and 0 gt
style 512 eq or {newpath} {stroke} ifelse grestore} def
 
/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def
/xcarc { gsave newpath arc setstyles } def
/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll
3 index div 1 scale } def
/ele { 0 4 1 roll 0 4 1 roll } bind def
/ellipse { gsave elb newpath ele arc setmatrix setstyles } def
/pellip { elb ele arc setmatrix } def
/nellip { elb ele arcn setmatrix } def
/spline { gsave moveto curveto setstyles } def
/polyc { {lineto} repeat } bind def
/beginpath { gsave moveto } bind def
/endpath { setstyles } bind def
/bop { 1 setlinecap 0 setlinejoin 6 setmiterlimit 0 0 0 scb cRedef } def
/psinsertion {/PSobj save def /showpage {} def /setpagedevice {pop} def bop
rotate translate dup scale} def
/end_insert {PSobj restore} def
/setpagemat {/pagemat matrix currentmatrix def} def
/inchscale {setpagemat 0.375 mul dup scale} def
/cmscale {setpagemat 0.35433071 mul dup scale} def
 
%%EndResource
%%EndProlog
 
% XCircuit output starts here.
 
%%BeginSetup
 
/analog::resistor {
begingate
1 1.000 0 64 0 36 2 polygon
1 1.000 0 -64 0 -36 2 polygon
1 1.000 0 -36 14 -30 -14 -18 14 -6 -14 6 14 18 -14 30 0 36 8 polygon
1.000 0.000 0.000 scb
(r.1) {/Times-Roman cf} 2 9 0 1.000 0 64 pinlabel
(r.2) {/Times-Roman cf} 2 13 0 1.000 0 -64 pinlabel
0.180 0.545 0.341 scb
(spice:R%i %pr.1 %pr.2 1.0K) {/Times-Roman cf} 2 0 0 1.000 -208 -160 infolabel
(sim:r %pr.1 %pr.2) {/Times-Roman cf} 2 0 0 1.000 -208 -208 infolabel
endgate
} def
 
/generic::dot {
% trivial
begingate
248 1.000 0 0 6 0.000 360.000 xcarc
1.000 0.000 0.000 scb
(x) {/Times-Roman cf} 2 29 0 1.000 0 0 pinlabel
endgate
} def
 
/generic::circle {
% trivial
begingate
1 1.000 16 0 6 0.000 360.000 xcarc
1 1.000 0 0 10 0 2 polygon
1.000 0.000 0.000 scb
(out) {/Times-Roman cf} 2 4 0 1.000 16 0 pinlabel
(out) {/Times-Roman cf} 2 7 0 1.000 0 0 pinlabel
endgate
} def
 
/analog::gnd {
% trivial
begingate
1 1.000 0 0 0 -32 2 polygon
1 1.000 -32 -32 32 -32 2 polygon
1 1.000 -18 -46 18 -46 2 polygon
1 1.000 -4 -60 4 -60 2 polygon
0.933 0.604 0.000 scb
(GND) {/Times-Roman cf} 2 1 0 1.000 0 0 pinglobal
endgate
} def
 
 
%%EndSetup
 
%%Page: 1 1
%%PageOrientation: Landscape
%%PageBoundingBox: 0 0 612 792
/pgsave save def bop
% 32.00 8.00 gridspace
90 rotate -2 -608 translate
1.3846 inchscale
2.6000 setlinewidth 1216 356 translate
 
0 3.000 96 352 96 -144 -96 -144 -96 352 4 polygon
0 1.000 -112 256 -112 224 -96 224 -96 256 4 polygon
0 1.000 -112 192 -112 160 -96 160 -96 192 4 polygon
0 1.000 -112 128 -112 96 -96 96 -96 128 4 polygon
0 1.000 96 256 96 224 112 224 112 256 4 polygon
0 1.000 96 192 96 160 112 160 112 192 4 polygon
0 1.000 96 128 96 96 112 96 112 128 4 polygon
0 1.000 -32 352 -32 320 32 320 32 352 4 polygon
(IC1 LM339) {/Courier cf} 2 16 90 1.000 -6 216 label
(I3-) {/Courier cf} 2 23 0 0.750 88 -80 label
(GND) {/Courier cf} 2 23 0 0.750 88 176 label
(O4) {/Courier cf} 2 23 0 0.750 88 240 label
(I1-) {/Courier cf} 2 20 0 0.750 -88 112 label
(Vcc) {/Courier cf} 2 20 0 0.750 -88 176 label
(O1) {/Courier cf} 2 20 0 0.750 -88 240 label
0 1.000 -112 64 -112 32 -96 32 -96 64 4 polygon
0 1.000 -112 0 -112 -32 -96 -32 -96 0 4 polygon
0 1.000 -112 -64 -112 -96 -96 -96 -96 -64 4 polygon
0 1.000 96 -64 96 -96 112 -96 112 -64 4 polygon
0 1.000 96 0 96 -32 112 -32 112 0 4 polygon
0 1.000 96 64 96 32 112 32 112 64 4 polygon
(I3+) {/Courier cf} 2 23 0 0.750 88 -16 label
(I4-) {/Courier cf} 2 23 0 0.750 88 48 label
(I4+) {/Courier cf} 2 23 0 0.750 88 112 label
(I2-) {/Courier cf} 2 20 0 0.750 -88 -16 label
(I1+) {/Courier cf} 2 20 0 0.750 -88 48 label
0 1.000 96 320 96 288 112 288 112 320 4 polygon
0 1.000 -112 320 -112 288 -96 288 -96 320 4 polygon
(O3) {/Courier cf} 2 23 0 0.750 88 304 label
(O2) {/Courier cf} 2 20 0 0.750 -88 304 label
(8) {/Courier cf} 2 20 0 0.500 128 -64 label
(9) {/Courier cf} 2 20 0 0.500 128 0 label
(10) {/Courier cf} 2 20 0 0.500 128 64 label
(11) {/Courier cf} 2 20 0 0.500 128 128 label
(12) {/Courier cf} 2 20 0 0.500 128 192 label
(13) {/Courier cf} 2 20 0 0.500 128 256 label
(7) {/Courier cf} 2 23 0 0.500 -128 -64 label
(6) {/Courier cf} 2 23 0 0.500 -128 0 label
(5) {/Courier cf} 2 23 0 0.500 -128 64 label
(4) {/Courier cf} 2 23 0 0.500 -128 128 label
(3) {/Courier cf} 2 23 0 0.500 -128 192 label
(2) {/Courier cf} 2 23 0 0.500 -128 256 label
(1) {/Courier cf} 2 23 0 0.500 -128 320 label
(14) {/Courier cf} 2 20 0 0.500 128 320 label
(I2+) {/Courier cf} 2 20 0 0.750 -88 -80 label
1 1.000 112 176 160 176 2 polygon
1 1.000 -112 112 -352 112 2 polygon
1.000 0 -352 40 analog::resistor
(22k) {/Courier cf} 2 23 0 0.750 -272 8 label
1.000 0 -352 184 analog::resistor
(47k) {/Courier cf} 2 23 0 0.750 -272 152 label
1 1.000 -352 136 -352 96 2 polygon
1 1.000 -352 248 -352 288 2 polygon
1 1.000 -360 288 -344 288 -352 304 -360 288 4 polygon
1 1.000 -352 -64 -352 -24 2 polygon
1.000 0.000 0.000 scb
(+12V) {/Courier cf} 2 23 0 0.750 -320 320 label
sce
1.000 0 -352 112 generic::dot
(R1) {/Courier cf} 2 21 0 0.750 -392 224 label
(R2) {/Courier cf} 2 21 0 0.750 -392 72 label
1 1.000 -112 48 -224 48 -224 -192 -480 -192 4 polygon
1.000 180 -480 -192 generic::circle
1.000 0.000 0.000 scb
(WAVE) {/Courier cf} 2 23 0 0.750 -512 -176 label
(IN) {/Courier cf} 2 23 0 0.750 -512 -208 label
sce
1.000 0 -696 448 analog::resistor
(10k) {/Courier cf} 2 23 0 0.750 -640 400 label
(R3) {/Courier cf} 2 21 0 0.750 -720 496 label
0.500 0 -352 -48 analog::gnd
0.500 0 160 176 analog::gnd
1.000 0 -696 384 generic::dot
1.000 0.000 0.000 scb
(DIG) {/Courier cf} 2 20 0 0.750 -576 360 label
(OUT) {/Courier cf} 2 20 0 0.750 -576 328 label
sce
1 1.000 112 112 160 112 2 polygon
0.500 0 160 112 analog::gnd
1 1.000 112 48 160 48 2 polygon
0.500 0 160 48 analog::gnd
1 1.000 112 -16 160 -16 2 polygon
0.500 0 160 -16 analog::gnd
1 1.000 112 -80 160 -80 2 polygon
0.500 0 160 -80 analog::gnd
1 1.000 -160 -80 -112 -80 2 polygon
1 1.000 -160 -16 -112 -16 2 polygon
0.500 0 -160 -80 analog::gnd
0.500 0 -160 -16 analog::gnd
1.000 0.000 0.000 scb
(Compare Level in this case:) {/Courier cf} 2 20 0 0.750 -560 504 label
(12V * \(R2 / \(R1+R2\)\) = 3.8V) {/Courier cf} 2 20 0 0.750 -560 472 label
(Supply Voltage can also be +5V) {/Courier cf} 2 20 0 0.750 -552 592 label
(instead of +12V) {/Courier cf} 2 20 0 0.750 -552 560 label
sce
1 1.000 -784 384 11 0.000 360.000 xcarc
1 1.000 -784 320 11 0.000 360.000 xcarc
1 1.000 -784 256 11 0.000 360.000 xcarc
1 1.000 -784 192 11 0.000 360.000 xcarc
1 1.000 -784 448 11 0.000 360.000 xcarc
1 1.000 -832 448 11 0.000 360.000 xcarc
0 2.000 -864 480 -864 144 -752 144 -752 480 4 polygon
0.000 0.000 1.000 scb
(Vs) {/Courier cf} 2 23 0 0.500 -832 432 label
(Vd) {/Courier cf} 2 23 0 0.500 -784 432 label
(A4) {/Courier cf} 2 23 0 0.500 -784 368 label
(A5) {/Courier cf} 2 23 0 0.500 -784 304 label
(A6) {/Courier cf} 2 23 0 0.500 -784 240 label
(A7) {/Courier cf} 2 23 0 0.500 -784 176 label
sce
1 1.000 -832 384 11 0.000 360.000 xcarc
0.000 0.000 1.000 scb
(Vs) {/Courier cf} 2 23 0 0.500 -832 368 label
sce
1 1.000 -832 320 11 0.000 360.000 xcarc
0.000 0.000 1.000 scb
(Vs) {/Courier cf} 2 23 0 0.500 -832 304 label
sce
1 1.000 -832 256 11 0.000 360.000 xcarc
0.000 0.000 1.000 scb
(Vs) {/Courier cf} 2 23 0 0.500 -832 240 label
sce
1 1.000 -832 192 11 0.000 360.000 xcarc
0.000 0.000 1.000 scb
(Vs) {/Courier cf} 2 23 0 0.500 -832 176 label
sce
1 1.000 -832 448 -832 192 2 polygon
0.800 0.800 0.800 scb
0 2.000 -888 488 -888 135 -741 135 -741 488 4 polygon
0 2.000 -885 367 -885 271 -869 271 -869 367 4 polygon
0.933 0.604 0.000 scb
3 3.000 -624 672 -624 -128 2 polygon
(MBHP_CORE_STM32) {/Helvetica cf} 2 16 0 1.000 -1072 576 label
0.000 0.000 0.000 scb
1 1.000 -784 448 -784 512 -696 512 3 polygon
sce
1.000 180 -480 384 generic::circle
0.000 0.000 0.000 scb
1 1.000 -488 384 -224 384 -224 240 -112 240 4 polygon
1 1.000 -496 384 -784 384 2 polygon
1 1.000 -832 192 -832 -24 2 polygon
1 1.000 -832 -24 -352 -24 2 polygon
sce
1.000 0 -352 -24 generic::dot
0.000 0.000 0.000 scb
1 1.000 -112 176 -256 176 -256 256 -352 256 4 polygon
sce
1.000 0 -352 256 generic::dot
1.000 0.000 0.000 scb
(DIG OUT requires Pull-Up!!!) {/Courier cf} 2 20 0 0.750 -560 416 label
0.000 0.000 0.000 scb
(J5B) {/Courier cf} 2 23 0 0.750 -832 512 label
pgsave restore showpage
 
%%Trailer
XCIRCsave restore
%%EOF
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: cv_autotune/schematics/comparator_circuit_lpc17.pdf
===================================================================
--- cv_autotune/schematics/comparator_circuit_lpc17.pdf (revision 0)
+++ cv_autotune/schematics/comparator_circuit_lpc17.pdf (revision 1340)
@@ -0,0 +1,126 @@
+%PDF-1.4
+%Ç쏢
+5 0 obj
+<</Length 6 0 R/Filter /FlateDecode>>
+stream
+xœ­Y[sTÇ~?¿bx3VíñôÜÇUy°eŠàƒeY~)—²ZÉ. œò¿Ï×s?Úe‰b—VÓÓÓÓÝÓ÷ó^ș„ä¿ò»ÞM_yñúv2r61ZñŸÉ‰g‰ï§„'ÎOʐœ }œÉ e½µ1º9’¸ÙL?M¤ùxÄqeœ•6`[FAÎÍd‚z–>t +š³½ƒdÕ$ëõ>ƒT¯sÑÉ/¯3jyÝ©RjH庣HUNÍÆ5$­Õ¬¥ÍHYs7¯§÷åÿËÏz'¾=‡ÆƒPrö.ŠóWS~rh«…3fv |¾›¾xrJB<}¦u|xþ¯tŽ,äpžò¡Ÿ6ÏépàŝOêÁ†q2AZÏÊà«é‹Ç?|Ç{qŽÁxÖgIʦ­ç†wVP€¶Á‰SÔ¤ÒÞJ$iv–Ï8R”àëu:‰”*¨"˜`2Aâ½Gçӏ“Žº
+ǟӀÄl>‡d!±ÿÒÑç¬×7ŒÂøQ¤O?õÁ'ÓpSžÌ×';)z”.B뚵Œ§Ï/óĔ•ZÒ³)¶¸¼™2cAR~7ÖDÚT«}ºÊó­éUOÚ Á±Á–ûŒ¤£Ê¿Ÿ6Tz)#Û,’µñ\gK´3Iks/ƒ’Ì~²+Õ<BÎ:›\ >é„V"‘K˜¡¯Óñ…ÚbÖ¨r‘ •¬3’ûÊväóµ½$0ö(Æì#¤¨º^GY$ÂÛ;gÀ%4']öI_ÎI8˜hâӖ«Žl@1Ù´vláΦÃâ*SÈQð!҂œ®äBòÕáPç]«@ªõdf΃̏A2j_ä2¢ÓŠH! à1è‹-vkCÈäH'<^O(v"-[v>ganVg"ÿî¤`‚8vX1yv…l“·“Ÿ= +XðCÍ4F¬´ÌP*âgÅXÂÃ7z•bŽ#ÿ×qŒt”8o8† ö
+ðT7âÜáq{ÿ؂K¬'Èֆ(y“Rÿîz—1…³.ŸŠIm©N*p—Q¡¸Ì,Û'…dŌjÐ쌬˜®*e³b:Ž&(fTƒÖžC؈ŸCqîðxUiS®eUÁYSÆšò¨ŠøÝ»x–óüòJåa/DÇõّ`ìÐ"œq3`uœHlºÛ½SɈï˜ì®eºñ>ªÅ}¾9’š-;T#Ff՜ºhºi5NwÐ@3%CÑqö + ²™;çÙ©û:s»ž:ÊõFtÞoÈk>á +Óê!Ì4(Ë~CTêñÂáB‚õôêË^üÞÓ ô4ê"ÎïDYmg5_p– D?cágªiÔ*²ÂÄ`مv +bÙ=lŽ;p&¸ÃÈ +¥à‰Í‡)Y¼g‡XÅ4p—t}¥bG\OB‘ ÝF!"-¦P¹Ík>Ç C©Í@¡®ûÒ¸(—K9Ö£lå–ÝžÞþ ó·`فGm`™!W$¿|sñ(eÁÀ©ßrþFlKqüC÷ ¨)¢èûÿ0CƎ"]¸q`þɇm.dL]MÇRŠû·À:@ËÔñJÊ#„ …oÁ-ø +€D˜¤MX¹1"‚ŒíJJËÔ:†’.ðʒ=fæˆØ÷>° 4X|!ú“ÔO=.;8yŒÍfsÓ»1Qф½DÚ°<7=jŒ掇NXN"Lp‡K9.L:D¢&*qØAm©À@GJØ +Ä/$õœGqÒ«CEN,±8ò§DS!
+O¬ ,U¹×Öf¯n”iܕe,XüÂk.aˆŠ~Ž9BtkŠ†‹y¶/$ncD)JVÁÖMµe~ðõԆ½@ôãÁL¸]×|L7`ølfB]÷+*¤òP)T—B¤Àý‡ŸÁ @§(. ¬\=}÷äq­§dŒ)®orAýüçóf™} Ò,³f—Á*d(s»I×¢ãþh1 +«YL… ãSC5ZL…Œ¸R_XL… Ó%«g`°B
+m¦šéþ PǪ5HȸQ 2dlÖM¨A
+d±9Õuä°@áÉéCø£@ +« T!ƒ@€Í1ŒUÈ(A¬UÈaœÕì(ƒrX ŸÆ‡ðGV¨B¼G„\T!£@=aÒM¨BŽ
+T‹œÎ Eùο¹2ί0`UȀµ/vÝýՊÖ樱­E¤òa!·uœ²â ·u’ãÆBnë¬çÂg7@@Óø…å |£au¾*d䫘ÓÀWƒ |søjÎW ­÷‹¨„¢[j)D1ió`óôz÷îòf#žn~Ûlś·âÃ?ß܊õåíæë:KŒ†‡2ic] ÿ_Š—(šÅWüC'gêå×Å_ž-õ&èVxä!оxò|⧏ïÞm×Û—¯7¸å­¸ÜÞ^‹lĉ½¨CTrº„vï)WçoÞÞ~Ø\^‰ëWbÑüó-¡
+±”Q)5o‚âÖÏÖ`Í3G3¬¥ã
+ + ¯B4Ø­h¸O…ÚeR¤ãb®"hIྨë~Eƒ&
+Êã)ÖÃÀoÌ"œšá—Ëa¬­ÛµR«*ãõŽ.·¼¶#8JF ®û +R˜(K)’d€Äèù£…ô ™¸®¹ß[Í@ª +õ‰_:ÿs¼°è3É^X Kñ\š+Ug +§ß¤®ƒ‰‰J¬xLçTž”]Ü6kû\ˆÀih¿½«á“ +Zk‹$gT¨Ζ‹â(Ó¨@CkzwBbR‡äÂ}ÿðéâðí¢û¸BO‹`縴չ_zöí__üzúüìѯO_œ’ÄÉìq¢Þ¸Öš¯BjMX[ƶnMe‡ä¶³Q( +c»£5®µví©´íʲߐ…r¼±¸b=ÔÛ½kíÞµªÿßXƒ´~¿žÛ‡hîã²¼/Þ1^—¥'IVs’ ùļéιíøÉ«£—qá:4€Ñš8yÖYL_×aM‡äiN'‡=ý†:‚ÇÃᄘǬ@]÷+*¤2Q"¤¶¢~f‡|å;'ú€9,sc·F3NQ¼Q±€BöÊ¿ÌY_WÞ;$K× déû +U=*ª”Ã;GÕ)´u»£A
+Bfr)D˜ŸzþVì“
+¹?ÏhXˆ‘ ,WãéEÃj8Q¦D°Ý;õg#¡ÒsîB\Q:«»¸ºêÅÀì8É$öè™$ký·ÛÕÏïP§Ü þø] Xú€*$ŸÓ-¹P1åóÑé5Š©g×W·› )òՊUúîmsù„6V YE:{ÿñÍÍæV”[<xpg¬[²ÜÿÓ>sQ™J§äbï{
+þÓ|‚4endstream
+endobj
+6 0 obj
+2568
+endobj
+4 0 obj
+<</Type/Page/MediaBox [0 0 612 792]
+/Rotate 90/Parent 3 0 R
+/Resources<</ProcSet[/PDF /Text]
+/ExtGState 10 0 R
+/Font 11 0 R
+>>
+/Contents 5 0 R
+>>
+endobj
+3 0 obj
+<< /Type /Pages /Kids [
+4 0 R
+] /Count 1
+>>
+endobj
+1 0 obj
+<</Type /Catalog /Pages 3 0 R
+/Metadata 12 0 R
+>>
+endobj
+7 0 obj
+<</Type/ExtGState
+/OPM 1>>endobj
+10 0 obj
+<</R7
+7 0 R>>
+endobj
+11 0 obj
+<</R8
+8 0 R/R9
+9 0 R>>
+endobj
+8 0 obj
+<</BaseFont/Courier/Type/Font
+/Subtype/Type1>>
+endobj
+9 0 obj
+<</BaseFont/Helvetica/Type/Font
+/Subtype/Type1>>
+endobj
+12 0 obj
+<</Type/Metadata
+/Subtype/XML/Length 1305>>stream
+<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
+<?adobe-xap-filters esc="CRLF"?>
+<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
+<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
+<rdf:Description rdf:about='5b2e09b8-2602-11ec-0000-906085bd4e43' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.61'/>
+<rdf:Description rdf:about='5b2e09b8-2602-11ec-0000-906085bd4e43' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2011-10-03T19:33:29+02:00' xap:CreateDate='2011-10-03T19:33:29+02:00'><xap:CreatorTool>XCircuit v3.6 rev144</xap:CreatorTool></rdf:Description>
+<rdf:Description rdf:about='5b2e09b8-2602-11ec-0000-906085bd4e43' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='5b2e09b8-2602-11ec-0000-906085bd4e43'/>
+<rdf:Description rdf:about='5b2e09b8-2602-11ec-0000-906085bd4e43' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>comparator_circuit_lpc17</rdf:li></rdf:Alt></dc:title></rdf:Description>
+</rdf:RDF>
+</x:xmpmeta>
+
+
+<?xpacket end='w'?>
+endstream
+endobj
+2 0 obj
+<</Producer(GPL Ghostscript 8.61)
+/CreationDate(D:20111003193329+02'00')
+/ModDate(D:20111003193329+02'00')
+/Title(comparator_circuit_lpc17)
+/Creator(XCircuit v3.6 rev144)>>endobj
+xref
+0 13
+0000000000 65535 f
+0000002893 00000 n
+0000004576 00000 n
+0000002834 00000 n
+0000002673 00000 n
+0000000015 00000 n
+0000002653 00000 n
+0000002958 00000 n
+0000003068 00000 n
+0000003130 00000 n
+0000002999 00000 n
+0000003029 00000 n
+0000003194 00000 n
+trailer
+<< /Size 13 /Root 1 0 R /Info 2 0 R
+/ID [<BCF860EA2674F8204000A1096836643E><BCF860EA2674F8204000A1096836643E>]
+>>
+startxref
+4763
+%%EOF
Index: cv_autotune/schematics/comparator_circuit_stm32.pdf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: cv_autotune/schematics/comparator_circuit_stm32.pdf
===================================================================
--- cv_autotune/schematics/comparator_circuit_stm32.pdf (revision 0)
+++ cv_autotune/schematics/comparator_circuit_stm32.pdf (revision 1340)
/cv_autotune/schematics/comparator_circuit_stm32.pdf
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: cv_autotune/frq_meter.c
===================================================================
--- cv_autotune/frq_meter.c (revision 1339)
+++ cv_autotune/frq_meter.c (revision 1340)
@@ -51,6 +51,8 @@
frq_meter_current_frq = FRQ_METER_TOO_LOW;
+#ifdef MIOS32_FAMILY_STM32F10x
+ // STM32:
// Timer configuration (we use TIM2)
// We use TIM2, note that it is normaly assigned to MIOS32_TIMER0 (don't use it in your app)
@@ -113,13 +115,44 @@
TIM_Cmd(TIM2, ENABLE);
// enable global interrupt
- NVIC_InitTypeDef NVIC_InitStructure;
- NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQn;
- NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = MIOS32_IRQ_PRIO_MID;
- NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
- NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
- NVIC_Init(&NVIC_InitStructure);
+ MIOS32_IRQ_Install(TIM2_IRQn, MIOS32_IRQ_PRIO_MID);
+#elif MIOS32_FAMILY_LPC17xx
+ // LPC17:
+ // Timer configuration (we use LPC_TIM2)
+ // Note that it is normaly assigned to MIOS32_TIMER2 (don't use it in your app)
+ LPC_TIM_TypeDef *tim = (LPC_TIM_TypeDef *)LPC_TIM2;
+ // configure CAP2 input, which is available at P0.4
+ // (J18, a pull-up resistor is already available on this pin)
+ MIOS32_SYS_LPC_PINSEL(0, 4, 3);
+ MIOS32_SYS_LPC_PINMODE(0, 4, 0);
+
+ // reset timer
+ tim->TCR |= (1 << 1);
+ tim->TCR &= ~(1 << 1);
+
+ // time base configuration
+ // we use a prescaler value which results into 2.5 MHz timer clock
+ // Due to the 32 bit timer resolution the lowest frequency which can be measured is much less than 1 Hz! :-)
+ tim->CTCR = 0x00; // timer mode
+#if MIOS32_SYS_CPU_FREQUENCY != 120000000
+# warning "Adapt here to achieve 2.5 MHz"
+#endif
+ tim->PR = ((MIOS32_SYS_CPU_FREQUENCY/4)/1200000)-1; // 0.25 uS accuracy @ CCLK/4 Peripheral Clock
+ tim->MR0 = 10000000; // interrupt event when frequency less than 1 Hz
+ tim->MCR = (1 << 1) | (1 << 0); // generate event on match (overrun)
+ tim->CCR = (1 << 1) | (1 << 2); // capture on CAP2.0 falling edge and generate interrupt
+ tim->IR = ~0; // clear all interrupts
+
+ // enable timer
+ tim->TCR = 1;
+
+ // enable global interrupt
+ MIOS32_IRQ_Install(TIMER2_IRQn, MIOS32_IRQ_PRIO_MID);
+#else
+# error "frq_meter not adapted to this MIOS32_FAMILY yet!"
+#endif
+
return 0; // no error
}
@@ -155,28 +188,80 @@
/////////////////////////////////////////////////////////////////////////////
//! Interrupt handler for TIM2
/////////////////////////////////////////////////////////////////////////////
+#ifdef MIOS32_FAMILY_STM32F10x
void TIM2_IRQHandler(void)
+#elif MIOS32_FAMILY_LPC17xx
+void TIMER2_IRQHandler(void)
+#else
+# error "frq_meter not adapted to this MIOS32_FAMILY yet!"
+#endif
+
{
- if( TIM_GetITStatus(TIM2, TIM_IT_CC1) != RESET ) {
+#ifdef MIOS32_FAMILY_STM32F10x
+ // STM32 capture event handling
+ u8 irq_triggered = TIM_GetITStatus(TIM2, TIM_IT_CC1) != RESET;
+ u16 cap1 = 0;
+ if( irq_triggered ) {
TIM_ClearITPendingBit(TIM2, TIM_IT_CC1);
+ cap1 = TIM_GetCapture1(TIM2); // this will clear the CC1 flag
+ //u16 cap2 = TIM_GetCapture2(TIM2); // this will clear the CC2 flag
+ }
+ u8 overcaptured = TIM2->SR & TIM_FLAG_CC1OF;
+ if( overcaptured )
+ TIM2->SR = ~TIM_FLAG_CC1OF;
+
+ u8 overrun = TIM2->SR & TIM_FLAG_CC4;
+ if( overrun )
+ TIM2->SR = ~TIM_FLAG_CC4;
+#elif MIOS32_FAMILY_LPC17xx
+ // LPC17 capture event handling
+ // Note: for some reasons it isn't possible to reset the timer on a capture event (unfortunately!!!)
+ // Accordingly we have to use the timer in freerunning mode, and compare the difference between
+ // two capture values to determine the period length.
+ // We also have to handle the overrun (== frequency too low) detection
+ LPC_TIM_TypeDef *tim = (LPC_TIM_TypeDef *)LPC_TIM2;
+ u8 irq_triggered = tim->IR & (1 << 4); // check for CR0 interrupt
+ static u16 prev_cr0 = 0;
+ static u8 event_captured = 0;
+ u32 cap1 = 0;
+ if( irq_triggered ) {
+ tim->IR &= (1 << 4); // clear CR0 flag
+
+ u32 cr0 = tim->CR0; // captured timer value
+ int diff = cr0 - prev_cr0;
+ if( diff < 0 )
+ diff += tim->MR0+1;
+ cap1 = diff;
+ prev_cr0 = cr0;
+ event_captured = 1;
+ }
+
+ u8 overcaptured = 0; // not available for LPC17
+ u8 overrun = 0;
+ if( tim->IR & (1 << 0) ) { // check for MR0 interrupt
+ tim->IR &= (1 << 0); // clear MR0 flag
+ // set overrun if no new capture event within 1 second
+ if( !event_captured )
+ overrun = 1;
+ event_captured = 0;
+ }
+#else
+# error "frq_meter not adapted to this MIOS32_FAMILY yet!"
+#endif
+
+ if( irq_triggered ) {
// clear timeout
timeout_ctr = 0;
- // get the Input Capture value
- u16 cap1 = TIM_GetCapture1(TIM2); // this will clear the CC1 flag
- //u16 cap2 = TIM_GetCapture2(TIM2); // this will clear the CC2 flag
-
// overcaptured? (means: register not read early enough, will happen at frequencies > 20 kHz)
// SR should be read after Capture1 read
- if( TIM2->SR & TIM_FLAG_CC1OF ) {
- TIM2->SR = ~TIM_FLAG_CC1OF;
+ if( overcaptured ) {
cap_sample_ctr = 0;
frq_meter_current_frq = FRQ_METER_TOO_HIGH;
frq_updated = 1;
- } else if( TIM2->SR & TIM_FLAG_CC4 ) {
+ } else if( overrun ) {
// timer overrun!
- TIM2->SR = ~TIM_FLAG_CC4;
cap_sample_ctr = 0;
frq_meter_current_frq = FRQ_METER_TOO_LOW;
frq_updated = 1;
/trunk/apps/examples/cv_autotune/mios32_config.h
15,6 → 15,12
#define MIOS32_LCD_BOOT_MSG_LINE2 "(C) 2011 T.Klose"
 
// ensure that TIM2_IRQn handler not allocated by MIOS32 (used in frq_meter.c)
#ifdef MIOS32_FAMILY_STM32F10x
#define MIOS32_DONT_ALLOCATE_TIM2_IRQn 1
#elif MIOS32_FAMILY_LPC17xx
#define MIOS32_DONT_ALLOCATE_TIMER2_IRQ 1
#else
# warning "You should disable the timer irq here"
#endif
 
#endif /* _MIOS32_CONFIG_H */
/trunk/apps/examples/cv_autotune/README.txt
8,14 → 8,14
===============================================================================
 
Required tools:
-> http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fdoc%2FMEMO
-> http://www.ucapps.de/mio32_c.html
 
===============================================================================
 
Required hardware:
o MBHP_CORE_STM32 or STM32 Primer
o MBHP_CORE_STM32 or MBHP_CORE_LPC17
o MBHP_AOUT, MBHP_AOUT_LC or MBHP_AOUT_NG module
o a LM339 comparator (see schematics/comparator_circuit.pdf)
o a LM339 comparator (see schematics/comparator_circuit*.pdf)
 
===============================================================================
 
23,10 → 23,11
could be implemented.
 
frq_meter.c provides a frequency measurement function which uses a
capture/compare channel of the STM32 (available at J5B.A0) to deterime
the frequency of the VCO.
capture/compare channel of microcontroller to determine the frequency of the VCO.
o MBHP_CORE_STM32 module: capture input at J5B.A4 (pin PA0) used
o MBHP_CORE_LPC17 module: capture input at J18 (pin 0.4) used
 
See schematics/comparator_circuit.pdf for details, and
See schematics/comparator_circuit*.pdf for details, and
schematics/comparator_waveforms.jpg for the expected waveform.
 
The VCO is controlled by an AOUT module (by default: AOUT_NG, Channel #1)