Sie sind auf Seite 1von 15

DigitalVoltmeter I.Introduction Ourgoalhereistobuildavoltmeter.Wewilldothisusingalmostalldigitalcircuitry ratherthananalog.Thecircuitworkslikemanyotherdigitalmeasurementcircuitsinthatit convertsthequantitytobemeasuredintoatimeinterval,thenmeasuresthattime. CallthevoltagewewishtomeasureVin.Saywechargeacapacitorlinearlywithtime (thatis,ataconstantchargingcurrentI),startingatzerovolts.Itwilltakeatimet=Vin/(dVin/ dt)=VinC/(dQ/dt)=VinC/IforthecapacitortochargeuptoVin.Soifwecanmeasurethis timeinterval,wecandetermineVin.Tomeasuretimeindigitalelectronics,weproduceahigh frequencypulsetrainandcountthepulsesoccurringduringthetimeintervaltobemeasured. Thenumberofpulsescountedisameasureofthetimeinterval,andhenceofVin.Withsome suitableconversionandadisplay,thismakesadigitalvoltmeter(DVM). Torealizethisideawithactualcircuitelements(mostlyintegratedcircuitsorIC's)we requireanumberofseparatesections.Thecompletecircuitdiagramfortheeventualprojectis shownonthelastpageofthiswriteup(don'tletitfrightenyou!).

Onthesecondtolastpageis thesamecircuitwithitsfunctionalsectionsoutlinedandlabeled.Thesectionsneededforthis projectare: A) Apulsetraingenerator.Inelectronics,thisiscalledaclock.Wehavealreadylearnedhow tobuildthisusingthe555timerchip.Thisistheclockgenerationsection. B) Awaytomonitorthevoltageacrossthecapacitorandgeneratesignalswhenthe chargingstartsatzerovoltsandwhenthevoltagebecomesequaltothevoltagetobe measured,Vin.Icallthisthesectioncontrolandgating. C) Awaytocountthenumberofclockpulsesthatoccurbetweenthestartandstop chargingsignals.Thisisthecountingsection. D) Aconstantcurrentcapacitorchargingcircuitthatcanbeturnedonandoffandresetto zerovoltsbythestartandstopchargingsignals.analoginput/transducer E)Ahumanreadablewaytodisplaythenumberofpulsescountedduringthisinterval.Thisis thelatchinganddisplaysection. Wewilllearnhowtobuildeachofthesesections,thenconnectthemtogetherintothe functioningDVM. II. SectionbySectionBuildUp So,letusgetstarted. A.ClockGeneration PartAwealreadyhavelearnedtodointhepreviouslab.Digitalthings,though,prefertowork at0or5V.Therefore,eitherpowerthe555from5Vinsteadof10or15V(seespecsheet),orput pinthreeonavoltagedividertobringtheoutputdownto5V.Thisisthemethodchoseninthe finalschematicattheend B.BasicControlandGating TocarryoutthefunctionofPartBweuseasolutionbasedonanintegratedcircuitcalled acomparator.TheentirepurposeofthisICistosignalwhichoftwovoltagesislarger.Oneof thevoltageswillbeVinandtheotherwillbethevoltageacrossthecapacitor.Thecomparator hastodoitsjobwithoutdrawinganyappreciablecurrent,otherwiseitwillinterferewiththe constantcurrentcharging.ToachievenearzeroinputcurrentwewilluseaLF355FETinput

opampasourcomparator. Wewilldiscussopampsindetailinclass.Fornow,wecanjustlearnthattheopampis achipwithtwoinputslabeled+and(withthevoltagesatthesepointscalledV+andV)and calledthenoninvertingandinvertinginputs.Ithasjustoneoutput.OfcourselikeanyICit requirespowerandgroundconnections,inthiscasetwopowersupplies(Vcc=+10VandVee= 10Vthesearejustconventionalnamesforthepowervoltages). Ifthevoltageatthe+inputisgreater(morepositive)thanthevoltageattheinput(V+ >V),the355willdriveitsoutputhigh,neartoVcc.Iftheoppositebecomestrue,(V>V+),the outputwillgolow,neartoVee. Justforthispartofthelab,wewilluseacoupleofLED'stomonitorthestateoftheopamp output.TheLEDissymbolizedby:

andisaLightEmittingDiode. Wediscusseddiodesgenerallyinclass.Theyactasonewayvalvesforcurrent.The arrowpointsinthedirectionconventional(positive)currentisallowedtoflow.Theshorterlead wireonanLEDcorrespondstothetipofthearrow.(Forhistoricalreasonsthissideisalso calledthecathode;theothersideofthedeviceiscalledtheanode.)Whenthediodeisbiased (i.e.voltageisapplied)toconductinthisdirection,itissaidtobeforwardbiased. IfyouforwardbiastheseLED'swithlessthanabout1.6Volt,littlecurrentflowsandno lightisproduced.Ontheotherhand,ifyoutrytocausealargerforwardvoltagedropacrossa diode,youwillfindthatyouwon'tbeabletodoit.Anydiodewillalwaystrytomaintaina certainvoltagedropofabout1Voltacrossitself(seebelowfordetailsontheexactvalue).The diodewillkeepitsforwardbiasvoltagedropconstantbydrawingmoreandmorecurrentfrom thepowersupplyuntileitherthesupplysagsorthediodeburnsup.Theexactvalueofthe forwardbiasvoltagedropdependsonthematerialthediodeismadeofandnothingelse.Red LED'saremadeofgalliumarsenide(GaAs),amanmadematerialthatdoesnotexistinnature. Theyhaveaforwardbiasvoltageofabout1.6voltsandtheyonlyemitlightwhentheforward biasvoltageisatleastthisbig.Signaldiodesareusuallymadeofsiliconwithaforwardbias voltageof0.6Volt.AnLEDwillnotlightwhenitisreversebiased(voltagepolarityis reversed). Inthecircuitbelow,onlyoneLEDshouldlightatatimetheoneontheleftwilllightif theopampoutputispositive,ortheoneontherightwilllightiftheopampoutputisnegative. LEDsshouldalwayshavearesistorof~500inserieswiththemtoguaranteethatthevoltage theyseewillsagsufficientlyathighcurrenttoavoidburningoutthediode. 1)Buildthevoltagemonitorcircuitshownabove.TheSPDTswitchshownbelowthe9K resistorcontrolsthecapacitorcharging.The1kpotentiometeriswiredtoformavoltage divider,allowingustosetVintoanythingbetween0and10V.Thetimeconstantforcharging thecapacitorisfixedbythecapacitorvalueandthe9Kresistor,andisslowenoughthatyou shouldbeabletonoticethelongerchargingtimesasVinisincreased.(Note:Viniswhatwill eventuallybethevoltagewearetryingtomeasure.Thecapacitorisalwayschargedinthis schematicfrom0tosomeVinvaluelessthan10V.Butitwilltakeitlongertochargetoa highervoltage,sothe355comparatorwillmeasurealongertimeforVtobecomegreaterthan V+asVinisincreased.)Makesuretheelectrolyticcapacitorsareplacedwiththecorrect

polarity!!Thismeanstheleadmarkedpositiveshouldgotowardsthe+10V. 2)Inthisconfiguration,theopampwillputout10Vor10Vatpin6(actuallyslightlyless. Measuretherealvalues).SinceourtwoLEDsarewiredwithoppositepolarity,ineithercase onlyoneofthemwillbeforwardbiasedandhenceemitlight.ChooseoneoftheLED'sredand theotheronegreenandorientthemsothatthegreenonelightswhenthecapacitorhasalarger voltagethanVin.Whentheswitchisflippedtoconnectthe9Kresistortothecapacitor,the chargingstarts.TheredLEDshouldinitiallylight,thenaftersomedelay,itshouldgooutand thegreenoneshouldcomeon.IfVinisincreasedbyadjustingthe1Kpot,thedelayshouldget longer.Aftertheswitchisflippedintheotherdirection(disconnectingfromthe9Kresistorand shortingacrossthecapacitor),theredLEDshouldcomeonimmediately,sincethecapacitoris dischargeddirectlytogroundwithoutaresistor. 3)Makingcertainthecapacitorhastherightpolarity,turnthepotentiometertoapplyits maximumVin.Fliptheswitchtostartcharging.Youmaynotseethegreenlightgoon.Thisis becausetheopampcannotworkwithinputsignalsverynearitspowersupplyvoltages.Back offabitonthepotentiometertogetVinavoltorsolowerthanV+andtryagain. C.CountingClockPulsestoMeasureElapsedTime 1.CountingPulseswiththe74LS192Chip DigitalelectronicchipsofthetypeknownasTTLuse0Vforanoffsignal(0)and5V foranonsignal(1).Thisisthedefiningcharacteristicofdigitalelectronics:anyinputoroutput canonlybeinoneoftwopossiblestates.TheTTLoutputofthebreadboard'sfunction generatorgeneratesapulsetrainforusewiththeTTLfamily.Sodoesanappropriate555 circuit.TheTTLchipsusedinthisclassarealldesignatedbythelettersLSinitsJEDEC number(Example:74LS00isaquadNANDgate). To"count"thepulsesgeneratedwhilethecapacitorischarging,wewillusea74LS192 integratedcircuit,whichisadividebytencountingchip.Itisaverycapablelittleguy,and costsonlyaboutabuck.Thischipacceptsalogicpulsetrainasinputonpin5(UP COUNT).Itcountspulsesfrom0(0000binary)to9(1001binary),continuouslyputtingout thebinarybitscorrespondingtothenumberofpulsescountedonpins3,2,6,7(LSBtoMSB). Whenitgetspast9itputsoutacarrysignalonpin12,thebinarybitoutputsrolloverto0000 again,andthenitrepeats.Itcanalsocountdownaswellasupbutwewon'tusethathere. Securethedatasheetforthispartbyaskingyourinstructororentering74LS192datasheetinto Googleandpickingtheappropriatereference. Theinnardsofthechip(themagicinthesenseArthurC.Clarkeusedtheterm)will beexplainedinclass.Tofamiliarizeourselveswiththischip,wewillsendsignalstoitoneata

timeusingapullupresistorandadebouncedswitch.ReadthesectionSwitchDebouncingon pages506ff.ofHorowitzandHill(H&H).Thissectionexplainswhywemustusea debouncedswitchtosignalthecountersothateachswitchpresssendsoneandonlyone pulseintothecounter.Fortunatelythebreadboardsalreadyprovidedebouncedswitches,located ontheleftside.

1)Wiretheswitchandresistorpartofthecountingcircuitabove,usinganormallyclosed, debounced,pushbuttonswitch.A500pullupresistorshouldrunfrom5Vtotheswitch. Theresistorwillthenbetiedtogroundwhenevertheswitchisclosed,presentingalogic0tothe COUNTUPinput(pin5).Whentheswitchpushbuttonispressed,theswitchisopenedand thereforebreakstheresistorconnectiontoground.A5VinputisthenpresentedtotheCOUNT UPinput(minusofcourse,thevoltagedropacrosstheresistorbutrememberthatinputsto logicchipsdrawlittlecurrentsothisdropisneglibigle.).Thistransitionfrom0to5Vis countedasonepulse. 2)Wiretherestofthecircuitasshown.The74LS192isasophisticateddevicewithanumber ofinputswearenotusing.Theseunusedinputpinsmustbetiedtoeithergroundor+5V, becausepinsleftfloating(unconnected)candrifttorandomvoltagesandcausespuriousinputs tothechip.TheCOUNTDOWN(4)and LOAD (11)pinsmustbetiedhigh(5V).The CLEARinput(pin14)mustbetiedto0V.Wirethe74192binarybitoutputs3,2,6,and7tothe firstfourlogicindicatorLEDsontherightsideoftheboard.(Theselogicindicatorsalready haveseriesresistorsbuiltintoprotecttheLED'sfromovercurrent.)Makesuretheleast significantbit(LSB,pin3)iswiredtotherightmostLED,andthemostsignificantbit(MSB, pin7)iswiredtotheleftmostLEDsothatthebinarydisplaywillreadnormally. 3)Nowpushandreleasetheswitchrepeatedly.Youshouldseethelogicindicatorscountupone unitforeachbuttonpress,from0000to1001(inbinaryfor0to9),thengobacktozeroand repeat.Thisshouldrepeataslongasyoucontinueactuatingtheswitch. 4)Disconnectpin5fromthepullupresistorandconnectitinsteadtoaTTLsignalfromthe functiongeneratorrunningatalowfrequency.Observethatthebinaryoutputsnowcountup

withoutyourbuttonpushing.Next,tietheCLEAR(pin14)toapullupresistorandaDIP switch(seenotebelow)andnoteitsfunction.Lastly,tietheCARRY( CO ,pin12)toafifth logicindicatorLEDandnoteitsbehavior.Keepthiscircuittogether. NoteonDIPswitchpullupsetup:

Somepeoplewouldcallthisapulldownresistorsinceitconnectstogroundratherthan5Vasin thedebouncedswitchsetupabove.TosetthisupusetherowofDIPswitchesonthelowerleftof theprototypingboard.Theslideswitchonthefarrightinternallyconnectsonesideofallthe DIPstoeither0or+5V.Makesurethisswitchissetto5V.Toavoidshortingthe5Vsupply directlytoground,a~500resistortogroundisneeded.Fromthehighside(5V)ofthis resistor,runyourinputtotheCLEARpin(orwhereeverelseinthecircuitamanuallyoperated logicinputisneeded). 2.Switchingtheinputto74LS192OnandOffwithaNANDGate

Thevoltmeterwillworkbycountingthepulsesfromthe555betweenthetimethecapacitor chargingstarts,andthetimethe355comparatordetectsthatthecapacitorvoltagehassurpassed V andthereforechangesitsoutputstate.ToaccomplishthiswewilluseasimpleNANDgate


in

inthecircuitshownabove. TheNANDgatewasdiscussedinclass.ANANDisaNOTANDbooleancircuit element.Thetruthtableisgiveninthediagramabove.Thepullupresistorwillprovidealogic 1toinputAoftheNANDwhentheswitchisclosed(thisimitatesthesituationwewillhave whilethecapacitorisstillcharging),and0iftheswitchisopen.InputBoftheNANDis connectedtothepulsetrainoutputofthe555.TheoutputoftheNANDwillthereforefollowthe 555pulsetrain(inverted)iftheswitchisclosed,andtheNANDoutputwilljustsitatlogic0 otherwise.Thesignalfromthepullupresistorandswitchissaidtogatethecountingofthe555 pulsetrain. 1)FirstexploretheoperationoftheNAND.Finda74LS00ICandalsoitsdatasheet.The7400 actuallyhasfourindependentNANDgatesinonepackage.Justpickoneofthemforthis exercise.TodrivetheNAND,assemblethe555timercircuitfrompage287ofH&H.You couldusetheTTLgenerator,butthe555willbeneededlateranyway.Selectresistorsand

capacitorstogiveapulserepetitionrateofafewHzsothatyoucanseetheoutputchange visually.Thenconnectthe555outputpulsetraintooneinputoftheNAND,andthesecond inputtotheDIPswitchwithapullupresistor. 2)VerifywithascopethattheoutputoftheNANDonlyoscillateswhentheDIPswitchisclosed andtheinputisthereforepulledupto+5volts(logic1) 3)NowwiretheNANDoutputtotheCOUNTUPpinofthe74LS192counterfromthe precedingsection.VerifythatthecounteronlycountswhentheDIPswitchispulledup.Ifthe 555pulserepetitionrateistoohigh,youwon'tbeabletoseethefourindicatorLEDsswitching asthecountprogresses.Theywilllookasiftheyareallonatthesametime,withareductionin brightness.WhentheDIPswitchisoffthough,theLED'sshouldfreezeinasteadypattern. 4)Usetwoprobesandascopetoverifythatthe555signalisbeinginvertedbytheNAND.You willneedtodisplaybothscopechannelsatonce. D.ImprovingtheAnalogInput/TransductionSection 1.ConstantCurrentCharging Whyisitunsatisfactorytochargethecapacitorthroughafixedresistorusingafixed voltage?(Hint:V=V0(1exp(t/RC)).Wenowneedaconstantcurrentcapacitorcharging circuitthatcanbeturnedonandoffandresettozerovoltsbythestartandstopchargingsignals. Thisisacomplextask,andthuspartDwillhaveseveralsubsections. Asexplainedattheverystartofthiswriteup,thecapacitormustbechargedlinearly withtime,sothereisafixedvoltageriseperunitoftime.Howdowechargeacapacitor linearly?RecallthatV=q/Candthat1Amp=1Coulomb/Sec.So,onlyifwechargethe capacitorwithaconstantcurrentdoweincrementthechargebythesameamountineach second,hencealsoincrementingthevoltagebyaconstantamountineachsecond.Thisgivesa linearV(t).FortheconstantcurrentdrivewewillusetheLM334,athreeterminalcurrent sourcethatjustrequiresoneexternalresistortosetthecurrent. Anidealcurrentsourcewouldprovideafixedcurrentnomatterwhatloaditwas connectedto.But,aswiththevoltagedivider,anyrealcurrentsourcewillsagundercertain conditions.Notice+VINandVonthediagrambelow.The+VINterminalisthepowersupply voltageinputtothechip.TheVterminalistheoutputpinfromwhichthecurrent(ISET)willbe suppliedtoourload(thecapacitor).Asthesignsindicate,Vmustbelessthan+VIN.Ifthe loadingissuchthatVgetstooclosetothesupplyvoltage,theoutputcurrentwillsagorcease altogether.Forcorrectoperationwemustsatisfythecondition+VINV>0.5V.Naturallythis meanswecannotchargeourcapacitorabove(+VIN.5V).AswithmostIC's,therearemany possibleapplicationsandcircuitsforthe334.Thefigurebelowshowsthesimplest configuration.Vincanbeanywherebetween1and40V.RSETdeterminesthecurrentbythe followingformula:ISET=(227V /K )*Tambient/RSET.Forthisproject,assumeTambient=300K. Inarealinstrument,wewouldhavetobuildintemperaturecompensationtomakethecharging currentindependentoftheambienttemperature.

1)Usingtheaboveformula,calculateRSETtoproduceacurrentof0.5mA. 2)SecureacopyofthedatasheetfortheLM334soyoucanidentifytheleads.Assemblethe littlefragmentshownabove,poweredbyVIN=5V,andmeasuretheoutputcurrenttoverifyyour calculations.The334istemperaturedependent,sowarmitalittlewithyourfingerandseehow thecurrentchanges.Itshouldbeasmallchange. 3)PuttheaboveconstantcurrentsourceintothecapacitorchargingcircuitofsectionB1,in placeofthe9Kresistortothepositivesupplyasshowninthefullcircuitdiagramonthelast pageofthiswriteup. Verifythefunctionofthecircuitbyplacinganammeterinserieswiththecurrentsource andcapacitor,andwatchingthevoltageonthecapacitorwiththeoscilloscope.Youshould observeonthescopethatthecapacitorneverchargesabove(+VIN.5V)=4.5Vasmentioned previously.Theammetershouldshowa.5mAreadinguntilthecapacitorvoltagelevelsoutnear 4.5V,thenitshouldreadzero.Replacethe5Vsupplyvoltagewith10V.Noticethatthecurrent isstillthesame.The334outputcurrentisindependentofsupplyvoltage. 4). Next,measuretheslopeofthecapacitorchargingcurveV(t)ontheoscilloscopeandverify thatV(t)increaseslinearlywithtime.Comparethemeasuredslopewiththevalueyouexpect fromcalculation. 2.AutomatedControloftheChargingCircuit Giventhemeasuredcurrentofyour334,calculateacapacitorvaluetogiveacharging rateinVolts/secondbetween100and200V/s.Thischoicewillallowthefinalmetercircuit torereadtheinputvoltageatafairlyhighrepetitionrate,allowingittofollowiftheinput voltagevarieswithtime.Forexample,ifI=0.5mAandC=3.3x106F,V(t)=.5mC/s/3.3x 106F=150V/s.Thisimplies.006secondspervolt. Tostartandstopthecapacitorchargingcircuitautomatically,wewilluseadevicecalled aMOSFETtransistorasanelectronicswitch.TheMOSFETtobeusedhereiscalledan RFP4N05L.MOSFETsareextremelysensitivedevicesmeaningtheyareeasytodestroyby staticelectricity.GroundyourselftotheshellofaBNCconnectoronthebreadboardbefore handlingtheMOSFET.Theterminalsofthisdevicearenamedgate,source,anddrain.The gateisthecontrolterminalwhichcontrolshowmuchcurrentpassesfromdraintosource.Much ofthemagicofMOSFETsisrelatedtothefactthatthegatedrawsanexceedinglysmallcurrent, picoampsorless.Withthattinycurrent(andcorrespondinglytinycontrolpowerIgateVgate)we cancontrolamuchlargercurrentIdrainofhundredsofmA(andcorrespondinglymuchlarger

powerIdrain*(VdrainVsource))goingfromdraintosource.Thesedevicescomeinavarietyof

typeswithdifferentcharacteristics,butwedonotneedtoconcernourselveswiththatnow. Wewillbuilduptheautomatedcontrolofthechargingcircuitinsteps. 1)Firstlet'sseehowtousetheMOSFETtostartandstopthecharging.Thedevicewillact essentiallylikeaswitchacrossthecapacitorthatwecanopenandclosebutitwillopenand closeinresponsetoalogicsignalpresentedtoitsgate.Rearrangeyourcapacitorcircuitfrom partBonceagain,thistimetolooklikethefigureabove(the0.5mAcomesfromthe334current sourceasbefore).SupplyavariableVin(asbefore)usinga1kpotentiometerbetweengroundand 10V.MeasureVinwithaknownworkingvoltmeter.NoticewearetyingthegateoftheMOS FETtoaDIPswitchandpullupresistor.Wearestillgoingtooperateamanualswitchtostart andstopthecharging,butnowthemanualswitchisactuallyjustpresentingalogicsignaltothe MOSFETgate.ThatsignalcausestheMOSFETswitchtoopenandclose.Lateron,the logicsignalwillbesuppliedbyyetanotherchip(the74LS74flipflop)insteadofamanual switch. 2)VerifythatwhentheDIPswitchattheMOSFETgateisopenedandclosed,theLEDstoggle asbefore.Whenthegateistakenlow,theMOSFETactslikeanopencircuitfromdrainto source,allowingthecapacitortocharge.Whenthegateistakenhigh,theMOSFETactslikea closedswitchshortingacrossthecapacitorandbringingthechargetozero.Observethatthe MOSFETgetswarmtothetouch.Itispassingcurrent(~.5mA)wheneverthegateishigh. 3)Thoughcharginglinearly,thecapacitorchargestoofasttovisuallyseethedelaybetweenred andgreenLED'scausedbythechargingtime.Toverifythedelay,attachtheprobeofan oscilloscopeacrossthecapacitorandwatchitchargeanddischargeforseveraldifferentvalues ofVin.Itmaybedifficulttogetthescopetotriggerproperly(youshouldbeonnormal triggering),butpersevere!Verifythattheslope,etc.arestillthesameastheywereinD1step5) above. B.ControllingtheMOSFETwitha74LS74FlipFlop The74LS74isaclockedDtypeflipflop.Wewilluseittomediatebetweenthe comparatorandthecapacitorchargingcircuit.Thisdevicehaspowerandgroundconnections likeanylogicIC.ItalsohasinputscalledD,CLOCK,and R RbarandoutputscalledQand Q .ThepresenceofaCLOCKpulsedetermineswhetherornotthedevicelistenstotheD input.Withoutalogic1signalatCLOCK,theoutputsstayconstantnomatterwhathappensat D.IfbothCLOCKandDaredrivenwithlogic1atthesametime,thenQwillgotologic1and Q willgotologic0.IfCLOCKisdrivenwithlogic1andDisdrivenwithlogic0atthesame time,thenQwillgotologic0and Q willgotologic1.If R isdrivenwithlogic0itwill forceQtologic0and Q tologic1regardlessofthelogiclevelpresentedtoCLOCK.

Wireupa74LS74andconnectthe R inputto5V.UsingpullupresistorsandDIP switchesconnectedtoDandCLOCK,andlogicindicatorLED'sconnectedtoQand Q ,verify thattheabovedescriptionofitsoperationiscorrect. Nextexploretheeffectof R .ConnectDto+5Vsothatitisalwayshigh(logic1),and Rbartoaswitchandpullupresistor.WhatshouldhappenwhenRbarinputisgrounded? (HintremembertheTriggerbarinputona555?).VerifythattheeffectofRbaristojamQ tozeroregardlessofthesignalpresentedtoCLOCK. InthefinalDVMcircuit,thecomparatorwilldrive R andCLOCKwillbedrivenby apushbutton,orbytheTTLpulsetrainfromthefunctiongenerator.TheDinputwillbetiedto +5V.Howtheseconnectionsperformthenecessarymeasurementcyclewillbeexplainedinthe nextsection. PartD.3 Nowwewillputtogetherthepartsdiscussedsofarandgettheautomatedcharging operationcycletowork.Wewillthenaddonerefinement,andthenmoveontothelatchingand displaysectionoftheDVMcircuit.

1)Onceagainamendyourcapacitorchargingcircuit,makingitlooklikethatabove.The debouncedswitchconnectstothe74LS74CLOCKinputandiswiredasinpartC.1stepone. Theswitchistheretoallowustomanuallygeneratealogicsignaltostartonechargingcyclejust fortesting.Thislogicsignalcouldalternativelybegeneratedautomatically. 2)RunQtoanindicatorLED.Also,run Q toanindicator,aswellastotheMOSFETgate (determinewhichMOSFETpiniswhichfromadatasheet).Tie R toathirdindicatorLED, aswellastotheopamp(comparator)output.Asever,the355opamptakesasitsinputsthe voltagewewishtomeasureandthevoltageofthechargingcapacitor.WheneverVin>VCapthe comparatoroutputis+10V.Intheothercase,VCap>Vin,theoutputis10V(thepowersupply voltages+/10Vareoftenreferredtoastherails).Theopampoutputcontrolstheoperationof theDflipflop(through R ). So,letsgothroughacycleofoperation.Assumethatinitially(atpowerup)the capacitorisuncharged.ThereforeVin>VCap, R =1,Q=0,and Q =1.The Q =1signal pullstheRFP4N05Lgatehigh,sotheMOSFETswitchisclosed,shortingacrossthe capacitor. NowwepressthedebouncedswitchandsendasignaltotheCLOCKinputofthe 74LS74.ThatchipthenreadsthesignalatitsDinput,whichisalwayslogic1(Distiedto +5V).Thereforethe74LS74outputstatechangestoQ=1and Q =0. Q =0immediately

openstheMOSFETswitch,allowingthecapacitortostartcharging.LaterwewillusetheQ outputtostartthecountinganddisplaysections(notshowninthediagramabove). ThecapacitorcontinuestochargeuntilVCap>Vin.AssoonasVCapexceedsVin,the outputoftheopampcomparatorgoeslow,drivingthe R inputtologic0.Thisresetstheflip floptothestateQ=0and Q =1,whichclosestheMOSFETswitchagainandinstantly drainsthecapacitor.Thestateofthecircuitisnowexactlythesameasitwasatpowerup. Nothingmorewillhappenunlessanotherlogic1ispresentedtoCLOCK. Theoutcomeofallthisisthateverytimethedebouncedswitchispressed,thecapacitor goesthroughonecycleofchargingat.5mAuptoVCap=Vin,thengetsinstantlydischarged.The Qsignalofthe74LS74islogic1duringthechargingtimeandlogic0otherwise.Thisswitching ofQand Q intimewiththecapacitorchargingistheheartoftheDVMwearebuilding.We willusethistocontrolthecountinganddisplaycircuitryinthefollowingsections. 3)PowertheabovecircuitanduseindicatorLED'soranoscilloscopetocheckthatitactually goesthroughthecycleexplainedindetailabove.Basically,youshouldseeQ=Oand Q =1at powerup.ThenpressingtheswitchshouldreversethestatesofQand Q forashorttime,after whichtheyshouldreturntotheirinitialstates.Itwillbeverydifficulttosee R switchfromits powerupvalueof1,to0,andbackto1again,sinceitisonlyinthelogic0stateforthat incrediblybriefperiodoftimeittakesthecapacitortostartdischarging. 4)Atthebeginningofthissection,theneedforacoupleofrefinementswasmentioned.Hereis thesymptomofaneedforoneofthem:Noticethatifyouholddowntheswitch,thecapacitor willchargeup,butitwillnotdischargeuntilyouletgo. PartD.4:ARefinement Whydoesthecapacitornotdischargeiftheswitchishelddown?Thepoor74LS74is gettingcontradictorymessagesfromitsinputs,that'swhy.Aslongastheswitchispressed,the 74LS74issensitivetoitsDinput,whichisheldhigh.Sothisshouldmaketheoutputstategoto Q=1and Q =0.Howeveroncethecapacitorgetsfullycharged,theopampcomparatoroutput issignaling R =0,whichissupposedtodrivetheoutputstoQ=0and Q =1instead. Accordingtothe74LS74specs,theDinputwinsthisconflictandthecapacitornevergets discharged. Therearetwowaystofixthis.1)Useanedgetriggered74LS74,whichdoesexistandis calleda74LS74A.Wediscussededgetriggeredlogicdevicesinclass.Or,2)sendonlyavery shortpulsetotheCLOCKinputnomatterhowlongtheswitchishelddown.Thecircuitshown belowaccomplishesfixnumber2)inacrudebuteffectiveway.

YoushouldhavelearnedaboutNOT,NOR,andNANDinlecture.InBooleanlogicthey performtheirfunctionsinstantaneously,butintherealmofelectronicsthereissomepropagation

10

delay.Forexample,theinvertingofasignal(NOT)maytakearound20ns.Sohereisthedeal: withthedebouncedswitchopen,theupperinputtotheNORis1.Thelowerinput,producedby thethreeNOTs,is0.RecallthataNORonlyoutputsa1whenbothinputsare0,sohereit outputs0.Nowweclosetheswitch.TheupperinputtotheNORimmediatelygoesto0.Dueto thepropagationdelaythroughthethreeNOTs,thelowerinputstaysat0also,forabout60nsof propagationdelay.Thenitturnsto1.TheeffectofthisisthattheNORoutputgivesa60ns pulseof1,thenreturnsto0.Whenwereleasetheswitch(longafterthe60nspulseisfinished), theupperinputimmediatelygoesbackto1,and60nslaterthelowerinputgoesto0.Butnone ofthischangestheoutput,sinceatanytimeoneoftheinputsis1.Acircuitthatgeneratesa shortpulselikethisiscalledaoneshot.SingleICsthatperformthisfunctionareactually availableandarediscussedinH&Hp.517ff. 1)AddintheNORandthreeNOTsbetweentheswitchandflipflop.TheNORisa74LS04 andtheNOTisa74LS02.You,ofcourse,needthedatasheetfortheseparts.Donotforgetto givethem5Vandground!Observeonthescopethatthecapacitorwillnowdischargeevenif youholddowntheswitch. PartE:LatchandDisplaySection Hereweneedtocreateahumanreadabledisplayofourpulsecounting.Thiswill involveasevensegmentdisplay,adisplaydriver,andalatch. 1.DisplayandDriver TheMAN71AisasevensegmentLEDdisplayusedfordisplayingasinglehuman readablenumberorothercharacter.ItcontainssevenbarshapedLED'sarrangedintheshapeof asquaredoff8.Theanode(+terminalinforwardbias)connectionsofalltheLED'sare massedtogetherintoasinglecommonanodeterminal.Thecathodeofeachsegmenthasits ownwirecomingoutoftheDIPpackage.Thesegmentsaredesignatedwithlettersag.To lightanyoneormoreofthesegmentssimplygroundthecorrespondingpin(s)ontheDIP. Todisplayagivendigitonehastotakethedesireddigitanddecodeitintoalistof whichpinsaretobegrounded.TheICchip7447containsallthecircuitryneededtodothis decoding.Asitsinputitreceivesthe(four)binarydigitsofanumberbetween0and9,and decodesthisinformationintowhichLEDsegmentsshouldlight,groundingthecorresponding pinsofitsoutput. Lookupthedatasheetsforthe7447andMAN71A.NotethattheMAN71ALED'sare notinternallyovercurrentprotected,soa500resistorisrequiredoneachsegment'slineto ground,meaningbetweentheMAN71Aandthe7447.[Whywouldn'titbeagoodideatoput onesuchresistorinthecommonanodeline?] 2.Latch Thelatchallowsustostaticallydisplaythefinalresultofonecapacitorchargingcycle operation,evenwhilethenextcycleisinprogress. Thelatchweusehere,the74LS175,hasfourinputsandfouroutputs.Itjustpasses alongthelogicstatesonitsinputsthroughtoitsoutputsbutonlywhenanENABLEsignalis driventologic1.EachtimeanENABLE=1signalisreceived,the74LS175transfersitsinput datatoitsoutputs,whereuponitfreezestheoutputsuntilanotherENABLEsignalarrives. Obtainthedatasheetforthe74LS175.Youwillseethatfortunatelyforus,theENABLE (alsosometimescalledCLOCK)inputispositiveedgetriggered,meaningthechiponlypasses theinputbitstotheoutputsontheCLOCKtransitionfrom0to5V.Noworriesaboutmultiple passalongsfromoneoverlongCLOCKpulse,andnoneedforahomemadeoneshotlikewith

11

the74LS74.ThefreezetheoutputstillthenextCLOCKpulseactionisjustwhatweneedfor ourstaticdisplay. 1)InthecircuitfrompartB,connectthefouroutputbitsfromthecountertotheinputsofthe latch.(YoucanleavetheindicatorLEDsconnectedtooifyouwish). 2)Runtheoutputofthe74LS175tothethe74LS47decoderfortheMAN71A.Makesureto connecttheLSBoutputofthecountertotheLSBinputofthedecoder,andnotLSBtoMSBor somethingelse. 3)ConnecttheCOUNTUPpinofthecountertotheTTLouputofthefunctiongeneratorandset therepetitionrateforabout1Hzusingyouroscilloscope.Setupadebouncedswitchwithpull upresistorsothatactuatingtheswitchpresentsalogic1signaltotheCLOCKinputofthe 74LS175latch. 4)Verifyoperationofthecircuit:Nonumbershouldappearonthedisplayuntilyouhitthe switch,enablingthelatch.Nomatterthatthefunctiongeneratorisrunning,nochangeonthe displayshouldthenoccuruntilyouactuatetheswitchagain.Presstheswitchtwicein succession5or10secondsapartandverifythatthechangeinthenumberdisplayedagreeswith whatyouexpectfromtheTTLpulserateandthetimeintervalbetweenbuttonpresses.Toavoid havingtosubtractthestartingandendingvalues,youcouldpresentalogic1signaltothe CLEARinputofthe74LS192counteraftereachcount,usingyetanotherswitchandpullup. Thedisplaywillofcoursehavetobeclearedlikethisinthefinalcircuitaftereachcharging cycleiscountedanddisplayed. PartF:CompletingtheDVM TocompletetheDVMwefinallyconnecttheanaloginput/transductionsection,the clockgenerator,thecountingsection,andthelatchanddisplaysection.Seethemarkedup drawingattheendofthiswriteup. 1)Reconnectadebouncedswitchastheinputtotheoneshotgoingtothe74LS74CLOCK input. 2)Removealltheothermanualswitchandpullupsetupsfromthecircuits.ConnecttheQ outputfromthe74LS74andalsothe555timeroutputtothetwoinputsoftheNAND.Thiswill passalongthe555pulsetrainonlyduringthecapacitorchargingphase. 3)ConnecttheoutputoftheNANDtotheCOUNTUPofthe74LS192counter.Thecounter willcountthepulsesthatcomeduringthecapacitorchargingphase. 4)Connectthe Q outputofthe74LS74totheENABLE(orCLOCK)pinofthe74LS175 latch.Thiswillcausetheresultofthecounttobelatchedintotheoutputbitsofthe74LS175 when Q goeshighattheconclusionofeachcapacitorchargingphase. 5)Inadditiontolatchingthecount,itisalsonecessarytoclearthecountereachcycle.This couldbedonesimplybyconnectingthe74LS74 Q outputtotheCLEARpinofthe74LS192 counter.Butthiswouldnotquitework,because Q isalsodoingthelatching.Wecouldn'tbe surethatthedatawaslatchedanddisplayedbeforethecounterwasclearedandtheinformation lost.Thistypeoftimingconditioniscalledalogicrace.Itissimpletoavoidconnectthe Q toCLEARafterrunningitthroughtwo74LS02inverters(NOTgates)todelayitbyabout20ns. 6)Atlast,makeafinalcheckwiththeoscilloscope:connectthecapacitorvoltagetoone channelonthescope,andthepulsetrainfromtheNANDtothesecondchannel.SetVINtosay 3voltswiththepotandthenstartameasuringcycleusingthedebouncedswitchonthe74LS74 CLOCKinput.Visuallycountthenumberofpulsesyouseeduringthecapacitorchargingtime. VaryVINandgetanideaofthenumberofpulsespervoltofVIN(ifyoufollowedinstructions,

12

itshouldbearound1). 7)Letherrun!TakeseveralreadingseachforseveralvaluesofVIN.MakeatableofVINvs. displayedcounts.Demonstratethattherelationshipislinear(therewillbesomeerrorduetothe countinguncertaintyof1puls eandtheslowpulseratechosenfora1digitdisplay.). Demonstratethatthemeasurementsarerepeatable(measure,say1V,then8V,then1Vagainand seeifyougettheresultsameasthefirsttime).Ifanyofthesethingsarefalse,explainwhy (maybeacircuitelementhasheatedduetodissipativepowerandchangeoperating characteristics?). PartFinal+extendedlab(optional) Onlyhavingaonedigitdisplayisabitofadrawback,especiallysinceweseesome variationinthisdigit.YoucaneasilyexpandittobeatwodigitdisplaybysendingtheCARRY outputofthe74LS192countertoasecondidenticallatchinganddisplaysection.Also,with twodigitsyoucancount100pulsesduringthechargingtimeratherthanonly10withasingle digit.Thereforetheclockrategeneratedbythe555shouldbeincreasedbyafactorofroughly ten.Ifyoudothispart,makeanothergraphofVINvs.countstochecktherangeandlinearity, andverifythereproducibility.

13

Fullcircuitwithsectionsoutlinedandnamed.

14

15

Das könnte Ihnen auch gefallen