Home
PIC18F87J72 Single-Phase Energy Meter Reference
Contents
1. DI i E Re n i 8 I F 6ngeq ART E pi cui l 8 B B 8 xz la zm amp NI al Q nn HM en gouae dEIDEIDEISE ONDION ONOLOLAL ONJOWORGS wanan OVINI _ OLALAUYL OS aSHGNS 9007901 NIME BH 02 6 jet Zt 9L Ski v i L Wu po 6 TZ 19 L GOTVIGNI 1001 m m m A m zm Jal jo e O 5 9 9 9 9 8 8 el lol lm le lol le f le lw 5 amp L l 3 ZA m o m o m m o S 3 E 8 18 88 3 4 48 4 E 8 8 8 8 E 8 R a 8 ja 8 8 2 2011 Microchip Technology Inc DS51931A page 38 Schematic and Layouts 4 BOARD SCHEMATIC TOP SILK AND BOARDER OUTLINE 3 055 4 055 o ACTIVE REACTIVE 95 252 NON ISOLATED POWER POWER P ii J H0000000000000000000 AN PEE USB RS232 e e e e abe see 0 21 p 0 217 AE D
2. 25 VE RMS m toS deese deba Deu eiecti deseen tens 25 n d tb a ae tn 25 T P O m 25 3 14 LINE FREQUEN O Y RASA 25 Bas RAW POWER AG Tre spice uis an aiii 26 S216 ROMER AT den eee nait TE 26 3 17 POWER APRES Re dater ete Aa Ee aa 26 3 18 RAW POWER REACT eR 26 2011 Microchip Technology Inc DS51931A page 3 PIC18F87J72 Single Phase Energy Meter Reference Design 3 19 POWER EAC utatur fnt D 27 OO MINNIE TR M 27 3 21 ENERGY ACT Sn ne de arde nisi 27 BOO ENERGY ABBA er o eam ete 27 3 231 ABS es AEn LE d 28 ABS MC 28 SOBBNEBGYREACT eee cec A ae 28 3 26 PHASE COMPENSATION sens 28 OP RSE a mE cue ta f x eh 28 3 28 OFFSET V RMS nee 29 3 Sg GANERN S eta tL His SA ATE ue are LE DM 29 380 GAIN VORMS eun ccce acl cades iM DEL AED 29 3 31 OFFSET_POWER_ACT 29 2 32 GAIN POWER ACT nl ans su ek te te 29 3 33 OFFSET POWER REACT irit et ete 30 3 34 CAIN POWER REACT 30 3 35 GAIN ENERGY ACT Nee trente eic tu ue 30 3 36 GAIN ENERGY cae en statt dcc nan did 30 3 37 GAIN ENERGY REACT c octo toe idest 30 3 38 GE PULSE MID DEL ecce endende terree Ine e 31 3 39 GAIN DENR ENERGY ACT cernes 31 3 40
3. Technology Inc PIC18F87J72 SINGLE PHASE ENERGY MICROCHIP METER REFERENCE DESIGN Chapter 3 Calculation Engine and Register Description 3 1 CALCULATION ENGINE SIGNAL FLOW SUMMARY RMS voltage RMS current Active Power and Apparent Power and the calibration out put pulse are all calculated through the following process described in Figure 3 1 The calibration registers for each calculation are shown as well as the output registers 16 24 bit AZ ADC lt oc CURRENT Reactive Power gt OFFSET POWER REACT 32 GAIN 90 with COMPENSATION Be 90 8 Correction 16 24 bit 08 RENEE ON gt PHASE COMPENSATION VOLTAGE OFFSET POWER ACT 32 OFFSET V RMS 16 1 50 RMS Voltage gt MES Digital to gt lt 0 zu 02 c c Digital to gt Frequency at E zA gt lt lt OF z 5 a a i 5 lt E 5 5 i 2 lt lt 5 gt 03 0 2 Uy 5 g s 2 5 E 5 a ui amp z g 3 gt a 2 z Gi c5 z lt lt E zi z m zz 2 ra lt 5 i lt lt xx E 5 2 Lr 5 2 75 le a 2 25 2 2 Q z 3 lt o 8 5 Im gt 2 lt c E gt 2 2 lt a
4. Wa e e E 5 NENNEN 2011 Microchip Technology Inc DS51931A page 41 PIC18F87J72 Single Phase Energy Meter Reference Design A 7 BOARD BOTTOM SILK Xx2m C7 Z z 8 aj Eure r 1 e 4 lo 8 mA ur us id 1 LI 8 p III d H R43 C36 TE HL DANGER S E HIGH VOLTAGE a C17 C16 9 R22 OP EO U6 HE x in NE 06 C41 ri CE 8 2 D5 C10 R18 D7 zs D MOV1 DS51931A page 42 2011 Microchip Technology Inc Schematic and Layouts A 8 BOARD BOTTOM TRACE AND PADS ED 2 L T PIC18F87J72 Single Phase Energy Meter Reference Design NOTES DS51931A page 44 2011 Technology Inc MICROCHIP PIC18F87J72 SINGLE PHASE ENERGY METER REFERENCE DESIGN Appendix B Bill of Materials BOM TABLE B 1 BILL OF MATERIALS BOM Qty Reference Description Manufacturer Part Number 23 C1 C2 CAP 10UF 16V CERAMIC Y5V 0603 Kemet C0603C104Z4VACTU C3 C5 C6 C7 C9 C12 C18 C21 C22 C23 C24 C25 C2
5. 0 9999695 3 31 OFFSET POWER ACT Name Bits Cof OFFSET POWER ACT 32 R W Active power offset this is a straight offset not the square as with voltage and current A much larger value is needed because the power is a running sum This is a 32 bit signed value 3 32 GAIN POWER ACT Name Bits Cof GAIN POWER ACT 16 R W Active power gain to produce X W LSB The value is always less than one for example 32 767 0 9999695 2011 Microchip Technology Inc DS51931A page 29 PIC18F87J72 Single Phase Energy Meter Reference Design 3 33 OFFSET POWER REACT Name Bits Cof OFFSET POWER REACT 32 R W Reactive power offset this is a straight offset not the square as with voltage and cur rent A much larger value is needed because the power is a running sum This is a 32 bit signed value 3 34 GAIN POWER REACT Name Bits Cof GAIN POWER REACT 16 R W Reactive power gain to produce X W LSB The value is always less than one for exam ple 32 767 0 9999695 3 35 GAIN ENERGY ACT Name Bits Cof GAIN ENERGY ACT 16 R W Active energy gain to produce X Wh LSB The value is always less than one for exam ple 32 767 0 9999695 3 36 GAIN ENERGY APP Name Bits Cof GAIN ENERGY APP 16 R W Apparent energy gain to produce X VAh LSB The value is always less than one for example 32 767 0 9999695 3 37 GAIN ENERGY REACT Name Bits Cof GAIN ENERGY REACT 16 R W Reactive energy gain to produce X VARh LSB The
6. 1 METER CONSTANT 3 55 ENERGY ACT REVERSE Name Bits Cof ENERGY ACT REVERSE 32 R W This 32 bit register is the accumulated active energy in the reverse direction only The design updates the Energy register using the CF Pulse blink output count In this method the Energy registers increments every pulse by a value equal to 1 METER CONSTANT 3 56 ENERGY REACT INDUCTIVE Name Bits Cof ENERGY REACT INDUCTIVE 32 R W This 32 bit register is the accumulated reactive energy in the inductive quadrants only The design updates the Energy register using the CF Pulse blink output count In this method the Energy registers increments every pulse by a value equal to 1 METER CONSTANT DS51931A page 34 2011 Microchip Technology Inc Calculation Engine and Register Description 3 57 ENERGY REACT CAPACITIVE Name Bits Cof ENERGY REACT CAPACITIVE 32 R W This 32 bit register is the accumulated reactive energy in the capacitive quadrants only The design updates the Energy register using the CF Pulse blink output count In this method the Energy registers increments every pulse by a value equal to 1 METER CONSTANT E A o M aer f 2011 Microchip Technology Inc 0551931 35 PIC18F87J72 Single Phas
7. 2011 Microchip Technology Inc DS51931A page 25 PIC18F87J72 Single Phase Energy Meter Reference Design 3 15 RAW POWER ACT Name RAW POWER ACT Bits Cof 64 R This register is the raw active power as it represents the sum of current A D value times voltage A D value results over LINE CYC line cycles each line cycle has 128 results Each current times voltage multiplication results in a 32 bit word There are up to 256 line cycles with each line cycle being 128 results and each result being 32 bit Thus 48 bits are needed This is the register to be read during calibration for calculating the offset and gain values associated with active power OFFSET POWER ACT and GAIN POWER ACT This register is overwritten every line cycle however if the cali bration is enabled the updates will stop once the LINE line cycles have elapsed 3 16 POWER ACT Name POWER ACT Bits Cof 32 R This register is the value for active power The goal of the calibration is to get this reg ister value to equal X W LSB This is done with the OFFSET POWER ACT and GAIN POWER ACT registers When displaying the power multiply the decimal value in this register by X to get the display value in Watts This register is overwritten every LINE CYC line cycle written only once if the calibration is enabled 317 POWER APP Name POWER APP Bits Cof 32 R This is the value of the apparent power The goal of the calibration is to get this value
8. Table of Contents ijr m 7 2129176 e 7 Document EayoUt e itt eerie ae teta e n e PR EE e ede de ete eee 8 Conventions Used in this Guide ss 9 Recommended Reading 10 The Microchip Web Site cet pula ah tote se iS etta bae tbe ME ondas 10 CUSTOMER S UD PONT vote ae nr RAR 10 Document Bevision HISIOry iier ce eek eei 10 Chapter 1 Product Overview 1 1 INTRODUCTION t c toc e Code e RE le Penn 11 1 2 What the PIC18F87J72 Single Phase Energy Meter Reference Design Kit Incl des x metet ete ee eni E e eda 12 1 3 Getting Started T ME 12 Chapter 2 Hardware 2 1 OVeIVIG Wy sis doeet ctr tc adios cero t letus thee A 13 2 2 Input and Analog Front End 16 2 3 Power Supply Circuit cicer ee Romina Ua ametuer 17 Chapter 3 Calculation Engine and Register Description 3 1 Calculation Engine Signal Flow Summary 19 3 2 Complete Register List xcu odi end ORE nn 20 USC IB zr 21 BA STATUS ot RSS nase MM ME SS MN E 22 CAL CONTROL a nte eO ati RE 23 E ES rrr EE 24 Sef EINE 24 9 8 RAW RM O eine Ro td Nomen tape Dei o dete 24 3 9RAW tPA Sea 24 SI OLAS hoe Meet
9. UK Wokingham Tel 44 118 921 5869 Fax 44 118 921 5820 02 18 11 DS51931A page 50 2011 Microchip Technology Inc
10. 0 U 0 U 0 U 0 R W 0 R W 0 Reserved CAL UPDATE CAL MODE bit 7 bit 0 Legend R Readable bit W Writable bit U Unimplemented bit read as 0 Value at POR 1 Bit is set 0 Bit is cleared x Bit is unknown bit 7 3 Unimplemented Read as 0 bit 2 Reserved bit 1 CAL_UPDATE Calibration Update bit Power and energy registers are updated for LINE line cycles when cleared Bit must be set for registers to begin updating which starts on the next line cycle after bit is set 1 When CAL_MODE bit is set set CAL_UPDATE bit to enable update of power and energy registers starting on next line cycle Bit 1 Single Point Phase Correction 0 When CAL MODE bit and CAL UPDATE bit have been set CAL UPDATE bit will be cleared after the LINE line cycles At that point all registers will be updated and no further updates will be done until CAL UPDATE bit is set again or CAL MODE bit is cleared bit 0 CAL MODE Calibration Mode bit This bit enables Calibration mode 1 Calibration mode enabled 0 Calibration mode disabled Note This register is used in Multi Point and Single Point Calibration modes only 2011 Microchip Technology Inc 0551931 23 PIC18F87J72 Single Phase Energy Meter Reference Design 3 6 LINE Bits Cof LINE CYC 16 R W Number of line cycles as a power of two A setting of 0 indicates 20 or one line cycle A setting of 1 is two line cy
11. GAIN NUMR ENERGY ACT aesti be Se rer 31 FAT METER CONFIG de uite itor psa uera 31 DAS CAR o eer E rn sre MILL e d 32 3 43 MAXIMUM CURRENT tenete 32 3 44 CALIBRATION VOLTAGE screens 32 3 45 CALIBRATION CURRENT eco ance Ounce Oei e met 32 3 46 CALIBRATION FREQUENCY 2 1 t er etc tc etes 33 3 47 METER CONSTANT 33 3 48 CALIBRATION LINE CV OEE fcc en cn due LV nnn 33 3 49 DENR ENERGY ces 33 3 50 GAIN NUMR ENERGY REACT een 33 3 51 PHASE COMPENSATION 90 mens 33 3 52 CREEP THRSHOLD MINUTE e het er 34 3 53 THRSHOLD SECOND 34 3 54 ENERGY ACT FORWARD uos tote omoes 34 3 55 ENERGY ACT REVERSE scene 34 3 56 ENERGY REACT INDUCTIVE seen 34 3 57 ENERGY CAPACITIVE nes 35 DS51931A page 4 2011 Microchip Technology Inc Appendix Schematic and Layouts MI rm 37 A 2 Schematics and PCB Layout 37 A S Board SCM IMAC cad pa sedent cbs 38 A 4 Board Schematic Top Silk and Boarder Outline 39 A5 Board Top Silk asset pei get ect e ina 40 A 6 Board Top Trace and Pads ei oet e gues ded ete 41 A 7 Board Bottom Silk e a kg sa denen ere ddnde 42 A 8 Board Bottom Trace and Pads sss 43 Appendix B Bill of Materials BOM Worldwide Sale
12. Tel 86 29 8833 7252 Fax 86 29 8833 7256 China Xiamen Tel 86 592 2388138 Fax 86 592 2388130 China Zhuhai Tel 86 756 3210040 Fax 86 756 3210049 ASIA PACIFIC India Bangalore Tel 91 80 3090 4444 Fax 91 80 3090 4123 India New Delhi Tel 91 11 4160 8631 Fax 91 11 4160 8632 India Pune Tel 91 20 2566 1512 Fax 91 20 2566 1513 Japan Yokohama Tel 81 45 471 6166 Fax 81 45 471 6122 Korea Daegu Tel 82 53 744 4301 Fax 82 53 744 4302 Korea Seoul Tel 82 2 554 7200 Fax 82 2 558 5932 or 82 2 558 5934 Malaysia Kuala Lumpur Tel 60 3 6201 9857 Fax 60 3 6201 9859 Malaysia Penang Tel 60 4 227 8870 Fax 60 4 227 4068 Philippines Manila Tel 63 2 634 9065 Fax 63 2 634 9069 Singapore Tel 65 6334 8870 Fax 65 6334 8850 Taiwan Hsin Chu Tel 886 3 6578 300 Fax 886 3 6578 370 Taiwan Kaohsiung Tel 886 7 213 7830 Fax 886 7 330 9305 Taiwan Taipei Tel 886 2 2500 6610 Fax 886 2 2508 0102 Thailand Bangkok Tel 66 2 694 1351 Fax 66 2 694 1350 EUROPE Austria Wels Tel 43 7242 2244 39 Fax 43 7242 2244 393 Denmark Copenhagen Tel 45 4450 2828 Fax 45 4485 2829 France Paris Tel 33 1 69 53 63 20 Fax 33 1 69 30 90 79 Germany Munich Tel 49 89 627 144 0 Fax 49 89 627 144 44 Italy Milan Tel 39 0331 742611 Fax 39 0331 466781 Netherlands Drunen Tel 31 416 690399 Fax 31 416 690340 Spain Madrid Tel 34 91 708 08 90 Fax 34 91 708 08 91
13. channel 0 signal size is 340 mVpgay for 20A or twice the rated maximum current of the meter still within the input range of the A D converter of the PIC18F87J72 150 FB Note 1 0 LINE SHUNTI gt AN e Shunt 7 external to PCB part of meter case 150 FB Note 1 0 LINE SHUNT2 gt PIC18F87J72 330 330 oo Y NEUTRAL gt AM 1 0 1 0 ANN e NV Note FB ferrite beads Ferrite beads have an impedance of the specified value at 100 MHz FIGURE 2 4 Analog Input Circuitry DS51931A page 16 2011 Microchip Technology Inc Hardware 2 3 POWER SUPPLY CIRCUIT The power supply circuit for the PIC18F87J72 Single Phase Energy Meter Reference Design uses a half wave rectified signal a single 5V voltage regulator and a 3 3V LDO 9V Pow DO NOT OSE W 2 JS CONNECTED TO MAINS FON 150 FB 1 uF 4700 gt IN OUT N 470 uF 470 uF GND 100nF 10 L gt o NY NY NY NY Vw 45V 3 3V 1 N OUT 1700 100 nF anp 100 nF SG gt FIGURE 2 5 Low Cost Power Supply Circuit 2011 Microchip Technology Inc DS51931A page 17 PIC18F87J72 Single Phase Energy Meter Reference Design NOTES DS51931A page 18 2011
14. listing of seminars and events listings of Microchip sales offices distributors and factory representatives CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels Distributor or Representative Local Sales Office Field Application Engineer FAE Technical Support Customers should contact their distributor representative or field application engineer FAE for support Local sales offices are also available to help customers A listing of sales offices and locations is included in the back of this document Technical support is available through the web site at http support microchip com DOCUMENT REVISION HISTORY Revision A March 2011 nitial Release of this Document DS51931A page 10 2011 Microchip Technology Inc PIC18F87J72 SINGLE PHASE ENERGY MICROCHIP METER REFERENCE DESIGN Chapter 1 Product Overview 1 1 INTRODUCTION The PIC18F87J72 Single Phase Energy Meter Reference Design is a fully functional single phase meter based on the highly integrated PIC18F87J72 single chip energy meter IC This low cost design does not use any transformers and requires few exter nal components The PIC18F87J72 directly drives the LCD and includes both an iso lated USB connection and a non isolated RS 232 interface for meter calibration and access to the device power calculations The system calculates active energy active power reactive energy reactive power RMS curren
15. x gt E 3 gt t e e ge ju A 2 5 O a c E lt 5 2 gt Q lt rai x lt lt c gt gt oc gt tr 5 9 2 z it 9 z o z B a FIGURE 3 1 PIC18F87J72 Calculation Engine Signal Flow 2011 Microchip Technology Inc 0551931 19 PIC18F87J72 Single Phase Energy Meter Reference Design 3 2 COMPLETE REGISTER LIST TABLE 3 1 INTERNAL REGISTER SUMMARY Name Bits R W Description MODE 8 R W Configuration register for operating mode of the meter STATUS 8 STATUS register CAL CONTROL 8 R W Configuration register for calibration control LINE CYC 16 R W 2 number of line cycles to be used during energy accumulation LINE 16 Counter for number of line cycles RAW2 RMS 64 R Raw RMS value from the current A D converter in LSBs RAW RMS 16 Raw RMS value from the current A D converter in LSBs RMS 16 RMS value of the current post Calibration RAW2 V RMS 64 R Raw RMS value from the voltage A D converter in LSBs RAW V RMS 16 Raw RMS value from the voltage A D converter in LSBs V RMS 16 R RMS value of the voltage post Calibration LINE FREQUENCY 16 Line Frequency RAW POWER ACT 64 Active Pow
16. 095 GAIN DENR ENERGY ACT 8 R W Active Energy Pulse Output correction factor GAIN NUMR ENERGY ACT 16 R W Active Energy Pulse Output correction factor MODE1 DEF 16 R W Power Up Configuration Register CAL STATUS 16 R W Calibration Status DS51931A page 20 2011 Microchip Technology Inc Calculation Engine and Register Description TABLE 3 1 INTERNAL REGISTER SUMMARY CONTINUED Name Bits R W Description MAXIMUM CURRENT 16 R W Maximum current of the meter Imax CALIBRATION VOLTAGE 16 R W Calibration Voltage of the meter Vc CALIBRATION CURRENT 16 R W Calibration Current of the meter Ica CALIBRATION FREQUENCY 16 R W Calibration Frequency of the meter METER CONSTANT 16 R W Meter Constant in imp kWh or imp kVARh CALIBRATION LINE CYCLE 16 R W Number of line cycles for calibration GAIN DENR ENERGY REACT 8 R W Reactive Energy Pulse Output correction factor GAIN NUMR ENERGY REACT 16 R W Reactive Energy Pulse Output correction factor PHASE COMPENSATION 90 8 R W Phase delay for Reactive Power CREEP THRSHOLD MINUTE 8 R W Load threshold time minutes CREEP THRSHOLD SECOND 8 R W Load threshold time seconds ENERGY ACT FORWARD 32 R W Forward Active Energy ENERGY ACT REVERSE 32 R W Reverse Active Energy ENERGY REACT INDUCTIVE 32 R W Inductive Reactive Energy ENERGY_REACT_CAPACITIVE 32 R
17. 55 Boston Westborough MA Tel 774 760 0087 Fax 774 760 0088 Chicago Itasca IL Tel 630 285 0071 Fax 630 285 0075 Cleveland Independence OH Tel 216 447 0464 Fax 216 447 0643 Dallas Addison TX Tel 972 818 7423 Fax 972 818 2924 Detroit Farmington Hills MI Tel 248 538 2250 Fax 248 538 2260 Indianapolis Noblesville IN Tel 317 773 8323 Fax 317 773 5453 Los Angeles Mission Viejo CA Tel 949 462 9523 Fax 949 462 9608 Santa Clara Santa Clara CA Tel 408 961 6444 Fax 408 961 6445 Toronto Mississauga Ontario Canada Tel 905 673 0699 Fax 905 673 6509 ASIA PACIFIC Asia Pacific Office Suites 3707 14 37th Floor Tower 6 The Gateway Harbour City Kowloon Hong Kong Tel 852 2401 1200 Fax 852 2401 3431 Australia Sydney Tel 61 2 9868 6733 Fax 61 2 9868 6755 China Beijing Tel 86 10 8528 2100 Fax 86 10 8528 2104 China Chengdu Tel 86 28 8665 5511 Fax 86 28 8665 7889 China Chongqing Tel 86 23 8980 9588 Fax 86 23 8980 9500 China Hong Kong SAR Tel 852 2401 1200 Fax 852 2401 3431 China Nanjing Tel 86 25 8473 2460 Fax 86 25 8473 2470 China Qingdao Tel 86 532 8502 7355 Fax 86 532 8502 7205 China Shanghai Tel 86 21 5407 5533 Fax 86 21 5407 5066 China Shenyang Tel 86 24 2334 2829 Fax 86 24 2334 2393 China Shenzhen Tel 86 755 8203 2660 Fax 86 755 8203 1760 China Wuhan Tel 86 27 5980 5300 Fax 86 27 5980 5118 China Xian
18. 7 C29 C30 C32 C33 C34 C36 C40 1 C4 CAP 1 0UF 630V METAL POLYPRO 5 Inc B32614A6105J008 2 C8 C19 CAP CER 10UF 6 3V X5R 0603 Murata GRM188R60J106ME47D Manufacturing Co Ltd 2 C10 C38 CAP 470UF 25V ELECT FC SMD Panasonic ECG EEV FC1E471P 5 C13 CAP CER 47000PF 25V 10 X7R Murata GRM188R71E473KA01D C14 C16 0603 Manufacturing Co Ltd C17 2 C15 C20 CER 18PF 50V 5 COG 0603 Murata GRM1885C1H180JA01D Manufacturing Co Ltd 4 C26 C28 CAP CER 6800PF 50V 5 COG 1206 Murata GRM3195C1H682JA01D C31 C35 Manufacturing Co Ltd 1 C39 CAP CERAMIC 6 8UF 6 3V X5R Kemet C0805C685K9PACTU 0805 1 C41 CAP 10UF 16V ELECT FC SMD Panasonic ECG EEE FC1C100R 10 CP1 CP2 DO NOT INSTALL CP3 4 TP2 4 TP5 6 TP7 1 D1 DO NOT INSTALL 4 D2 D3 LED 1 6X0 8MM 625NM RED CLR Kingbright Electronics APT1608EC D8 D9 SMD Co Ltd 3 104 05 D6 DIODE SCHOTTKY 40V 1A SMB ON Semiconductor MRA4005T3G 1 107 DIODE ZENER 15V 1 5W SMA ON Semiconductor BZG03C15G 1 CONN DSUB 9POS STR PCB D09S24A4GVOOLF SLD 1 J2 CONN POWERJACK MINI R A T H CUI Inc PJ 102B 2 143 44 DO NOT INSTALL 1 1495 CONN MINI USB RCPT RA TYPE Tyco Electronics 1734035 2 SMD Note 1 The components listed in this Bill of Materials are representative of the PCB assembly The released BOM used in manufacturing uses all RoHS compliant components 2011 Microchip Technolog
19. ANGER 5 CONNECTING 1 P1 92 OR 1 8 N NON ISOLATED MAY CAUSE EXTERNAL l EQUIPMENT DAMAGE swt AND SHOCK HAZARD C z3 gt 8 KI 2 DANGER HIGH VOLTAGE HIGH e LOW 8 e nutus METER 9 1 1 2011 Technology Inc DS51931A page 39 PIC18F87J72 Single Phase Energy Meter Reference Design A 5 BOARD TOP SILK 3 i y J5 TX RX mii NON ISOLATED e 9V IN NON ISOLATED RX TX iraj REACTIVE POWER J3 ACTIVE EHD 5 232 ISOLATED ic ISOLATED e MS USB RS232 0000 s 0000 WE v n T i DANGER Siow CONNECTING TO 91 P1 92 OR TP1 MAY CAUSE EXTERNAL EQUIPMENT DAMAGE AND SHOCK HAZARD A DANGER ee LE SHUNT 1 SHUNT 2 HIGH o e pPicier87y72 SHOT ME METER 02 0 DS51931A page 40 2011 Technology Inc Schematic and Layouts A 6 BOARD TOP TRACE AND PADS e 0 6 6 0 P B uil a J e 60 0 2 gt o 5 E Ho 00 000000000090 9909 00 Paty l Em KET gt 0 0 0 0 e 9 9 0 Z7 p Er EE
20. Converter Mini USB Connector MCP2200 ISOLATED RC3 SCK SCK RC4 SDI SDO RC5 SDO SDI RA1 CS 25LC256 SPI EEPROM FIGURE 2 3 Digital Connections 2011 Microchip Technology Inc DS51931A page 15 PIC18F87J72 Single Phase Energy Meter Reference Design 2 2 INPUT AND ANALOG FRONT END The PIC18F87J72 Single Phase Energy Meter Reference Design comes populated with components designed for 220V line voltage At the bottom of the main board are the high voltage line and neutral connections There are four connections that are made from the PCB to the meter casing They are labeled LINE NEUTRAL SHUNT 1 and SHUNT2 The shunt sits on the high or line side of a two wire system and the meter employes a hot or live ground The wires going into the shunt to SHUNT1 and SHUNT2 should be twisted together The wires going into the LINE and NEUTRAL side of the meter should be twisted together and also kept away from the SHUNT1 and SHUNT2 wires if possible The neutral side of the two wire system goes into a resistor divider on the voltage chan nel input Anti aliasing low pass filters will be included on both differential channels The voltage channel uses two 332 kO resistors to achieve a divider ratio of 664 1 For a line voltage of 230 Vans the channel 1 input signal size will be 490 mVpgay The cur rent channel of each phase uses current transformer with a turns ratio of 2000 1 and burden resistance of 56 4 The resulting
21. ER R W 0 R W 0 R W 0 U 0 U 0 R W 0 R W 0 R W 0 PHASE COMP OFFSET RMS OFFSET V R GAIN 1 RMS GAIN V RMS OFFSET ENSATION MS POWER ACT bit 15 bit 8 U 0 R W 0 U 0 U 0 U 0 R W 0 U 0 U 0 GAIN POWER GAIN POWER ACT _REACT bit 7 bit 0 Legend R Readable bit W Writable bit U Unimplemented bit read as 0 n Value at POR 1 Bit is set 0 Bit is cleared x Bit is unknown bit 15 0 All bits Calibration Register Status bits 1 This register has been calibrated 0 2 _ This register is NOT calibrated 3 43 MAXIMUM CURRENT Name Bits Cof MAXIMUM_CURRENT 16 R W This register holds the maximum current for the meter Imax 3 44 CALIBRATION VOLTAGE Name Bits Cof CALIBRATION VOLTAGE 16 R W This register holds the calibration voltage of the meter Vc 3 45 CALIBRATION CURRENT Name Bits Cof CALIBRATION CURRENT 16 R W This register holds the calibration current of the meter Ica DS51931A page 32 2011 Technology Inc Calculation Engine and Register Description 3 46 CALIBRATION FREQUENCY Name Bits Cof CALIBRATION FREQUENCY 16 R W This register holds the calibration frequency of the meter 3 47 METER CONSTANT Name Bits Cof METER CONSTANT 16 R W This register holds the meter constant in imp kWh or imp kVARh 3 48 CALIBRATION LINE CYCLE Name Bits Cof CALIBRATION FREQUENCY 16 R W This register holds the number of li
22. FX1000 1 R22 DO NOT INSTALL 1 R23 RES 10 0K OHM 1 10W 196 0603 ROHM Ltd MCRO3EZPFX1002 SMD 2 R24 R25 RES 330K OHM 1 4W 5 1206 SMD Stackpole RMCF 1 8 330K 5 R Electronics Inc 3 R26 R27 RES SMT 470 OHM 1 10W 5 0603 Panasonic ECG ERJ 3GEYJ471V R28 2 R29 R30 RES 2 70K OHM 1 10W 1 0603 ROHM Ltd MCRO3EZPFX2701 SMD 1 R33 RES SMT 270 1 10W 5 0603 Panasonic ECG ERJ 3GEYJ271V 1 R34 RES SMT 120 OHM 1 10W 596 0603 Panasonic ECG ERJ 3GEYJ121V 2 R37 R38 RES 1 00K OHM 1 8W 1 0805 SMD ROHM Co Ltd MCR10EZHF1001 2 R39 R44 DO NOT INSTALL 2 R40 R43 RES 10 0 OHM 1 10W 1 0603 SMD ROHM Co Ltd MCROSEZPFX10RO0 2 R41 R42 RES 1 0K OHM 1 1 4W 0805 SMD Susumu Co Ltd RGH2012 2E P 102 B 3 SW1 SWITCH TACT 6MM 230GF OMRON B3S 1002 BY OMZ SW2 SW3 H 4 3MM Note 1 The components listed in this Bill of Materials are representative of the PCB assembly The released BOM used in manufacturing uses all RoHS compliant components DS51931A page 46 2011 Microchip Technology Inc Bill of Materials TABLE B 1 BILL OF MATERIALS BOM CONTINUED Qty Reference Description Manufacturer Part Number 1 TP1 Wire Test Point 0 3 Length Component Corporation PJ 202 30 1 U1 DO NOT INSTALL 1 102 MCP2200 USB to UART Serial Microchip Technology MCP2200 I SS Converter Inc 1 U3 IC EE
23. MICROCHIP 1 18 87 72 Single Phase Energy Meter Reference Design Note following details of the code protection feature on Microchip devices Microchip products meet the specification contained in their particular Microchip Data Sheet Microchip believes that its family of products is one of the most secure families of its kind on the market today when used in the intended manner and under normal conditions There are dishonest and possibly illegal methods used to breach the code protection feature of these methods to our knowledge require using the Microchip products in a manner outside the operating specifications contained in Microchip s Data Sheets Most likely the person doing so is engaged in theft of intellectual property Microchip is willing to work with the customer who is concerned about the integrity of their code Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code Code protection does not mean that we are guaranteeing the product as unbreakable Code protection is constantly evolving We at Microchip are committed to continuously improving the code protection features of our products Attempts to break Microchip s code protection feature may violation of the Digital Millennium Copyright Act If such acts allow unauthorized access to your software or other copyrighted work you may have a right to sue for relief under that Act Infor
24. PROM 256 KBIT 10 MHZ Microchip Technology 25AA256 I SN 8 SOIC Inc 2 U4 U7 PHOTOCOUPLER DARL OUT Sharp Electronic PC365NJ0000F 4 SMD Corporation 1 U5 OPTOCOUPLER DUAL BI 15MBD Avago Technologies ACSL 6210 00RE 8 SOIC 1 196 IC REG LDO 800MA 5 0V SOT 223 National Semiconductor LM1117MP 5 0 NOPB 1 198 PIC18F Microcontroller with 32K Microchip Technology 8 87 72 80 bytes of Flash 2048 bytes of RAM Inc 1 U10 IC DRVR RCVR MULTCH RS 232 Texas Instruments MAX3232CDBR 16 SSOP 1 X1 CRYSTAL 10 0000 MHZ 10PF SMD _ Abracon Corporation ABM3B 10 000MHZ 10 1 U T 1 RESONATOR 12 0 MHZ CERAMIC Murata Manufacturing CSTCE12MO0G55 RO Co Ltd Note 1 The components listed in this Bill of Materials are representative of the PCB assembly The released BOM used in manufacturing uses all RoHS compliant components 2011 Microchip Technology Inc DS51931A page 47 PIC18F87J72 Single Phase Energy Meter Reference Design NOTES DS51931A page 48 2011 Technology Inc PIC18F87J72 Single Phase Energy Meter Reference Design NOTES 2011 Microchip Technology Inc 0551931 49 MICROCHIP Worldwide Sales and Service AMERICAS Corporate Office 2355 West Chandler Blvd Chandler AZ 85224 6199 Tel 480 792 7200 Fax 480 792 7277 Technical Support http Awww microchip com support Web Address www microchip com Atlanta Duluth GA Tel 678 957 9614 Fax 678 957 14
25. W Capacitive Reactive Energy 3 3 MODE The MODE register controls the operation of the energy meter The bit functions are defined by the table below REGISTER 3 1 MODE REGISTER U 0 U 0 U 0 U 0 R W 0 R W 0 R W 0 R W 0 CREEP PHASE ABSOLUTE CF bit 7 bit O Legend R Readable bit W Writable bit U Unimplemented bit read as 0 Value at POR 1 Bit is set 0 Bit is cleared x Bit is unknown bit 7 4 Unimplemented Read as 0 bit 3 CREEP No Load Threshold bit 1 2 Enabled 0 Disabled bit 2 PHASE Phase bit 1 2 Single Point Phase Correction 0 2 Multi Point Phase Correction future bit 1 ABSOLUTE Positive Only Energy Accumulation Mode bit 1 2 Positive energy only 02 Both negative and positive energy accumulated negative energy is subtracted bit 0 CF Active Energy CF Phase Enable bit 1 Phase is enabled to be accumulated into the total energy registers or CF pulse output 0 Phase is DISABLED and is not accumulated into the total energy registers or CF pulse output 2011 Microchip Technology Inc DS51931A page 21 PIC18F87J72 Single Phase Energy Meter Reference Design 3 4 STATUS The STATUS register contains the operational status of the energy meter The bit functions are defined in the table below REGISTER 3 2 STATUS REGISTER U 0 U 0 U 0 U 0 U 0 R U 0 U 0 PH_S
26. bit 7 bit 0 Legend Readable bit W Writable bit U Unimplemented bit read as 0 Value at POR 1 Bit is set 0 Bit is cleared X Bit is unknown bit 7 3 Unimplemented Read as 0 bit 2 PH_S Phase Sign bit 1 CT may be in backward if enabled 0 Operation normal bit 1 0 Unimplemented Read as 0 DS51931A page 22 2011 Microchip Technology Inc Calculation Engine and Register Description 35 CAL CONTROL This is the CAL CONTROL Calibration mode control register Bit 0 enables the Cali bration mode In this mode the power meter operates as normal but no updates are made to the voltage current power or energy registers as long as bit 1 is low When bit 1 is set high the registers are updated for LINE CYC line cycles only power and energy registers are updated After this time bit 1 is set low by the PIC18F87J72 and the update of the registers will stop This allows the calibration software to set bit O clear the registers set bit 1 and start reading the desired registers as well as the CAL CONTROL register to check the status of bit 1 When bit 1 goes low the LINE line cycles have passed and the registers are final Note that bit 0 takes effect immediately and bit 1 will take effect on the very next line cycle When bit 1 goes low all registers will be ready to read REGISTER 3 3 CAL CONTROL REGISTER U 0 U 0 U
27. cles 21 a setting of 2 is four line cycles 22 up to a setting of eight which is 256 line cycles When written this register will not take effect until the previous number of line cycles has been acquired 3 7 LINE CNT Name Bits Cof LINE CONT 16 This register counts from 0 and finishes at 2 t NE 1 Then re starts at 0 where LINE CYC represents the value in the LINE CYC register 3 8 2 RMS Name Bits Cof RAW2 RMS 64 R This register is the square of the raw RMS value from the current A D converter in LSBs By definition this register will always contain a positive value including the sit uation where power is negative from a backwards CT or otherwise This register is overwritten every LINE line cycle written only once if the calibration is enabled 3 9 RAW I RMS Name Bits Cof RAW RMS 16 R This register is the raw RMS value from the current A D converter in LSBs square root of the top 32 bits of RAW2 RMS OFFSET RMS By definition this register will always contain a positive value even if the CT is in backwards This register is over written every LINE CYC line cycle written only once if the calibration is enabled 3 40 RMS Name Bits Cof RMS 16 R This register is the RMS value of phase A current in X A LSB as determined by the value in the GAIN RMS register When displaying the RMS current multiply the dec imal value in these registers by X to ge
28. e Energy Meter Reference Design NOTES DS51931A page 36 2011 Microchip Technology Inc AN PIC18F87J72 SINGLE PHASE ENERGY MICROCHIP METER REFERENCE DESIGN Appendix A Schematic and Layouts A 1 INTRODUCTION This appendix contains the following schematics and layouts for hardware revision two of the PIC18F87J72 Energy Meter Reference Design Board Schematic Board Schematic Board Top Silk Board Top Trace and Pads Board Bottom Silk Board Bottom Trace and Pads 2 SCHEMATICS AND PCB LAYOUT The layer order is shown in Figure A 1 Top Layer 7f Bottom Layer FIGURE A 1 Layer Order 2011 Microchip Technology Inc 0551931 37 BOARD SCHEMATIC PIC18F87J72 Single Phase Energy Meter Reference Design A 3 al te tte shel a Ret Sjulog 1501 FF 1 171838121 al of TAARE EB i n ele bbb bh e ey E E at rosier l enm RE 2 440108 2 7 8381019
29. e delay signed 8 bit value provides the phase compensation by sampling time 2 3 27 OFFSET RMS Name Bits Cof OFFSET RMS 16 R W Square of the offset for RMS current reading signed 16 bit value Note that this value should be similar to the ADCs noise squared At a gain of 1 the noise will be about 1 LSB 2LSBs at a gain of 2 6 LSBs at a gain of 8 11 LSBs at a gain of 16 and 22 LSBs at a gain of 32 There may be other sources of noise Using the square of the offset allows for higher accuracy The value will be added before the square root is taken when calculating the final RMS value DS51931A page 28 2011 Microchip Technology Inc Calculation Engine and Register Description 3 28 OFFSET V RMS Name Bits Cof OFFSET V RMS 16 R W Square of offset for RMS voltage reading signed 8 bit value Note that this value should be similar to the ADCs noise squared For the voltage channel the noise will be about 1 LSB There may be other sources of noise Using the square of the offset allows for higher accuracy The value will be added before the square root is taken when calculating the final RMS value 3 29 GAIN RMS Name Bits Cof GAIN RMS 16 R W Current gain to produce X A LSB The value is always less than one for example 32 767 0 9999695 3 30 GAIN V RMS Name Bits Cof GAIN V RMS 16 R W Voltage gain to produce 0 1 V LSB in the V RMS register The value is always less than one for example 32 767
30. en every LINE line cycle written only once if the calibration is enabled 3 21 ENERGY ACT Name Bits Cof ENERGY ACT 32 R RAW ENERGY ACT 64 R The design updates the Energy register using the CF Pulse blink output count In this method the Energy registers increments every pulse by a value equal to 1 METER CONSTANT ENERGY ENEGRY W 1I METER CONSTANT The gain calibration registers GAIN NUMR ENERGY ACT and GAIN DENR ENERGY ACT hold good for this method also 3 22 ENERGY APP Name Bits Cof ENERGY APP 32 R RAW ENERGY APP 64 R These two registers represent the total apparent energy accumulated so far 2011 Microchip Technology Inc DS51931A page 27 PIC18F87J72 Single Phase Energy Meter Reference Design 3 23 ABS MAX Name Bits Cof ABS MAX 8 R NOT IMPLEMENTED IN THIS FIRMWARE SOFTWARE RELEASE 3 24 V ABS MAX Name Bits Cof V ABS MAX 8 R W NOT IMPLEMENTED IN THIS FIRMWARE SOFTWARE RELEASE 3 25 ENERGY REACT Name Bits Cof ENERGY REACT 32 R RAW ENERGY REACT 64 R The design updates the reactive energy registered using the CF Pulse blink output count too In this method the Energy registers increments every pulse by a value equal to 1 METER CONSTANT ENERGY REACT ENERGY REACT 1I METER CONSTANT The gain calibration registers GAIN NUMR ENERGY ACT and GAIN DENR ENERGY ACT hold good for this method also 3 26 PHASE COMPENSATION Name Bits Cof PHASE COMPENSATION 8 R W Phas
31. entions DOCUMENTATION CONVENTIONS Description Represents Examples Arial font Italic characters Referenced books MPLAB IDE User s Guide Emphasized text is the only compiler Initial caps A window the Output window A dialog the Settings dialog A menu selection select Enable Programmer Quotes A field name in a window Save project before build dialog Underlined italic text with A menu path File gt Save right angle bracket Bold characters A dialog button Click OK A tab Click the Power tab N Rnnnn A number in verilog format where N is the total number of digits R is the radix and n is a digit 40010 2 hF1 Text in angle brackets A key on the keyboard Press Enter F1 Courier New font Plain Courier New Sample source code define START Filenames autoexec bat File paths c mcci8 h Keywords _asm _endasm static Command line options Opa Bit values 0 1 Constants OxFF A Italic Courier New A variable argument file o Where file can be any valid filename Square brackets Optional arguments mcci8 options file options Curly brackets and pipe character Choice of mutually exclusive arguments an OR selection errorlevel 011 Ellipses Replaces repeated text var_name var_name Represents code s
32. er 32 R Final Active Power units in watts W POWER APP 32 Final Apparent Power units in volt amperes VA RAW POWER REACT 64 Reactive Power 32 R Final Reactive Power units in volt amperes reactive VAR PERIOD 32 register ENERGY ACT 32 R Active Energy accumulated RAW ENERGY ACT 64 R Raw Active Energy accumulated ENERGY APP 32 Apparent Energy accumulated RAW ENERGY APP 64 R Raw Apparent Energy accumulated ABS MAX 8 R Not implemented V ABS MAX 8 R Notimplemented ENERGY REACT 32 R Final Reactive Energy accumulated RAW ENERGY REACT 64 Final Reactive Energy accumulated PHASE COMPENSATION 8 R W Phase compensation between voltage and current OFFSET RMS 16 R W Offset adjustment for RMS current reading OFFSET V RMS 16 R W Offset adjustment for RMS voltage reading GAIN RMS 16 R W Gain adjustment for RMS current GAIN V RMS 16 R W Gain adjustment for RMS voltage OFFSET POWER ACT 32 R W Active Power offset GAIN POWER ACT 16 R W Active Power gain adjust OFFSET POWER REACT 32 R W Offset correction for Reactive Power GAIN POWER REACT 16 R W Reactive Power gain adjust to produce X VAR LSB GAIN ENERGY ACT 16 R W Not implemented GAIN ENERGY APP 16 R W Not implemented GAIN ENERGY REACT 16 R W Not implemented CF PULSE WIDTH 8 R W Defines CF pulse width from 0 to 255 x 0 8192 ms 0 2
33. mation contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates It is your responsibility to ensure that your application meets with your specifications MICROCHIP MAKES REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED WRITTEN OR ORAL STATUTORY OR OTHERWISE RELATED TO THE INFORMATION INCLUDING BUT NOT LIMITED TO ITS CONDITION QUALITY PERFORMANCE MERCHANTABILITY OR FITNESS FOR PURPOSE Microchip disclaims all liability arising from this information and its use Use of Microchip devices in life support and or safety applications is entirely at the buyer s risk and the buyer agrees to defend indemnify and hold harmless Microchip from any and all damages claims Suits or expenses resulting from such use No licenses are conveyed implicitly or otherwise under any Microchip intellectual property rights QUALITY MANAGEMENT SYSTEM CERTIFIED BY DNV ISO TS 16949 2002 Trademarks The Microchip name and logo the Microchip logo dsPIC KEELOQ KEELOQ logo MPLAB PIC PlCmicro PICSTART PIC logo rfPIC and UNI O are registered trademarks of Microchip Technology Incorporated in the U S A and other countries FilterLab Hampshire HI TECH C Linear Active Thermistor MXDEV MXLAB SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U S A Analog fo
34. ne cycles used during the calibration 3 49 GAIN DENR ENERGY REACT Name Bits Cof GAIN DENR ENERGY REACT 8 R W 8 bit signed value Represents the number of shifts for reactive power energy register before GAIN NUMR ENERGY REACT is applied 3 50 GAIN NUMR ENERGY REACT Name Bits Cof GAIN NUMR ENERGY REACT 16 R W Reactive power gain to produce a specified pulse per VAR hour The value is always less than one for example 32 767 0 9999695 3 51 PHASE COMPENSATION 90 Name Bits Cof PHASE COMPENSATION 90 8 R W Phase delay for reactive power signed 8 bit value sampling time 2 us 2011 Microchip Technology Inc 0551931 33 PIC18F87J72 Single Phase Energy Meter Reference Design 3 52 CREEP THRSHOLD MINUTE Name Bits Cof CREEP THRSHOLD MINUTE 8 R W This 8 bit register holds the decimal representation of the creep threshold time in min utes total creep is minutes seconds register 3 53 CREEP THRSHOLD SECOND Name Bits Cof CREEP THRSHOLD SECOND 8 R W This 8 bit register holds the decimal representation of the creep threshold time in sec onds total creep is minutes seconds register 3 54 ENERGY ACT FORWARD Name Bits Cof ENERGY ACT FORWARD 32 R W This 32 bit register is the accumulated active energy in the forward direction only The design updates the Energy register using the CF Pulse blink output count In this method the Energy registers increments every pulse by a value equal to
35. r meter communication 7 Push button switches USB or RS 232 selection 8 9 digit LCD Display with icons for kWh and kVARh Test Points 9 Pulse Output for active and reactive isolated 49V DC Input non isolated 10 RS 232 Connection non Isolated Connections to shunt 11 USB Connection Isolated current sensing resistor Connections to Line and Neutral 2011 Microchip Technology Inc DS51931A page 13 PIC18F87J72 Single Phase Energy Meter Reference Design FIGURE 2 1 Top View Hardware Components Z 4 5 c umm Dy 8 46 Oo Au 18 DANGER Vsus HIGH VOLTAGE H 44 mmm Lamm Legend 12 Opto isolators for Pulse Outputs 13 Power Supply 14 Non volatile memory for calibration constants and energy usage data 15 PIC18F87J72 16 Isolation IC 17 2200 for USB connection 18 RS 232 Device not populated FIGURE 2 2 Bottom View Hardware Components DS51931A page 14 2011 Microchip Technology Inc Hardware PIC18F87J72 RD5 RD6 A A RB3 373 SWITCH 7 A RB4 5 4 SWITCH Active Reactive Power Power RS 232 Transceiver DB 9 Connector MAX3232 NON ISOLATED J6 y Not Populated RC7 RX 3 ee RC6 TX e e EN USB to UART ap
36. r the Digital Age Application Maestro CodeGuard dsPICDEM dsPICDEM net dsPICworks dsSPEAK ECAN ECONOMONITOR FanSense HI TIDE In Circuit Serial Programming ICSP Mindi MIWi MPASM MPLAB Certified logo MPLIB MPLINK mTouch Omniscient Code Generation PICC PICC 18 PICDEM PICDEM net PICkit PICtail REAL ICE rfLAB Select Mode Total Endurance TSHARC UniWinDriver WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U S A and other countries SQTP is a service mark of Microchip Technology Incorporated in the U S A All other trademarks mentioned herein are property of their respective companies 2011 Microchip Technology Incorporated Printed in the U S A All Rights Reserved Printed on recycled paper ISBN 978 1 61341 075 2 Microchip received ISO TS 16949 2002 certification for its worldwide headquarters design and wafer fabrication facilities in Chandler and Tempe Arizona Gresham Oregon and design centers in California and India The Company s quality system processes and procedures are for its PIC MCUs and dsPIC DSCs KEELOG code hopping devices Serial EEPROMs microperipherals nonvolatile memory and analog products In addition Microchip s quality system for the design and manufacture of development systems is ISO 9001 2000 certified DS51931A page 2 2011 Microchip Technology Inc PIC18F87J72 SINGLE PHASE ENERGY MICROCHIP METER REFERENCE DESIGN
37. rent sensing element A secondary external transformer may be required in higher current meter designs To test a calibrated meter the following connections apply for a two wire connection 1 3 1 Step 1 Wiring Connections Figure 1 2 is identifying the line and load connections of the PIC18F87J72 Sin gle Phase Energy Meter Reference Design Line Line Neutral Neutral MAIN LOAD FIGURE 1 2 Example Connections using a Two Wire System 1 3 2 Step 2 Turn On Line Load Power to the Meter Power the Meter The meter will turn on when the line connection has 220V connected The LCD display will show the total energy accumulated 0551931 12 2011 Technology Inc PIC18F87J72 SINGLE PHASE ENERGY MICROCHIP METER REFERENCE DESIGN Chapter 2 Hardware 2 1 OVERVIEW Figures 2 1 and 2 2 show the PIC18F87J72 Single Phase Energy Meter Reference Design ACTIVE REACTIVE PRX RS 232 NON ISOLATED POWER POWER ii 099999 z 2 6 8 ICD NON ISOLATED Hi d USB RS232 e IL DANGER CONNECTING J1 P1 2 OR TP1 NON ISOLATED MAY CAUSE EXTERNAL EQUIPMENT DAMAGE swi AND SHOCK HAZARD IL 9 IT 2 2 LANGER HIGH VOLTAGE SHUNT 1 SHUNT 2 HIGH LOW 5 e S PIC18F8 J72 SHUNT METER lt 1 Legend S 6 Rfo
38. s and Service 50 2011 Microchip Technology Inc DS51931A page 5 PIC18F87J72 Single Phase Energy Meter Reference Design NOTES DS51931A page 6 2011 Microchip Technology Inc PIC18F87J72 SINGLE PHASE ENERGY MICROCHIP METER REFERENCE DESIGN Preface NOTICE TO CUSTOMERS documentation becomes dated and this manual is no exception Microchip tools and documentation are constantly evolving to meet customer needs so some actual dialogs and or tool descriptions may differ from those in this document Please refer to our web site www microchip com to obtain the latest documentation available Documents are identified with a DS number This number is located on the bottom of each page in front of the page number The numbering convention for the DS number is DSXXXXXA where XXXXX is the document number and is the revision level of the document For the most up to date information on development tools see the MPLAB IDE on line help Select the Help menu and then Topics to open a list of available online help files INTRODUCTION This chapter contains general information that will be useful to know before using the PIC18F87J72 Single Phase Energy Meter Reference Design Items discussed in this chapter include Document Layout Con
39. t RMS voltage and other typical power quantities The Microchip Energy Meter 1 Phase Software is used to calibrate and monitor the system and can be used to create custom calibration setups For some accuracy requirements only a single point calibration may be needed The energy meter software offers an automated step by step calibration process that can be used to quickly calibrate energy meters aa 1 KIPUTE LE LIA 588 r DANGER CONNECTING TO Ji MAY CAUSE EXTENT EQUIPMENT DAMAGE AND SHOCK HAZARD FIGURE 1 1 PIC18F87J72 Single Phase Energy Meter 2011 Microchip Technology Inc DS51931A page 11 PIC18F87J72 Single Phase Energy Meter Reference Design 1 2 WHAT THE PIC18F87J72 SINGLE PHASE ENERGY METER REFERENCE DESIGN KIT INCLUDES The PIC18F87J72 Single Phase Energy Meter Reference Design kit includes PIC18F87J72 Single Phase Energy Meter Reference Design 102 00280 Important Information Sheet 1 3 GETTING STARTED To describe how to use the PIC18F87J72 Single Phase Energy Meter Reference Design the following example is given using a two wire 1 phase 220VAC line voltage and connections using an energy meter calibrator equipment or other programmable load source The meter design uses a 5A load for calibration current and a maximum current Imax of 60A All connections described in this section are dependent upon the choice of the cur
40. t the display value in Amperes This register is overwritten every LINE CYC line cycle written only once if the calibration is enabled DS51931A page 24 2011 Microchip Technology Inc Calculation Engine and Register Description 3 11 RAW2 V RMS Name Bits Cof RAW2 V RMS 64 R This register is the square of the raw RMS value from the voltage A D converter in LSBs By definition it will always contain a positive value This register is overwritten every LINE CYC line cycle written only once if the calibration is enabled 3 12 RAW RMS Name Bits Cof RAW V RMS 16 R This is the raw RMS value from the voltage A D converter in LSBs square root of the top 32 bits of RAW2 V RMS OFFSET V RMS By definition this register will always contain a positive value The register is overwritten every LINE CYC line cycle written only once if the calibration is enabled 3 43 V RMS Name Bits Cof V RMS 16 R This register is the RMS value of the voltage in X 0 01 V LSB as determined by the value in the GAIN V RMS register When displaying the RMS voltage assume a cal ibrated meter exists and multiply the decimal value in these registers by X to get the display value in Volts This register is overwritten every LINE CYC line cycle written only once if the calibration is enabled 3 14 LINE FREQUENCY Name Bits Cof LINE FREQUENCY 16 R This register holds the measured line frequency using the zero crossing technique
41. to equal X VA LSB This is done with the GAIN POWER APP registers When display ing the power for phase A multiply the decimal value in this register by X to get the display value in Watts This register is overwritten every LINE CYC line cycle written only once if the calibration is enabled 3 18 RAW POWER REACT Name Bits Cof RAW POWER REACT 64 R This is the raw reactive power This register is read during the calibration for calculating the gain values associated with the reactive power and GAIN POWER REACT This register is overwritten every LINE CYC line cycle written only once if the calibration is enabled This register is accumulated once a line cycle basis DS51931A page 26 2011 Microchip Technology Inc Calculation Engine and Register Description 3 19 POWER REACT Name Bits Cof POWER REACT 32 R This is the value for reactive power The goal is to get this value to equal X VAR LSB This is done with the GAIN POWER REACT register When displaying the power multiply the decimal value in this register by X to get the display value in Watts This register is overwritten every LINE line cycle written only once if the calibration is enabled 3 20 PERIOD Name Bits Cof PERIOD 32 R This 32 bit register represents the total number of clock ticks that elapsed over the most recent LINE line cycle Each LSB represents 1 6 with a 40 MHz clock on the microcontroller This register is overwritt
42. upplied by user void main void 2011 Microchip Technology Inc DS51931A page 9 PIC18F87J72 Single Phase Energy Meter Reference Design RECOMMENDED READING This user s guide describes how to use the PIC18F87J72 Single Phase Energy Meter Reference Design Other useful documents are listed below The following Microchip documents are available and recommended as supplemental reference resources PIC18F87J72 Family Data Sheet 80 Pin High Performance Microcontrollers with Dual Channel AFE LCD Driver and nanoWatt Technology DS39979 This data sheet provides detailed information regarding the PIC18F87J72 device Single Phase Energy Meter Calibration User s Guide 0551964 THE MICROCHIP WEB SITE Microchip provides online support via our web site at www microchip com This web site is used as a means to make files and information easily available to customers Accessible by using your favorite Internet browser the web site contains the following information Product Support Data sheets and errata application notes and sample programs design resources user s guides and hardware support documents latest software releases and archived software General Technical Support Frequently Asked Questions FAQs technical support requests online discussion groups Microchip consultant program member listing Business of Microchip Product selector and ordering guides latest Microchip press releases
43. value is always less than one for example 32 767 0 9999695 DS51931A page 30 2011 Microchip Technology Inc Calculation Engine and Register Description 3 38 CF PULSE WIDTH Name Bits Cof CF PULSE WIDTH 8 R W Defines the CF pulse width from 0 to 255 Length of width is valued 8 1 FREQUENCY 128 ms A maximum of 0 266 seconds for 60 Hz and 0 319 seconds for 50 Hz If the value is 0 no CF pulse is produced 3 39 GAIN DENR ENERGY ACT Name Bits Cof GAIN DENR ENERGY ACT 8 R W 8 bit signed value Represents the number of shifts for active power energy register ENERGY ACT before GAIN DENR ENERGY ACT is applied 3 40 GAIN NUMR ENERGY ACT Name Bits Cof GAIN NUMR ENERGY ACT 16 R W Active power gain to produce a specified pulses per watt hour The value is always less than one for example 32 767 0 9999695 3 41 MODE1 DEF Name Bits Cof MODE1 DEF 16 R W MODE default power up settings On power up this register will be read and placed into the MODE register 2011 Microchip Technology Inc DS51931A page 31 PIC18F87J72 Single Phase Energy Meter Reference Design 3 42 CAL STATUS The CAL STATUS register holds the calibration status for each individual phase Bro ken down by phase these are the values that can be calibrated Each bit has the status of 0 NOT Calibrated 1 2 CALIBRATED REGISTER 3 4 CAL STATUS REGIST
44. ventions Used in this Guide Recommended Reading The Microchip Web Site Customer Support Document Revision History 2011 Microchip Technology Inc DS51931A page 7 PIC18F87J72 Single Phase Energy Meter Reference Design DOCUMENT LAYOUT This document describes how to use the PIC18F87J72 Single Phase Energy Meter Reference Design as a development tool to emulate and debug firmware on a target board The manual layout is as follows Chapter 1 Product Overview Important information on using the PIC18F87J72 Single Phase Energy Meter Reference Design including a getting started section that describes wiring the line and load connections Chapter 2 Hardware Includes detail on the function blocks of the meter including the analog front end design and power supply design Chapter 3 Calculation Engine and Register Description This section describes the digital signal flow for all power output quantities such as RMS current RMS voltage active power and apparent power This section also includes the calibration registers detail Appendix A Schematic and Layouts Shows the schematic and layout diagrams Appendix B Bill of Materials BOM Lists the parts used to build the PIC18F87J72 Single Phase Energy Meter Reference Design DS51931A page 8 2011 Microchip Technology Inc CONVENTIONS USED IN THIS GUIDE Preface This manual uses the following documentation conv
45. y Inc DS51931A page 45 PIC18F87J72 Single Phase Energy Meter Reference Design TABLE B 1 BILL OF MATERIALS BOM CONTINUED Qty Reference Description Manufacturer Part Number 2 two SHUNT LP W HANDLE 2 POS 30AU Tyco Electronics 881545 2 Shunts at J6 1 196 CONN DUAL 6POS 100 SRT Molex Connector 10 89 7062 AU Corporation 2 1112 EMI RFI Suppressors and Ferrites Laird Technologies LI1806C151R 10 150ohms 100 MHz 3A Monolithic 1806 SMD 3 113 14 15 EMI RFI Suppressors and Ferrites Laird Technologies LI0805H151R 10 150ohms 100 MHz 8A Monolithic 0805 SMD 1 LCD1 LCD Glass size 65 00 x 18 00 Xiamen Ocular 076 Optics Co Ltd 1 MOV 1 VARISTOR 275V RMS 20MM EPCOS Inc S20K275E2 RADIAL 1 P1 6 X 1 Header 2 54mm on center 6 Samtec TSW 106 07 G S mm 2 5mm 1 PCB RoHS Compliant Bare PCB 104 00280 PIC18F87J72 Energy Meter Refer ence Design 1 101 LDO REG 200MA 3 3V SOT 23 3 Microchip MCP1700T 3302E TT Technology Inc 5 R11 R12 RES 4 70K OHM 1 10W 1 0603 ROHM Ltd MCRO3EZPFX4701 R13 R31 SMD R32 3 R14 R15 RES 1 00K OHM 1 10W 1 0603 ROHM Ltd MCRO3EZPFX1001 R16 SMD 3 R17 R21 RES 698 OHM 1 10W 1 0603 SMD Co Ltd MCROSEZPFX6980 R36 1 R18 RES 470 OHM 1W 5 2512 SMD Panasonic ECG ERJ 1TYJ471U 2 R19 R20 RES 100 OHM 1 10W 1 0603 SMD ROHM Ltd MCRO3EZP
Download Pdf Manuals
Related Search
Related Contents
GE 36 in. Monogram ZEU769 Electric Cooktop Istruzioni d`uso CONFÉRENCE RÉUSSIE POUR MME HÉLÈNE RENAUD C`est BLOCKSYSTEM FS - Casa Carrier Timex W-188 User's Manual AGÊNCIA NACIONAL DE ENERGIA ELÉTRICA – ANEEL La Transition a amené une réponse collective Copyright © All rights reserved.
Failed to retrieve file