PM9903BPE SAMES | Alldatasheet
Document overview
- Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
- PDF pages: 22
Technical content
FEATURES
Designedtobeusedtogetherwithaccompanying softwareasfullyfunctionalsinglephasetrivectormeter. Operationbetterthanclass1operationforactiveand class2forreactiveenergy. Twoon-boardLED’sforactiveandreactivepulseoutput. SinglePhase2wireconfiguration,230V80A(Imax). Onboardpowersupply. PM9903BPE On-boardLCD. Currentsensingviaon-boardshuntoroptionalCT. IsolatedconnectiontoPCparallelport. Easyaccessibletestpins. Micro-controllerplug-insupport Micro-controller/PCoperation
DESCRIPTION
ThisApplicationNotedescribesthePM9903BPEevaluation boardandtogetherwiththeSA9903Bdatasheetprovidesa completeevaluationplatform.TheSA9903Bisanaccuratebi- directionalpower/energymeasurementICwithserial(SPI) interfacemeasuringactiveaswellasreactivepower/energy, RMSvoltageandfrequency.Moredetailedinformation specifictotheSA9903Bcanbefoundinitsdatasheet. ThePM9903BPEmoduleisdesignedforsingle-phasetwo- wireapplications.Themainsvoltageseasilyconnecttothe modulebywayofaMolexconnector(SK1).Anon-boardshunt resistor measuresthecurrent,whileprovisionhasbeenmade toinsertacurrenttransformerinplaceoftheshunt.Asimple transformerpowersupplysuppliestheenergymeteringIC withpower.The78L05regulatorisusedtogeneratea5V supplyvoltageforthedeviceandon-boardopto-couplers. Provisionhasbeenmadetoconnectanexternal5Vpower supplytodrivetheisolatedopto-coupler. TheSA9903Bformstheenergy/powermeteringfront-endof themoduleandconnectstotheSPIbus.S capableofdriving96 segmentsona4backplaneLCD. haringtheSPIbus istheSA8807ALCDdriverwhichis ThePM9903BPEevaluationboardisconfiguredand calibratedviatheparallelportofaPC.Thedatainterface betweentheevaluationboardandthePCisfullyisolated. ThePM9903BPEmodulecaneasilybeconnectedtoamicro- controller.TheSAMESmicro-controllerboardconnectstothe evaluationmodulebymeansoftheSPIandJP3connectors therebycreatingacompletepowermeterwithoutthePC interface.Physicallythemicro-controllerboardplugsintothe evaluationmodulewithitsopto-couplerfacingthemains connector(SK1).ItsharestheSPIbuswiththeSA8807A onboardLCDcontr oller. EvaluationBoardfortheSA9903BEnergy MeteringIC Figure1:Blockdiagram SPEC-0935(REV.5) 08-03-05 SK1 Power Supply SA9903B Resistor Network VDD VSS LCD DISPLAY GND SA8807A JP1/SPI TestPins FMO VDD JP2 JP3 TestPins VDD PCVDD VSS PCVSS J12 PCVDD JP4 SK3 PCVSS PCVSS PCVSS IVP IIN IIP N L Load GND
2/22http://www.sames.co.za JUMPERSETTINGS Powersupplyjumpers Thepowersupplyjumpersareusedtodisconnecttheon- boardpowersupply,allowingthemeteringsectionofthecircuit tobepoweredfromanexternalpowersupplyifrequired. Figure2:Jumperpositions Shunt/CTselectionJumper ThePCBmakesprovisionfortheuseofacurrenttransformer inplaceoftheshunt.Ifrequiredtheshuntcanberemovedand acurrenttransformerinserted.InthiscaseJ7mustbeclosed andtheapplicableCTterminationresistor(R26)inserted. Jumper Shunt OPEN R26notrequired CT Closed R26inserted Communicationjumpers JumpersJ8toJ11connectpullupresistorstotheSPIinputs oftheSA9903B.Thepullupresistorsarerequiredbytheopen drainoutputsoftheHCPL2631opto-couplers.IfaPCisused withthePM9903BPEmodulethejumpersmustbeclosed, andcanbeleftclosedinthecaseoftheSAMESmicro- controllerboard.ThisboardiscapableofdrivingtheSPIbusin thisstate.DefaultClosed. Jumper Description J12 PB(leftconnection)-Connectsthepushbutton outputthroughaopto-couplertopin13ofthe parallelport FMO(rightconnection)-Connectspin15ofthe SA9903Bthroughaopto-couplertopin13ofthe parallelport ParallelPortpowersupplyjumper JumperJP4isusedtoselectthepowersourcefortheopto- couplerU7.PowercanbetakenfromthePC’sparallelportor fromanexternal5voltsupplyviaSK3. Jumper Description JP4 Leftconnection-PowerforU7istakenfromthe PC’s parallelport( pins1,14,16,17) Rightconnection-ConnectsU7toSK3.An externalpowersupplycanbeconnectedto SK3topowerU7. Jumper Description ConnectsVtothemeteringcircuitry. Defaultclosed DD ConnectsVtothemeteringcircuitry. Defaultclosed SS GNDconnectionpoint. Anadditionaloutputfromthemoduleismadeavailabletothe parallelportofthePC.Theoutputcanbeselectedtobethe SA9903B’sFMOoutputoritcanbeselectedtobethemodules pushbuttonoutput. sames PM9903BPE JP4 J12 J10 J11 JP1 Pushbutton SK2 PB FMO* VSS VDD Micro-controllerboard AGND SK1 L N SPI *Onsomepcb'sthismaybelabledasPB/F150,howeverFMOandF150isthesameconnection.
Figure3:PM9903BPEsetupandconnection PM9903BPE CONNECTORDESCRIPTION Jumper Description SK1 SK2 SK3 JP1 Connectsthesinglephasesupplytothemodule. FemaleBD25pinconnectstheevaluationboardto thePCbya1to1cable.Themodule isisolatedfromthePCbytheopto-couplers. parallelport 5VsupplytoU7optocoupler Thisheaderstripcanbeusedformeasuringthe I/OpinsoftheSA9903BandSA8807A.Notethat thisconnectorisonthesamepotentialasthe SA9903B.ProvisionismadeforVandV sothataboardwithamicrocontrollercanbe easilyfittedwithoutanyadditionalwiring.Signals availableonthisconnectorare: DDSS Pinnumber Signal Sa9903(U1) SA8807(U2) VDD VSS FMO SCK CS MISO MOSI CE Pin8 Pin14 Pin15 Pin12 Pin18 Pin13 Pin17 NC Pin13 Pin26 NC Pin18 NC Pin20 Pin19 Pin21 MISO-MasterInSlaveOut MOSI-MasterOutSlaveIn SETTINGUPTHEPM9903BPEMODULE Figure3belowshowsatypicalsetupforthePM9903BPE evaluationmodule.Themainsvoltageisconnecteddirectlyto SK1andthelivecurrentiswiredthroughtheon-boardshunt. AnexternalpowersupplycanbeconnectedtoSK3shouldthe PC’sparallelportnotbeabletosourceenoughcurrentforthe module'sopto-couplers. ThePM9903BPEevaluationmoduleissetupbydefaultfor operation. PleasenotewhenusingthePC themicro-controllerboardshouldbeunpluggedtopreventa SPIbuscontention,sincethePCandmicro-controllerwould beattemptingtodrivethebussimultaneously. 230V/80A Whenthehardwaresettingshavebeenverifiedtheuserhas thechoiceofusingthemicro-controllerboardoraPCto evaluatetheSA9903Bfurther. Oncetheboardhasbeenpluggedintotheevaluationmodule nofurtheractionisrequired,justapplypower. Afterremovingthemicro-controllerboardtheevaluationboard canbeconnectedtothePC’sparallelportusinga1to1 parallelcable(notsupplied).Oncetheevaluationboardhas beenconnectedtothePCandpoweredup,thesupplied softwarecanbelaunched.Refertothenextsectionforthe softwareinstallationandsetupdetails . Micro-controllerboard PC http://www.sames.co.za Load SK1 N L ToPC Parallelport SK2 VDD VSS J10 J11 J12 PB/F150 JP1 JP4 SuppSel SK3
PM9903BPEEVALUATIONSOFTWARE SoftwarefortheSA9903BPEmoduleisdesignedto communicatewiththeSA9903BPEmoduleviathePC’s parallelport.Therearetwoversions,oneforWindows 9x/NT/XPandoneforDos.Thesourcecode(C++Builderfor theWindowsversionandBorlandC++fortheDosversion)is alsoincluded. Thesourcecodeiscontainedinthe"WindowsSource.zip"file. Themostimportantfilesare: Thisfilecontainsthefunctionstowrite/readtotheSA9903 registers,writetotheLCD,metercalculationsandpulse generation. Thisfilecontainsthefunctionsforreadingtheparametersfrom theadvancedsetti ngsform(meterpulseconstant,rated voltage,etc) Alltheconstants. Thefollowingfilesareincludedonthefloppydisk: Thisfilecontainsthesourceforthefunctionsthatreadthe SA9903registers,storethesevaluesinintegrationregisters, checkforanyoverflowandgeneratethecorresponding energypulseforthePM9903BPEon-boardLED’s.The softwaredoesnotmakeuseoftimersandreliesoncounting thesoftwareloopstogeneratereasonabledelaysfortheLED outputs. ThisfilecontainsthesourceforalltheSPIinterfaceroutines whichareusedtocommunicatebetweenthePM99 03BPE moduleandthePC’sparallelport. Thisfilecontainsthesourceforallthefunctionsrelatingtothe SA8807LCDdriverIC,aswellasotherfunctionstoswitchon theLCDdisplayicons. Thisistheexecutablefile. Theprogramhastobeinstalledfirst.Runthe"SETUP.EXE" fileandfollowtheon-screeninstructions.Afterinstallation,the FileDescription:Windowssoftware FileDescription:Dossoftware RunningtheWindowssoftware MainUnit.cpp AdvancedUnit.cpp Common.h 9903mtr.c pc_spi.c pc_lcd.c 9903mtr.exe Figure4:Pulseflowdiagram programcanbelaunchedfromthewindowsmenu(Start-> Programs->PM990x->PM990x). Forinstructionsonusingtheprogram,seetheprogramshelp file(PM990x.hlp) Theprogramisexecutedbyrunningthe9903mtr.exefilewith thefollowingarguments: 9903mtr.exe RunningtheDossoftware 1/s ThefirstparameterspecifiestheLPTportaddresstouse where1=0x378(LPT1)and2=0x278(LPT2). Theoptionalsecondparameterinvokesthemeter-setup menu.Onthismenutheuserentersthemodule'srated conditions,i.e.V,Iandrequiredpulserate.This enablesthemoduletobeusedatratedconditionsotherthan thedefault.Themeter-setupmenuisinvokedautomaticallyif thesoftwaredoesn'tfindacalibrationfileintherootdirectory. Otherwisetheusercanforceametersetupbyusingthe/s optiononthecommandline. nominalmax Furtherdetailcanbefoundinthereadme.1stfileintheDOS directoryonthesupplieddisk. Generatingpulsesproportionaltothemeasured energy Figure4isaflowdiagramshowinghowtogeneratepulses proportionaltoenergymeasuredbytheSA9903B.Thespeed ofexecutionisnotcritical,althoughitwillinfluencethe resolutionofthepulsesthatisgenerated. http://www.sames.co.za Subtractpreviousvalueand Check/fixregisterwrapping Addtoactiveenergy integrator Subtractthresholdfrom integrator Waitfornext measurementcycle Dootherfunctions onmeterYes ReadActiveRegister Loadcreeptimer Nointegrator> threshold Generatepulse
Figure5:Implementationofanoverflowintegrator http://www.sames.co.za Itisrecommendedthattheflowdiagrambeimplemented togetherwithatimerinterruptusedforthecreeptiming. TheactiveandreactiveregistersontheSA9903Bincrementat arateof320000countspersecondatratedmetering conditionsforasinewave.Asinglecountoftheactiveregister correspondstoanamountofenergyexpressedinWatt seconds(Ws). Energypercountis(Ws): Epc=VxI/320000 Vnomisthemainsvoltageandcorrespondto14µAinthe voltageinputsoftheSA9903B. Imaxisthemaximummainscurrenttobemeasuredand correspondto16µAonthecurrentinputsoftheSA9903B. Thep ulseraterequiredforameterisusuallyexpressedin pulses/kWh.AsinglepulseontheLEDismostlyafractionofa kWhandisconvertedtoenergyinWs/pulse EnergyperLEDpulseis(Ws/pulse): Eppenergy=1000x3600/Mpr EppisenergyperLEDpulse Mpristhemeterpulserateormeterconstantinpulses/kWh Thethresholdiscalculatedbydividingtheenergyrepresented byaLEDpulsebytheenergyperregistercount. Activeenergythreshold=Epp/Epc Thethresholdisthustheamountofenergytobemeasured (accumulated/integrated)bythemeterbeforeaLEDpulseis generated. Thresholdandpulserates nommax where: where: Reg0addtoIntegrator Reg0addtoIntegrator Reg0addtoIntegrator Pulsethreshold Integratorzero PulseLED Thresholdvaluesubtracted PulseGenerated fromintegrator ReadingTime Metercreepcurrent FortheSA9903Bmetercreepmustbetakencareofin software.Fromtheexplanationaboveonhowtogenerate pulses,themetermustalsobepreventedfrompulsingin caseswheretheenergymeasuredislessthanthecreep thresholdasperthemeterspecification.Thecreepcurrentis definedasthelimitformeasuredenergy,anyenergylessthan thecreepthresholdisdiscarded,andenergyabovethecreep thresholdismeasured. Thesimplestwaytoimplementthecreepthresholdistorelate ittothetimebetweenmeterpulses.Ifthetimebetweenpulses ismorethanthelimit,theenergyaccumulator iscleared. Pulserateofmeteratratedconditions(Hz): Rf=(VxI/1000)x(Mpr/3600) Visthemainsvoltageandcorrespondto14µAinthe voltageinputs. Iisthemaximummainscurrenttobemeasuredand correspondto16µAonthecurrentinputsofthedevice. Mpristhemeterpulserateinpulses/kWh. Creepthresholdtime(s): Ct=1/(Cc/I)xRf Ccisthespecifiedcreepcurrent;energybelowthisvalueis discarded. Iisthemaximummainscurrenttobemeasuredand correspondto16µAonthecurrentinputsofthedevice. Rfistheratedcurrentfrequency. Theflowdiagram(figure6)forthetimerinter ruptshowshow thetimebetweenpulsesismeasured,ifthetimesincethelast pulseismorethanthetimemeasured,theintegratorisreset andanewcountdownisstarted. nommax nom max max max Where: where:
6/22http://www.sames.co.za THEMICRO-CONTROLLERBOARD OVERVIEW Thissectiondescribestheplug-inmicro-controllerboardand shouldbereadinconjunctionwiththeevaluationsoftware section,wherebasicmeteringsoftwareisdescribed.The micro-controller’ssoftwarewasdevelopedaccordingtothis section.Theboardplugsintotheevaluationmoduleas describedearlierinthisapplicationnote. Hardware Micro-controller EEPROM Keys Rateoutputs Miscellaneous TheschematicispresentedinFigure18.Ascanbeseenthe majorelementsare: micro-controller, eeprom, keys, rateLEDs/opto-isolatedratepulseoutput andmiscellaneousconnectors. APIC16F876-20/soisusedtogeneratetheratepulses,inthis applicationthemicrousesa20MHzcrystal(X1).Thisdevice has8kBFlashROM(programmemory)and368ByteRAM (datamemory).Detailinformationonthedevicecanbe obtainedintheappropriateMICROCHIPdatasheet. A93C46EEPROMprovidesstoragefornon-volatiledata, suchascalibrationfactors.Thisdevicehas1kBspace availableorstat eddifferently128x8bitwords. Fourkeysareprovidedofwhichoneisconnectedtothemicro- controller’sresetpin.Theotherthreeareavailableto implementanHMI(HumanMachineInterface)inthefirmware; they’relabelledUp/DownandEnterontheprintedcircuit board. TwoLEDsareprovidedforactiveandre-activeenergy respectively.Thesepulseoutputscanbecoupledtoanopto- couplerviaJP3/4providinganoutputforexternalusage.This output-pulseselectionisaccomplishedwithajumperonJP3/4 asfollows: Jumperonboard’soutsideedge=active Jumperonboard’scentrepi ns=re-active Jumperonboard’sinsideedge=notused ConnectorsJP1andJP2areprovidedtoeasedebugging duringcodedevelopment,allrelevantsignalsareavailable.J1 inconjunctionwithSK2arethetwoplug-inpointstothe evaluationmodule,whereSK2istheSPIconnectorandJ1 merelyastabilisingholder.Themicro-controlleris programmedviaSK1usingthecontroller’sICSP(incircuit serialprogramming)capability,asdescribedintherelevant MICROCHIPdatasheet.Iftheintentionistoprogramtheboard Starttimerinterrupt LEDON? DecrLEDtimer LEDtimer=0 LEDOFF Creeptimer>0 Decrcreeptimer Creeptimer=0 Exitinterrupt Reloadcreeptimer andresetintegrator No Yes Yes No Yes No Yes No Figure6:Idiagramnterruptflow Figure7:Micro-controllerboard
7/22http://www.sames.co.za PM9903BPE fromMICROCHIP’sPICSTART-programmerabufferneedsto beinsertedintheVlinetoboosttheprogrammer’soutput capability.AnexampleofsuchabufferisshowninFigure8. DD UserInterface MemoryUsage Asimpleinterfacehasbeenimplementedusingtwoofthe threeavailablekeys.Thetogglesdisplayof consumedkWhandkVARhunits.Thedisplayof RMSvoltageandfrequencydata. TheLCDisupdatedeachsecondbasedonthelast'key-press' value. ROM: 3452wordsor42%ofthetotalcapacity RAM: Bank78bytes Bank77bytes Bank-- Bank--or39%ofthetotalcapacity EnterKey DownKey Pleaserefertothereadme.1stfileforanyupdatedinformation notcontainedinthisapplicationnote.Thementionedfileispart ofthesourcecodethataccompaniesthismodule. Figure9:Programflow LOOP Zero crossing? Yes No No Readand process allregisters One second lapsed? Yes UpdateLCD basedon present 'key-pressed' value Figure8:Typicalbuffercircuit 2N3906 2N3819 R1 R3 R5 R2 INPUT OUTPUT >5V 820K 100R 820K1.2M Firmware SPI RateLEDs/opto-outputs Creep Themicro-controller’scodewascreatedaccordingtothe guidelinessetoutintheevaluationsoftwaresection.Itis presentedasakick-starttoexperimentationwiththemicro- controllermoduleandassuchshouldn’tbeseenastheonly possibleimplementation.ThecodewasgeneratedusingHi- TechPICC(v8.00PL1);thedemoversionontheirwwwsite (www.htsoft.com)issufficientforexperimentation.The programflowispresentedinFigure9. The16F876'sSPIhardwareisusedtoreadtheSA9903B's registers,usingnormalbytewideprotocol.Allregistersare readafterreceivingaze ro-crossing(FMO)interruptfromthe SA9903B.TheCEsignalenablestheSPIforthedisplaydriver andtheCSsignalenablestheSPIfortheSA9903B. The10mspulsewidthsontheseoutputsarederivedfroma timerinterrupt. Ifthetimebetweentwosuccessivepulsesisgreaterthana predefinedmaximum,therespectiveenergyaccumulatoris cleared.Thesimplestmethodofdecidingwhatthepredefined valueshouldbeistomeasurethetimebetweentwopulsesat thelowestpermissibleloadcurrent,thisisthenexpressedi.t.o basictimerticks. Methodofdecidingwhatthepredefinedvalueshou ldbeisto measurethetimebetweentwopulsesatthelowest permissibleloadcurrent,thisisthenexpressedi.t.obasic timerticks.
8/22http://www.sames.co.za CIRCUITDESCRIPTION ANALOGSECTION Theanalog(metering)interfacedescribedinthissectionis designedformeasuringwithprecisionbetterthan Class1. ThemostimportantexternalcomponentsfortheSA9903B integratedcircuitarethecurrentsenseresistors,thevoltage senseresistorsandthebiassettingresistor.Theresistors usedinthemeteringsectionareofthesametypetominimize anytemperatureeffects. PinVREF(SA9903Bpin3)isconnectedtoVssviaR9which determinestheonchipbiascurrent.WithR9=24koptimum conditionsareset.VREFdoesnotrequireanyadditional circuitry. BiasResistor CTTerminationResistor(whenusingaCT) CurrentSenseResistors(whenusingashunt) Ω Ω Ω Ω Ω ThevoltagedropacrosstheCTterminationresistorsR26 shouldbeatleast20mVatratedcurrent(Imax).The terminationresistorshouldbelessthantheCT’sDC resistance.BesuretoinsertJ7afterinsertingR26. For80AmeterR26=2.7 WhenR1=R2=I/16µA/2500xRSH/2 =80/16µA/2500x2.7 =2K7 Referringtofigure10theresistorsR1andR2definethe currentlevelintotheSA9903B’scurrentsenseinputs(IIPand IIN).Theresistorvaluesareselectedforaninputcurrentof 16µAintothecurrentinputsatratedconditions. AccordingtoequationdescribedintheCurrentSenseinputs sectionof thedatasheet: R1=R2=(I/16µA)xRSH/2 =80A/16µAx625µ/2 =1K56 1.6Kisselected I=LinecurrentorifaCTisusedI=linecurrent/CTRatio RSH=shuntresistance(625µ)orifaCTisusedRSH=CT terminationresistorvalue. L L where: 230V/80A Figure11:Mainsvoltagedivider VoltageDivider Referringtofigure11theconnectionsforthevoltagesense inputforonephaseisshown.ThecurrentintotheA/D converter(IVP)isset14µAatnominalmainsvoltage.This voltagesenseinputsaturatesatapproximately17µA.A nominalvoltagecurrentof14µAallowsfor20%overdriving. Eachphasevoltageisdivideddownbyavoltagedividerto14V. Thecurrentintothevoltagesenseinputissetat14µAviaa 1Mresistor. Thefollowingequationisusedtocalculatethe14Vvoltage drop: RMS RMS Ω ΩΩ Ω Ω Ω RA=R22+R23+R24 RB=R8||R13 Combiningthetwoequationsgives: (RA+RB)/230V=RB/14V A24kresistorischosenforR13anda1Mresistorisused forR8. Substitutingthesevaluesresultin: RB=23.44k RA=RBx(230V/14V-1) RA=361.6k ResistorvaluesofR22,R23andR24arechosentobe120k IfaCTisusedcapacitorsC500/C501canbeusedto compensateforphaseshiftsbetweentheSA9903’svoltage senseinputsandcurrentsenseinputs.Thevalueofthephase shiftcompensationcapacitorsarecalculatedasfollows, assumingaphaseshiftof0.18degrees. C=1/(2xxMainsfrequencyxR8xtan(Phasesh iftangle)) C=1/(2xx50Hzx1Mtan(0.18degrees)) C=1.013µF π π PM9903BPE 1MR13 24k V1In R22 120k R23 120k R24 120k GND L1 Pin19 Figure10:Currentinputconfiguration 2.7k 2.7k R26 CTLIVEIN GND Pin1 Pin2 Notinstalled LIVEOUT
9/22http://www.sames.co.za PM9903BPE PowerSupply Componentplacement GroundPlane PowerSupplyroutingandde-coupling ThePM9903BPEmoduleusesatransformerbasedpower supply.Themaximumcurrentthatcanbedrawnbythecircuit isapproximately100mA.Thenormaloperatingcurrentofthe moduleiscloserto30mA.An78L05voltageregulatorisused toregulatethevoltagefromthetransformer.Tworesistors (R500andR501)generatetheanaloggroundvoltageforthe SA9903B.TheSA9903Boperatesbetween0Vand5Vwith theGNDpinconnectedtomid-rail. ThePM9903BPEevaluationmodulerepresentsaClass1 meterandisdesignedtodemonstratethefunctionalityand performanceoftheSA9903Bmeteringintegr atedcircuits.The SA9903Bismainlytheanalogfrontendofameter.The SA9903Bmeasurestheenergy,voltageandfrequencywhich aremadeavailableviaSPItoanexternalcontroller/PC.When themeter’sPCBisdesigned,itshouldberememberedthatthe SA9903Binputsareanalogandspecialcareneedtobetaken withthepowersupplyandsignalroutingtotheSA9903B. TheSA9903Bshouldbeprotectedfromthemeasuring environment.Thisisachievedbyusingresistordividersto scalealltheSA9903B’sinputsignals.MOV'sZ1togetherwith resistorR83protectsthepowersupplytransformeras wellas thevoltagesenseinputs.Thecurrentsettingresistorsonthe currentsenseinputsattenuatesanycommonmodeand asymmetricaltransients. AlltheresistorsontheSA9903B’scurrentsenseinputsshould beplacedascloseaspossibletotheSA9903B.This eliminatesthepossibilityofanystraysignalscouplingintothe inputsignals. TheGNDpinoftheSA9903Bisconnectedtotheneutral phase,whichishalfwaybetweenVandV.Notethat supplybypasscapacitorsC1andC2arepositionedasclose aspossibletothesupplypinsoftheSA9903B,andis connectedtoasolidgroundplane.Capa citorC6isalso positionedascloseaspossibletothesupplypinsofthe SA9903Bforpropersupplybypassing. The5Vsupplyisde-coupledandrouteddirectlytothepower pinsoftheSA9903BbymeansofcapacitorC506.Carewas PCBDESIGN Protection DDSS takennottohavecurrentflowinginthenodethatconnectsthe voltagereferenceresistortoVasitmayintroducepower supplynoiseonthevoltagereferencecircuit. Thesignalroutingisdoneinsuchamannerthatanysignal couplingintothemeasuredsignalwillbeacommonmode noisesignalandissubsequentlyrejected.Careshouldbe takenthatthesignalstotheSA9903Bnotbeinfluencedby othersourcessuchaselectricfieldsfromtransformersetc. TheSAMESSA8807ALiquidCrystalDisplay(LCD)driveris capableofdrivingupto96LCDsegmentsandisdesignedfor displayshaving3or4tr ackmultiplexedbackplanes.The SA8807Aincludesanon-chiposcillatorandneedsonlya singleexternalcapacitor.CommunicationtotheSA8807Ais viatheSerialPeripheralInterface(SPI)whichissharedwith theSA9903B. ThisLCDdriverisidealforanymicro-controllerbasedsystem requiringaliquidcrystaldisplayofupto12seven-segment digits. TheSA8807Aincludesanon-chiposcillatorthatiscontrolled byasingleexternalcapacitor.Adjustingthecapacitorvalue willchangeoperatingfrequencyoftheSA8807A.Theback planemultiplexingisafunctionoftheSA8807Aopera ting frequency.Itisthusimportanttoselectthefrequencyhigh enoughthatthemultiplexingofthedisplayisnotnoticeable, butstillwithinlimitsoftheLCDdisplayreactiontime. f=7µFx0.1Hz/C f=Requiredoscillatorfrequency f/8=backplanemultiplexratefora4backplanedisplay TheSA8807AsharestheSPIinterfacewiththeSA9903Band connectsdirectlytotheopto-couplersonthePM9903BPE evaluationboard. SS SignalRouting Oscillator SPIInterface THESA8807ALCDDRIVER OVERVIEW USINGTHESA8807A
10/22http://www.sames.co.za Figure12:Mappingofasinglecharacter Table1:LCDdisplaymemorymap Table2:LCDdisplaymemorymap(continued) COM1,17 COM2,18 COM3,19 COM4,20 Blank Blank Blank T1,T2,T3,T4 Blank Blank Blank Total Hz W s h %Error imp/KWh Wh/imp V A r h 23 21 16 1522 24 13 26 11 28 9LCDPin Address 11 10 9 8 7 6 COM1,17 COM2,18 COM3,19 COM4,20 LCDPin Address 30 7 32 5 33 4 34 3 35 2 Cos Total Com Cost φ T1 36 1 a b g f e c d COM1 COM2 COM3 COM4 Cosφ Total Com Cost h Pin36 Pin35 Pin2Pin1 a b g f e c d h Pin32 Pin5 DR-01255 COLUMNS Commands Address Thedemonstrationsoftware Theaddressofthedataissetupinthefollowingmanner usesabufferinmemoryonthe PCtogeneratethecompletedisplay.Thebufferisdumpedto theLCDdriverdeviceinonego.Thedatapassedtothedriver ICisformattedwithastartingaddressfollowedbythedatafor allsegments.Thefirst8bitsisinterpretedasaddressbyteand therestofthedataissequentiallypassedasdatabytes.The addresscounteronthedriverICisincrementedevery8 clocks.TheprocedureisrepeateduntilalloftheLCDmemory isfilledup. Towritetothedevicethefollowingaddressispassed: 10A5A4A3A2A1A0 Data DatatothedeviceispassedwithMSBfirst D7D6D5D4D3D2D1D0 WereD7andD3maptopinVR[3]ofdriverandCOM4ofLCD WereD6andD2maptopinVR[2]ofdriverandCOM3ofLCD WereD5andD1maptopinVR[1]ofdriverandCOM2ofLCD WereD4andD0maptopinVR[0]ofdriverandCOM1ofLCD SeeSA8807Adatasheetformoreinformation.
11/22http://www.sames.co.za THELIQUIDCRYSTALDISPLAY Figure13:AlltheIconsandDimensionsofLCD Table3:Mappingofdisplay cos Total Com Cost φ Pin COM1 COM2 COM3 COM4 Total %Error imp/KWh Wh/imp 22 21 Hz 23 23 COM4 COM3 Table4:Mappingofdisplay(continued) Pin COM1 COM2 COM3 COM4 V A r h 15 16 W s h 17 18 COM2 COM1
12/22http://www.sames.co.za PM9903BPE SCHEMATIC Figure14:Schematicdiagramofmeteringsection Figure15:Schematicdiagramofpowersupply 220n 220n R83 10R/2W NEUTRAL CON1 Mains N L + C506 2200u/25V p s Vin1 Vout 3 78L05 R500 R501 1N4148 1N4148 1N4148 1N4148 + C507 220u/16V VDD VSS GND GND VSS JP5 JP4 VDD JP6 GND LIVE LIVEIN LIVEOut 1K6 1K6 24k 220n 220n GND GND VDD VSS 3.5795MHz DO DI CS SCK FMOF150 SCK CS_A MISO MOSI VDD VSS F150 SCK MISO CS_A MOSI CS_D TP44 TP35 TP26 TEST7 VDD8 TP99 OSCO10 VREF3 IIP2 IIN1 GND 20 IVP 19 CS 18 DI 17 TP16 16 FMO 15 VSS 14 DO 13 SCK 12 OSCI 11 SA9903B R22 120k R23 120k R24 120k 14V1 R13 24K C500 C501 OptionalJ50GND IIN IIP JP2000 HEADER8 VSS VDD VSS GND R26 CT1 A B A B B A
13/22http://www.sames.co.za PM9903BPE Figure16:SchematicdiagramofIsolatedinterface
14/22http://www.sames.co.za Figure17:SchematicdiagramofLCDandDriver
15/22http://www.sames.co.za PM9903BPE Figure18:SilkscreenPCBlayout
16/22http://www.sames.co.za PCBLAYOUT Figure19:TopPCBlayout PM9903BPE Figure20:BottomPCBlayout
17/22http://www.sames.co.za PM9903BPE COMPONENTLIST(PM9903BPEBOARD) Designator C1,C2 C16,C17,C18 C501,C500 C506 C507 CT1 D1,D2,D3,D4 L1,L2 PB1 R1,R2 R9,R13 R23,R22,R24 R26 R34,R35,R36,R37,R38,R39 R40,R41,R44,R45,R46,R47 R48,R49,R50,R51 R42,R43,R500,R501 R83 SHUNT Sk1 Sk2 Sk3 U5,U6,U7 Z1,(MOV) Value 220n 33n 100n 1µ/16V(C501optional) 2200µ/25V 220µ/16V Tz76 1N4148 LED SW-PB 1k6 24k 120k 2R7 680R 4k7 10R 80A/50mV(625µ) MAINS PC PC5V Transformer SA9903B SA8807AF 78L05 HCPL2631 3.5795MHz S10/275 Ω CapacitorMonolithicCeramic CapacitorMonolithicCeramic CapacitorMonolithicCeramic CapacitorMonolithicCeramic CapacitorElectrolyticRadial,Non-Polar CapacitorElectrolyticRadial CapacitorElectrolyticRadial Optional SiliconDiode LED3mmDiameter Microswitch,pushtomake ¼Watt,1%,MetalFilmResistor ¼Watt,1%,MetalFilmResistor ¼Watt,1%,MetalFilmResistor ¼Watt,1%,MetalFilmResistor ¼Watt,1%,MetalFilmResistor ¼Watt,5%,CarbonResistor ¼Watt,5%,CarbonResistor ¼Watt,5%,CarbonResistor ¼Watt,5%,CarbonResistor 2Watt,5%,WireWoundResistor ShuntResistor 2PinMolex,Centersquarepin,FrictionLock Db25,PCBMount,Female 2PinMolex,Centersquarepin,FrictionLock 9V,1.5VA 20PinICSocket,TulipType 44PinPLCCICSocket TO-92Package DIP8Package Crystal MetalOxideVaristor Detail Note1,a Note2 Note1,b Notes: 1.UseonlywithCT (a)elsereplacewithwire-line (b)elseleaveopen 2.ForCTvaluewillchange
18/22http://www.sames.co.za Figure21:Micro-ControllerBoardSchematic
19/22http://www.sames.co.za PM9903BPE Figure23:BottomPCBlayout Figure22:TopPCBlayout MICRO-CONTROLLERBOARD OptoOut ISP RESET S3ENTER S2DOWN S1UP Reactive Active sames RB7 RB6 RB5 RB4 RB3 RB2 RB1 F50 VDD VSS RC7 RC6 MOSI MISOSCK CS_M CS_A CS_D OSCO OSCI VSS RA5 RA4 RA3 RA2 RA0 RA0 MCLR
20/22http://www.sames.co.za Figure24:SilkscreenPCBlayout(Micro-controllerboard) PM9903BPE OptoOut ISP RESET S3ENTER S2DOWN S1UP Reactive Active JP3/4 sames RB7 RB6 RB5 RB4 RB3 RB2 RB1 F50 VDD VSS RC7 RC6 MOSI MISOSCK CS_M CS_A CS_D OSCO OSCI VSS RA5 RA4 RA3 RA2 RA0 RA0 MCLR
21/22http://www.sames.co.za PM9903BPE COMPONENTLIST(Micro-controllerboard) Resistor,1% Resistor,1% Resistor,1% Capacitor,tantalum/10V Opto-coupler,mediumspeed Resistor,1% Crystal Resistor,1% Capacitor,ceramic Capacitor,ceramic eprom,1kB Capacitor,ceramic Capacitor,ceramic Resistor,1% 3mmred Microswitch,pushtomake Microswitch,pushtomake 3pinSIPpins 8pinSIPsocket 6pinSIPpins 14pinSIPpins 2PinMolex,Centresquarepin,Frictionlock 3pinSIPpins Micro-controller AnySiPNP,e.g.SMBT3906 14pinSIPpins Microswitch,pushtomake 3mmgreen 8pinSIPsocket Microswitch,pushtomake Value 1N4148 1N4148 4N35 10k 20MHz 33k 33p 33p 93C46 100n 100n 100R....1k Active DOWN ENTER HEADER3 Holder ISP L OptoOut OutSelect PIC16F876-20/SO PNP R RESET Reactive SPIPort UP Ω Designator JP4 SK1 JP1 SK3 JP3 JP2 SK2
DISCLAIMER: TheinformationcontainedinthisdocumentisconfidentialandproprietarytoSouthAfricanMicro-ElectronicSyst ems(Pty)Ltd ("SAMES")andmaynotbecopiedordisclosedtoathirdparty,inwholeorinpart,withouttheexpresswrittenconsento fSAMES. Theinformationcontainedhereiniscurrentasofthedateofpublication;however,deliveryofthisdocumentshalln otunderany circumstancescreateanyimplicationthattheinformationcontainedhereiniscorrectasofanytimesubsequenttos uchdate. SAMESdoesnotundertaketoinformanyrecipientofthisdocumentofanychangesi ntheinformationcontainedherein,andSAMES expresslyreservestherighttomakechangesinsuchinformation,withoutnotification,evenifsuchchangeswouldr ender informationcontainedhereininaccurateorincomplete.SAMESmakesnorepresentationorwarrantythatanycircuit designedby referencetotheinformationcontainedherein,willfunctionwithouterrorsandasintendedbythedesigner. Anysalesortechnicalquestionsmaybepostedtooure-mailaddressbelow: Forthelatestupdatesondatasheets,pleasevisitourwebsite: (012)333-6021 +2712333-6021 (012)333-8071 +2712333-8071 support@sames.co.za http://www.sames.co.za. SOUTHAFRICANMICRO-ELECTRONICSYSTEMS(PTY)LTD SUBSIDIARYOFLABATAFRICA(PTY)LTD Tel: Tel:Int Fax: Fax:Int POBOX15888 LYNNEAST 0039 REPUBLICOFSOUTHAFRICA 33ELANDSTREET KOEDOESPOORTINDUSTRIALAREA PRETORIA REPUBLICOFSOUTHAFRICA http://www.sames.co.za