MCP3909 3-Phase Energy Meter Reference Design Using PIC18F2520 UG (Rev 2)

MCP3909
3-Phase Energy Meter
Reference Design
Using the PIC18F2520
© 2008 Microchip Technology Inc.
DS51643B
Note the 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. All 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 be a 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.
Information 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 NO 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.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron,
dsPIC, KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro,
PICSTART, rfPIC, SmartShunt and UNI/O are registered
trademarks of Microchip Technology Incorporated in the
U.S.A. and other countries.
FilterLab, Linear Active Thermistor, MXDEV, MXLAB,
SEEVAL, SmartSensor and The Embedded Control Solutions
Company are registered trademarks of Microchip Technology
Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard,
dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, In-Circuit Serial
Programming, ICSP, ICEPIC, Mindi, MiWi, MPASM, MPLAB
Certified logo, MPLIB, MPLINK, mTouch, PICkit, PICDEM,
PICDEM.net, PICtail, PIC32 logo, PowerCal, PowerInfo,
PowerMate, PowerTool, REAL ICE, rfLAB, Select Mode, Total
Endurance, 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.
© 2008, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
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, KEELOQ® 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.
DS51643B-page ii
© 2008 Microchip Technology Inc.
MCP3909 3-PHASE ENERGY
METER REFERENCE DESIGN
Table of Contents
Preface ........................................................................................................................... 1
Introduction............................................................................................................ 1
Document Layout .................................................................................................. 2
Conventions Used in this Guide ............................................................................ 3
Recommended Reading........................................................................................ 4
The Microchip Web Site ........................................................................................ 4
Customer Support ................................................................................................. 4
Document Revision History ................................................................................... 5
Chapter 1. Product Overview
1.1 Introduction ..................................................................................................... 7
1.2 What the MCP3909 3-Phase Energy Meter Reference Design Kit Includes .. 8
1.3 Getting Started ............................................................................................... 9
Chapter 2. Hardware
2.1 Input and Analog Front End ......................................................................... 11
2.2 Clock Generation Circuit And PLL ................................................................ 12
2.3 Meter Output ................................................................................................ 13
2.4 Power Supply Circuit .................................................................................... 14
Chapter 3. PIC18F2520 Calculation and Register Description
3.1 Register Overview ........................................................................................ 15
3.2 Signal Flow Summary .................................................................................. 16
3.3 Complete Register List ................................................................................. 17
3.4 Configuration And Output Registers ............................................................. 21
3.5 Calibration Registers .................................................................................... 32
Chapter 4. Meter Protocol and Timings
4.1 PIC18F2520 Protocol ................................................................................... 37
Chapter 5. Meter Calibration
5.1 Calibration Overview .................................................................................... 39
5.2 Active Power Signal Flow and Calibration .................................................... 41
5.3 RMS Current, RMS Voltage, Apparent Power Signal Flow and Calibration . 42
© 2008 Microchip Technology Inc.
DS51643B-page iii
MCP3909 3-Phase Energy Meter Reference Design
Chapter 6. 3-Phase Energy Meter Calibration Software
6.1 Overview ...................................................................................................... 55
6.2 Using the Calibration Software with the USB Interface Module ................... 55
6.3 Software Overview And Tab Control ............................................................ 56
6.4 Results Frame .............................................................................................. 57
6.5 Calibration Icons ........................................................................................... 59
6.6 Register List ................................................................................................. 59
6.7 Writing to Individual Registers ...................................................................... 59
6.8 Meter Calibration .......................................................................................... 60
6.9 Meter Design Frame ..................................................................................... 64
6.10 Message Log Frame .................................................................................. 65
6.11 Communications Log Frame ...................................................................... 66
Appendix A. Schematic and Layouts
A.1 Introduction .................................................................................................. 67
A.2 Schematics and PCB Layout ....................................................................... 67
A.3 Main Board Schematic - Page 1 .................................................................. 68
A.4 Main Board Schematic - Page 2 .................................................................. 69
A.5 Main Board Schematic - Page 3 .................................................................. 70
A.6 Main Board Schematic - Page 4 .................................................................. 71
A.7 Main Board Schematic - Page 5 .................................................................. 72
A.8 Main Board - Top Layer And Silk-Screen .................................................... 73
A.9 Main Board - Bottom Layer .......................................................................... 74
A.10 USB Interface Module - Schematic ............................................................ 75
A.11 USB Interface Module - Top Silk-Screen Layer ......................................... 76
A.12 USB Interface Module - Top Traces And Pads Layer ................................ 76
A.13 USB Interface Module - Bottom Silk-Screen Layer .................................... 77
A.14 USB Interface Module - Bottom Traces And Pads Layer .......................... 77
Appendix B. Bill Of Materials (BOM)
Worldwide Sales and Service .....................................................................................84
DS51643B-page iv
© 2008 Microchip Technology Inc.
MCP3909 3-PHASE ENERGY
METER REFERENCE DESIGN
Preface
NOTICE TO CUSTOMERS
All 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 “A” 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 on-line help files.
INTRODUCTION
This chapter contains general information that will be useful to know before using the
MCP3909 3-Phase Energy Meter Reference Design. Items discussed in this chapter
include:
•
•
•
•
•
•
Document Layout
Conventions Used in this Guide
Recommended Reading
The Microchip Web Site
Customer Support
Document Revision History
© 2008 Microchip Technology Inc.
DS51643B-page 1
MCP3909 3-Phase Energy Meter Reference Design
DOCUMENT LAYOUT
This document describes how to use the MCP3909 3-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 MCP3909
3-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, phase lock loop circuitry, and power supply
design.
• Chapter 3. “PIC18F2520 Calculation 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.
• Chapter 4. “Meter Protocol and Timings”– Here is described the protocol used
for accessing the registers includes commands that are used to interface to the
meter.
• Chapter 5. “Meter Calibration” – This chapter provides detail on how to
calibrate the meter. The PC calibration software that is included with the meter
automates the steps and calculations described in this chapter.
• .Chapter 6. “3-Phase Energy Meter Calibration Software” – Here you can find
a detailed description of the calibration software provided with this reference
design
• Appendix A. “Schematic and Layouts” – Shows the schematic and layout
diagrams
• Appendix B. “Bill Of Materials (BOM)” – Lists the parts used to build the
DS51643B-page 2
© 2008 Microchip Technology Inc.
Preface
CONVENTIONS USED IN THIS GUIDE
This manual uses the following documentation conventions:
DOCUMENTATION CONVENTIONS
Description
Arial font:
Italic characters
Represents
Examples
Referenced books
Emphasized text
A window
A dialog
A menu selection
A field name in a window or
dialog
A menu path
MPLAB® IDE User’s Guide
...is the only compiler...
the Output window
the Settings dialog
select Enable Programmer
“Save project before build”
A dialog button
A tab
A number in verilog format,
where N is the total number of
digits, R is the radix and n is a
digit.
A key on the keyboard
Click OK
Click the Power tab
4‘b0010, 2‘hF1
Italic Courier New
Sample source code
Filenames
File paths
Keywords
Command-line options
Bit values
Constants
A variable argument
Square brackets [ ]
Optional arguments
Curly brackets and pipe
character: { | }
Ellipses...
Choice of mutually exclusive
arguments; an OR selection
Replaces repeated text
#define START
autoexec.bat
c:\mcc18\h
_asm, _endasm, static
-Opa+, -Opa0, 1
0xFF, ‘A’
file.o, where file can be
any valid filename
mcc18 [options] file
[options]
errorlevel {0|1}
Initial caps
Quotes
Underlined, italic text with
right angle bracket
Bold characters
N‘Rnnnn
Text in angle brackets < >
Courier New font:
Plain Courier New
Represents code supplied by
user
© 2008 Microchip Technology Inc.
File>Save
Press <Enter>, <F1>
var_name [,
var_name...]
void main (void)
{ ...
}
DS51643B-page 3
MCP3909 3-Phase Energy Meter Reference Design
RECOMMENDED READING
This user's guide describes how to use the MCP3909 3-Phase Energy Meter
Reference Design. Other useful documents are listed below. The following Microchip
documents are available and recommended as supplemental reference resources.
MCP3909 Data Sheet, “Energy Metering IC with SPI Interface and Active Power
Pulse Output“ (DS22025)
This data sheet provides detailed information regarding the MCP3909 device.
AN994 Application Note “IEC61036 Meter Design using the MCP3905/6 Energy
Metering Devices” (DS00994)
This application note documents the design decisions associated with using the
MCP390X devices for energy meter design and IEC compliance.
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, 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
DS51643B-page 4
© 2008 Microchip Technology Inc.
Preface
DOCUMENT REVISION HISTORY
Revision B (October 2008)
1. Updated Figure 1-1 photo.
2. Updated Figure 1-3 photo.
3. Section 2.1 “Input and Analog Front End”: Added note for revision 2 hardware. Chasnged values of reistors in text and Figure 2-1.
4. Appendix A. “Schematic and Layouts”: Updated Schematics and Board
Layouts for Revision 2.
5. Appendix B. “Bill Of Materials (BOM)”: Updated for Revision 2.
Revision A (February 2007)
• Initial Release of this Document.
© 2008 Microchip Technology Inc.
DS51643B-page 5
MCP3909 3-Phase Energy Meter Reference Design
NOTES:
DS51643B-page 6
© 2008 Microchip Technology Inc.
MCP3909 3-PHASE ENERGY
METER REFERENCE DESIGN
Chapter 1. Product Overview
1.1
INTRODUCTION
The MCP3909 3-Phase Energy Meter Reference Design is a fully functional 3-phase
meter. Please note that the meters are not shipped calibrated and should be calibrated
using standard meter calibration equipment and the software included with the kit.
There are two boards that comprise the complete meter: the main board and the USB
communications module. The communications module shipped with this kit is the
PIC18F4550 USB Interface module. The USB Interface module also includes an LCD
display. The main board contains the analog circuitry and the PIC18F2520 device that
functions as the main RMS engine. The communications module displays the output of
the PIC18F2520 and also connects the meter to the PC for calibration using the
PIC18F4550 3-Phase Meter Calibration Software. The meter design contains serially
accessible registers and is intended to be flexible and upgraded to a variety of PIC®
micro-based energy meter designs using the firmware presented herein. The “3-Phase
Energy Meter USB software” offers a functional and simple means to monitor and
control the PIC18F2520 via USB through the PIC18F4550. In addition, the RS-232
interface of the PIC18F2520 can be used to create custom calibration setups. The
energy meter software offers an automated step by step calibration process that can
be used to quickly calibrate energy meters.
FIGURE 1-1:
© 2008 Microchip Technology Inc.
MCP3909 3-Phase Energy Meter Reference Design.
DS51643B-page 7
LCD DISPLAY
USB to PC
MCP3909 3-Phase Energy Meter Reference Design
USB
PIC18F4550
In-Circuit Programming
RS-232
PIC18F4550 USB Interface Module
Power Supply &
Protection Circuitry
Main Board
In-Circuit Programming
SPI
Calibration Pulse &
Opto Isolator
Clock & PLL
Circuitry
PIC18F2520
MCP3909
MCP3909
T
T
T
CT
CT
CT
VREG
3-Phase
Meter Case
MCP3909
Current
Transformers
Line and
Load Connections
FIGURE 1-2:
1.2
Functional Block Diagram.
WHAT THE MCP3909 3-PHASE ENERGY METER REFERENCE DESIGN KIT
INCLUDES
This MCP3909 3-Phase Energy Meter Reference Design Kit includes:
• The MCP3909 3-Phase Energy Meter Reference Design (102-00111)
• USB Communications Module (102-00113)
• Analog and Interface Products Demonstration Boards CD-ROM (DS21912)
- MCP3909 3-Phase Energy Meter Reference Design (DS51643)
- MCP3909 Data Sheet, “Energy Metering IC with SPI Interface and Active
Power Pulse Output” (DS22025)
DS51643B-page 8
© 2008 Microchip Technology Inc.
Product Overview
1.3
GETTING STARTED
To describe how to use the MCP3909 3-Phase Energy Meter Reference Design, the
following example is given using both a 4-Wire 3-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 10A.
All connections described in this section are dependent on the choice of current
sensing element and a secondary external transformer may be required in higher
current meter designs.
For testing a calibrated meter, the following connections apply for a 4-wire connection.
1.3.1
Step 1: Wiring for 4-Wire Line and Load connections
Phase A
Line
FIGURE 1-3:
1.3.2
Load
Phase B
Line
Load
Phase C
Line
Load
Neutral
Example Connections using a 4-Wire System.
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 to any of the three
phases.
1.3.3
Step 3: Connect isolated USB Interface Module.
After connecting the USB cable to a computer running Windows® operating system, the
meter should be recognized as a HID (Human Interface Device) compliant USB device.
FIGURE 1-4:
© 2008 Microchip Technology Inc.
USB Interface Connections
DS51643B-page 9
MCP3909 3-Phase Energy Meter Reference Design
1.3.4
Step 4: Run PC Calibration Software
After the PC has recognized that the energy meter is connected, the calibration
software will allow real-time testing and calibration of the meter.
FIGURE 1-5:
DS51643B-page 10
MCP3909 3-Phase Energy Meter Reference Design Software.
© 2008 Microchip Technology Inc.
MCP3909 3-PHASE ENERGY
METER REFERENCE DESIGN
Chapter 2. Hardware
2.1
INPUT AND ANALOG FRONT END
This meter comes populated with components designed for 220V line voltage. At the
bottom of the main board are the high voltage line and load connections. The
connections to the current transformers for each phase are labelled CTA, CTB and
CTC. The three screw terminals to the right of these are the connections to be wired
into the line side of the CT for the voltage input and power supply transformer
connections. These are labelled PHA, PHB and PHC. The line and neutral connections
are labelled “L” and “N”.
Note:
Revision 2 of the hardware uses current transformers, P/N: SCT954.
Each phase will use a current transformer and a resistor divider on the voltage channel
input. Anti-aliasing low-pass filters will be included on both differential channels. The
voltage channel uses 221 kΩ resistors to achieve a divider ratio of 453:1. For a line
voltage of 230 VRMS, the channel 1 input signal size will be 718 mVPEAK. The current
channel of each phase uses current transformer with a turns ratio of 2000:1 and burden
resistance of 56.4 kΩ. The resulting channel 0 signal size is 340 mVPEAK for 20A, or
twice the rated maximum current of the meter, still within the input range of the A/D
converter of the MCP3909.
1000:1
1.0 kΩ
T-4
CH0+
CTA-1
none
68 nF
23.2Ω
MCP3909
23.2Ω
1.0 kΩ
CH0-
CTA-2
68 nF
Note:
FB = ferrite beads. Ferrite beads have an impedance of the
specified value at 100 MHz.
150 FB (Note)
221 kΩ 221 kΩ
0Ω
CH1+
PHA-L J6:1
68 nF
1.0 kΩ
1.0 kΩ
PHA-N J6:2
CH1+
68 nF
FIGURE 2-1:
Analog Front End, Phase A Connections and Reference Designators shown.
© 2008 Microchip Technology Inc.
DS51643B-page 11
MCP3909 3-Phase Energy Meter Reference Design
2.2
CLOCK GENERATION CIRCUIT AND PLL
To achieve simultaneous sampling across the three phases, all 3 MCP3909 devices
use the same clock source. In this configuration, the six delta-sigma ADCs are being
clocked simultaneously. The source used in this reference design can either be the
output of the CCP2 timer on the PIC18F2520 or the output of the phase lock loop (PLL)
circuit locked to the line frequency. In either situation, the target number of samples per
line cycle is 128. The PLL is designed to have a multiplier of 32768 resulting in a MCLK
for the MCP3909 devices that results in exactly 128 samples per line cycle. For lower
cost meters, the PLL circuit can be avoided and instead, the CCP2 timer output can
provide the appropriate MCLK frequency from a PIC oscillator clock of 39.3216 MHz.
This will generate an integer number of samples for either 50 Hz or 60 Hz line
frequencies. R31 and R34 select the source of the MCLK signal for the MCP3909s-PLL
or CCP2 / 32768..
39.3216 MHz
50 Hz or 60 Hz
X1
Phase A || B || C
50 (or 60 Hz)
1.6384 MHz (50 Hz)
PLL Circuit
x 32768
1.96606 MHz (60 Hz)
PIC MCU
CCP2 / 32768
Option 1
Option 2
R34
R31
MCLK input
SDO
SDO
To PIC18F2520
IRQ
MCP3909
SDO
MCP3909
MCP3909
IRQ
DR Pulse
tSAMPLE
IRQ
tLINE_CYC
IRQ
Phase A,B,C I & V Data
SDO DR
16 bits
x 6 ADCs
DR
tSAMPLE
FIGURE 2-2:
DS51643B-page 12
Timing Structure of PIC18F2520 Interrupts and Calculations.
© 2008 Microchip Technology Inc.
Hardware
2.3
METER OUTPUT
There are two outputs of the PIC18F2520, the CF calibration pulse and the RS-232
interface containing the register information. This meter design isolates both of these
outputs using digital isolator U13 and opto-isolator U10. With the AGND being referenced
to the neutral line of 220V, a DC-DC converter is also included to isolate the power from
P8, the output header. The output header, when used with the USB Interface Module,
interfaces the meter to both the PC and the LCD on the USB interface module for
output display.
VDD
U17
GNDA
GNDB
EEPROM
PIC18F2520
U17
CF Output Pulse
Opto-Isolator
U10
RS-232 RX, TX
Opto-Isolator
P8
GNDA
3-Phase Energy Meter
Main Board
FIGURE 2-3:
LCD
DC-DC
Converter
PIC18F4550
VDD
P1
U13
GNDB
USB Interface Module
Meter Output Diagram.
© 2008 Microchip Technology Inc.
DS51643B-page 13
MCP3909 3-Phase Energy Meter Reference Design
2.4
POWER SUPPLY CIRCUIT
The power supply circuit for the MCP3909 3-Phase Energy Meter Reference Design
uses three voltage transformers to step down the 220V line voltages to the 5 volt
regulator. The 2W maximum current consumption specification of the IEC62053 and
legacy IEC61036 specifications limit the power supply voltage to a input voltage low
enough to keep the power below this level.
Note:
N PHA PHB PHC
10nF
MOV
150 FB (Note)
FB = ferrite beads. Ferrite beads have an impedance of the
specified value at 100 MHz.
+5V
10nF
MOV
150 FB (Note)
600
100 nF
LM1117-5.0
470 µF
100 nF
10nF
MOV
150 FB (Note)
FIGURE 2-4:
Power Supply Circuit. IEC62053 states that the meter must be able to operate from
any single phase with 70% nominal voltage.
DS51643B-page 14
© 2008 Microchip Technology Inc.
MCP3909 3-PHASE ENERGY
METER REFERENCE DESIGN
Chapter 3. PIC18F2520 Calculation and Register Description
3.1
REGISTER OVERVIEW
There are over 100 possible registers associated with the MCP3909 3-Phase Energy
Meter Reference Design available via the RS-232 interlace on the PIC18F2520. The
registers are named to describe each phase, specific measurement, and in the case of
the calibration registers, the calibration function.
The intent of the calibration process is to yield output registers that are decimal
representation of the final energy, power, current or voltage value.
RMS Current and Voltage Registers
The PHy_I_RMS registers, post calibration, contain the decimal representation of RMS
current in A/LSB, 0.1A/LSB, or 0.01A/LSB. The PHy_V_RMS registers, post
calibration, contain the decimal representation of RMS voltage in 0.1V/LSB. The final
correction factor to convert these registers to these volts and amperes are located in
the PHy_I_RMS_GLSB and PHy_V_RMS_GLSB registers. These correction factors
can be automatically calculated and loaded by using the PC calibration software. The
exact representation depends on the meter values that are entered in the software. For
example, for a maximum current of 10A, the current is 0.01A/LSB.
Instantaneous Power Registers
The PHy_W and PHy_VA registers contain the decimal representation of the active
power (W) and apparent power (VA) post calibration. The reactive power calculation is
not implemented at this time.
The final correction factors to convert these registers to units of energy are located in
the _GLSB registers. These correction factors can be automatically calculated and
loaded by using the PC calibration software. The exact representation depends on the
meter values that are entered in the software. For example, at 10A and 220V, power in
the PHy_W register is 0.1 mW/LSB
Calibration Registers
The calibration registers fall into one of three categories: offset, gain, and LSB, denoted
by _OFF, _GAIN and _GLSB register names.
In addition there are two registers, CFNUM and CFDEN, that calibrate the output pulse,
CF.
© 2008 Microchip Technology Inc.
DS51643B-page 15
MCP3909 3-Phase Energy Meter Reference Design
3.2
SIGNAL FLOW SUMMARY
RMS voltage, RMS current, active power, apparent power, and the calibration output
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.
RMS Current
Σ
X2
ADC
PHA_VA_GAIN:16
Apparent Power
X
Σ
X
Current
PHASES
B&C
PHA_I_RMS_OFF:16
MCP3909
Active Power
Σ
X
Σ
X
Voltage
PHA_W_GAIN:16
Σ
ENERGY_W_Z:64
ENERGY_W:64
ENERGY_W_L_RAW:48
RMS Voltage
CF_DEN:16
CF_NUM:16
Digital to
Frequency
Converter
(NOTE 1)
ENERGY_W_GLSB:16
PHA_VA:32
X
kWh
X
X
X
ENERGY_W_L:48
X
kVA
PHA_VA_GLSB:16
PHA_W_GLSB:16
X
kW
A
X
PHA_W:32
PHA_V_RMS:16
V
X
PHA_I_RMS:16
CF OUTPUT
FREQUENCY!
PHA_I_RMS_GLSB:16
/
kVAh
X2
ENERGY_VA_L:48
PHA_V_RMS_OFF:16
ENERGY_VA:64
ENERGY_VA_Z:64
ENERGY_VA_L_RAW:64
PHA_VA_RAW:48
PHA_W_OFF:32
PERIOD:16 (NOTE 1)
PHA_DELAY:8
(NOTE 1)
ENERGY_VA_GLSB:16
Φ
ADC
Meter Output (LCD or other)
Note 1:
These functions are not implemented with this version of the firmware/software release.
FIGURE 3-1:
DS51643B-page 16
PIC18F2520 Signal Flow (Phase A), not all registers shown.
© 2008 Microchip Technology Inc.
PIC18F2520 Calculation and Register Description
3.3
COMPLETE REGISTER LIST
TABLE 3-1:
Address
INTERNAL REGISTER SUMMARY
Name
Bits
0x000
MODE1
16
0x002
RESERVED
16
R/W
Description
R/W Configuration register for operating mode of the meter
—
Reserved
0x004
STATUS1
16
R
Status Register
0x006
RESERVED
16
—
Reserved
0x008
CAL_CONTROL
16
R/W Configuration register for calibration control
0x00A
LINE_CYC
16
R/W 2n number of line cycles to be used during energy accumulation
0x00C
LINE_CYC_CNT
16
R
Counter for number of line cycles
0x00E
RESERVED
16
—
Reserved
0x010
PHA_I_RMS_RAW2
48
R
Raw2 RMS value from the phase A current A/D converter in LSBs
0x016
PHA_I_RMS_RAW
16
R
Raw RMS value from the phase A current A/D converter in LSBs
0x018
PHA_I_RMS
16
R
RMS value of phase A current (post calibration)
0x01A
PHA_V_RMS_RAW2
48
R
Raw2 RMS value from the phase A voltage A/D converter in LSBs
0x020
PHA_V_RMS_RAW
16
R
Raw RMS value from the phase A voltage A/D converter in LSBs
0x022
PHA_V_RMS
16
R
RMS value of phase A voltage (post calibration)
0x024
PHB_I_RMS_RAW2
48
R
Raw2 RMS value from the phase B current A/D converter in LSBs
0x02A
PHB_I_RMS_RAW
16
R
Raw RMS value from the phase B current A/D converter in LSBs
0x02C
PHB_I_RMS
16
R
RMS value of phase B current (post calibration)
0x02E
PHB_V_RMS_RAW2
48
R
Raw2 RMS value from the phase B voltage A/D converter in LSBs
0x034
PHB_V_RMS_RAW
16
R
Raw RMS value from the phase B voltage A/D converter in LSBs
0x036
PHB_V_RMS
16‘
R
RMS value of phase B voltage (post calibration)
0x038
PHC_I_RMS_RAW2
48
R
Raw2 RMS value from the phase C current A/D converter in LSBs
0x03E
PHC_I_RMS_RAW
16
R
Raw RMS value from the phase C current A/D converter in LSBs
0x040
PHC_I_RMS
16
R
RMS value of phase C current (post calibration)
0x042
PHC_V_RMS_RAW2
48
R
Raw2 RMS value from the phase C voltage A/D converter in LSBs
0x048
PHC_V_RMS_RAW
16
R
Raw RMS value from the phase C voltage A/D converter in LSBs
0x04A
PHC_V_RMS
16
R
RMS value of phase C voltage (post calibration)
0c04C
I_RMS
24
R
Sum of All Currents
0x04F
RESERVED
8
—
Reserved
0x050
NEUT_I_RMS_RAW2
48
R
Not implemented
0x056
NEUT_I_RMS_RAW
16
R
Not implemented
0x058
NEUT_I_RMS
16
R
Not implemented
0x05A
NEUT_V_RMS_RAW2
48
R
Not implemented
0x060
NEUT_V_RMS_RAW
16
R
Not implemented
0x062
NEUT_V_RMS
16
R
Not implemented
0x064
PHA_W_RAW
48
R
Raw phase A active power.
0x06A
PHB_W_RAW
48
R
Raw phase B active power
0x070
PHC_W_RAW
48
R
Raw phase C active power
0x076
PHA_W
32
R
Final Phase A active power, units in watts (W)
0x07A
PHB_W
32
R
Final Phase B active power, units in watts (W)
0x07E
PHC_W
32
R
Final Phase C active power, units in watts (W)
0x082
PHA_VA_RAW
48
R
Raw phase A apparent power
0x088
PHB_VA_RAW
48
R
Raw phase B apparent power
0x08E
PHC_VA_RAW
48
R
Raw phase C apparent power
© 2008 Microchip Technology Inc.
DS51643B-page 17
MCP3909 3-Phase Energy Meter Reference Design
TABLE 3-1:
INTERNAL REGISTER SUMMARY (CONTINUED)
Address
Name
Bits
R/W
Description
0x094
PHA_VA
32
R
Final Phase A apparent power, units in volt-amperes (VA)
0x098
PHB_VA
32
R
Final Phase B apparent power, units in volt-amperes (VA)
0x09C
PHC_VA
32
R
Final Phase C apparent power, units in volt-amperes (VA)
0x0A0
PHA_VAR_RAW
48
R
Not implemented
0x0A6
PHB_VAR_RAW
48
R
Not implemented
0x0AC
PHC_VAR_RAW
48
R
Not implemented
0x0B2
PHA_VAR
32
R
Not implemented
0x0B6
PHB_VAR
32
R
Not implemented
0x0BA
PHC_VAR
32
R
Not implemented
0x0BE
RESERVED
16
—
Not implemented
0x0C0
PERIOD
32
R
Period register
0x0C4
ENERGY_W
64
R
Total active energy accumulated
0x0CC
ENERGY_W_Z
64
R
Total active energy accumulated since last read of this register
0x0D4
ENERGY_W_L_RAW
48
R
Total energy accumulated over last LINE_CYC line cycles
0x0DA
ENERGY_W_L
32
R
Not implemented
0x0DE
ENERGY_VA
64
R
Total apparent energy accumulated
0x0E6
ENERGY_VA_Z
64
R
Total apparent energy accumulated since the last read of this
register
0x0EE
ENERGY_VA_L_RAW
48
R
Total apparent energy accumulated over last LINE_CYC line
cycles
0x0F4
ENERGY_VA_L
32
R
Not implemented
0x0F8
PHA_I_ABS_MAX
8
R
0x0FB
PHB_V_ABS_MAX
8
R
0x0FC
PHC_I_ABS_MAX
8
R
0x0FD
PHC_V_ABS_MAX
8
R
Maximum absolute value of phase A raw current
Maximum absolute value of phase A raw voltage
Maximum absolute value of phase B raw current
Maximum absolute value of phase B raw voltage
Maximum absolute value of phase C raw current
Maximum absolute value of phase C raw voltage
0x0FE
RESERVED
16
—
Reserved
0x100
ENERGY_VAR
64
R
Not implemented
0x108
ENERGY_VAR_Z
64
R
Not implemented
0x0F9
PHA_V_ABS_MAX
8
R
0x0FA
PHB_I_ABS_MAX
8
R
0x110
ENERGY_VAR_L_RAW
48
R
Not implemented
0x116
ENERGY_VAR_L
32
R
Not implemented
0x11A
Reserved
272
—
Reserved
0x13C
Reserved
16
—
Reserved
0x13E
Reserved
16
—
Reserved
0x13F
End
—
—
End of PIC18F2520 RAM
CALIBRATION REGISTERS
0x140
PHA_DELAY
8
R/W Phase A delay (delay between voltage and current, voltage is
time shifted)
0x141
PHB_DELAY
8
R/W Phase B delay (delay between voltage and current, voltage is
time shifted)
R/W Phase C delay (delay between voltage and current, voltage is
0x142
PHC_DELAY
8
0x143
RESERVED
8
0x144
PHA_I_RMS_OFF
16
R/W Offset adjustment for phase A RMS current reading
0x146
PHA_V_RMS_OFF
16
R/W Offset adjustment for phase A RMS voltage reading
time shifted)
DS51643B-page 18
—
Reserved
© 2008 Microchip Technology Inc.
PIC18F2520 Calculation and Register Description
TABLE 3-1:
INTERNAL REGISTER SUMMARY (CONTINUED)
Address
Name
Bits
R/W
Description
0x148
PHB_I_RMS_OFF
16
R/W Offset adjustment for phase B RMS current reading
0x14A
PHB_V_RMS_OFF
16
R/W Offset adjustment for phase B RMS voltage reading
0x14C
PHC_I_RMS_OFF
16
R/W Offset adjustment for phase C RMS current reading
0x14E
PHC_V_RMS_OFF
16
R/W Offset adjustment for phase C RMS voltage reading
0x150
PHA_I_RMS_GAIN
16
R/W Not implemented
0x152
PHA_V_RMS_GAIN
16
R/W Not implemented
0x154
PHB_I_RMS_GAIN
16
R/W Not implemented
0x156
PHB_V_RMS_GAIN
16
R/W Not implemented
0x158
PHC_I_RMS_GAIN
16
R/W Not implemented
0x15A
PHC_V_RMS_GAIN
16
R/W Not implemented
0x15C
NEUT_I_RMS_GAIN
16
R/W Not implemented
0x15E
NEUT_V_RMS_GAIN
16
R/W Not implemented
0x160
PHA_I_RMS_GLSB
16
R/W Gain adjustment for Phase A RMS current, to produce X A/LSB
0x162
PHA_V_RMS_GLSB
16
R/W Gain adjustment for Phase A RMS voltage, to produce X V/LSB
0x164
PHB_I_RMS_GLSB
16
R/W Gain adjustment for Phase B RMS current, to produce X A/LSB
0x166
PHB_V_RMS_GLSB
16
R/W Gain adjustment for Phase B RMS voltage, to produce X V/LSB
0x168
PHC_I_RMS_GLSB
16
R/W Gain adjustment for Phase C RMS current, to produce X A/LSB
0x16A
PHC_V_RMS_GLSB
16
R/W Gain adjustment for Phase C RMS voltage, to produce X V/LSB
0x16C
NEUT_I_RMS_GLSB
16
R/W Not implemented
0x16E
NEUT_V_RMS_GLSB
16
R/W Not implemented
0x170
PHA_W_OFF
32
R/W Active power offset, Phase A
0x174
PHB_W_OFF
32
R/W Active power offset, Phase B
0x178
PHC_W_OFF
32
R/W Active power offset, Phase C
0x17C
PHA_W_GAIN
16
R/W Active power gain adjust for Phase A, for CF matching
0x17E
PHB_W_GAIN
16
R/W Active power gain adjust for Phase B, for CF matching
0x180
PHC_W_GAIN
16
R/W Active power gain adjust for Phase C, for CF matching
0x182
PHA_W_GLSB
16
R/W Active power gain adjust for Phase A, to produce X W/LSB
0x184
PHB_W_GLSB
16
R/W Active power gain adjust for Phase B, to produce X W/LSB
0x186
PHC_W_GLSB
16
R/W Active power gain adjust for Phase C, to produce X W/LSB
0x188
PHA_VA_GAIN
16
R/W Apparent power gain adjust for Phase A
0x18A
PHB_VA_GAIN
16
R/W Apparent power gain adjust for Phase B
0x18C
PHC_VA_GAIN
16
R/W Apparent power gain adjust for Phase C
0x18E
PHA_VA_GLSB
16
R/W Apparent power gain adjust for Phase A, to produce X VA/LSB
0x190
PHB_VA_GLSB
16
R/W Apparent power gain adjust for Phase B, to produce X VA/LSB
0x192
PHC_VA_GLSB
16
R/W Apparent power gain adjust for Phase C, to produce X VA/LSB
0x194
PHA_VAR_GAIN
16
R/W Not implemented
0x196
PHB_VAR_GAIN
16
R/W Not implemented
0x198
PHC_VAR_GAIN
16
R/W Not implemented
0x19A
PHA_VAR_GLSB
16
R/W Not implemented
0x19C
PHB_VAR_GLSB
16
R/W Not implemented
0x19E
PHC_VAR_GLSB
16
R/W Not implemented
0x1A0
ENERGY_W_GLSB
16
R/W Not implemented
0x1A2
ENERGY_VA_GLSB
16
R/W Not implemented
0x1A4
ENERGY_VAR_GLSB
16
R/W Not implemented
0x1A6
CREEP_THRESH
32
R/W Not implemented
© 2008 Microchip Technology Inc.
DS51643B-page 19
MCP3909 3-Phase Energy Meter Reference Design
TABLE 3-1:
INTERNAL REGISTER SUMMARY (CONTINUED)
Address
Name
Bits
0x1AA
CF_PULSE_WIDTH
8
R/W
Description
R/W Defines CF pulse width from 0 to 255 * 1.25 ms for 50 Hz.
For 60 Hz line 0 to 255 * 1.042 ms.
0x1AB
RESERVED
8
0x1AC
CFDEN
8
—
Reserved
0x1AD
RESERVED
8
0x1AE
CFNUM
16
R/W CF Calibration Pulse correction factor
0x1B0
MODE1DEF
16
R/W Power Up Configuration Register
0x1B2
PHA_CAL_STATUS
16
R/W Status of Phase A Calibration
0x1B4
PHB_CAL_STATUS
16
R/W Status of Phase B Calibration
0x1B6
PHC_CAL_STATUS
16
R/W Status of Phase C Calibration
0x1B8
STAND_W_RAW
48
R/W Standard Phase Active Power Reading (place holder register
R/W CF Calibration Pulse correction factor
—
Reserved
used during calibration for gain matching)
DS51643B-page 20
© 2008 Microchip Technology Inc.
PIC18F2520 Calculation and Register Description
3.4
CONFIGURATION AND OUTPUT REGISTERS
3.4.1
MODE1 Register
MODE1 Register
REGISTER 3-1:
Name
Bits
Address
Cof
0x000
R/W
The mode register controls the operation of the energy meter. The bit functions are
defined by the table below.
MODE1
16
R/W-0
R/W
R/W
R/W
R/W
U-0
U-0
U-0
APP2
APP1
APP0
ACT1
ACT0
—
—
—
bit 15
bit 8
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
PGA1
PGA0
CF_C
CF_B
CF_A
ABSOLUTE
PHASE
CREEP
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 13-15
APP: Apparent Power Calculation Mode Bits (not implemented)
bit 11-12
ACT: Active Power Calculation Mode Bits (not implemented)
bit 8-10
Unimplemented: Read as ‘0’
bit 6-7
PGA: PGA Bits (not implemented)
bit 3-5
CF Phase y: Active Energy CF Phase Enable Bits
1 = Enabled to be accumulated into the total energy registers or CF pulse output
0 = Disabled and is not acculated into the total energy registers or CF pulse output
bit 2
Absolute: Positive Only Energy Accumulation Mode
1 = Positive Energy Only
0 = Both negative and positive energy accumulated (negative energy is subtracted)
bit 1
Phase: The Phase Bit
1 = Single Point Phase Correction
0 = Multi-Point Phase Correction (future)
bit 0
CREEP: No-Load Threshold Bit
1 = Enabled
0 = Disabled
© 2008 Microchip Technology Inc.
DS51643B-page 21
MCP3909 3-Phase Energy Meter Reference Design
3.4.2
STATUS1 Register
STATUS1 Register
REGISTER 3-2:
Name
Bits
Address
Cof
STATUS1
16
0x004
R
The STATUS1 register contains the operational status of the energy meter. The bit
functions are defined by the table below.
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
—
—
—
—
—
—
—
—
bit 15
bit 8
U-0
U-0
U-0
U-0
U-0
R
R
R
—
—
—
—
—
PHA_S
PHB_S
PHC_S
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-3
Unimplemented: Read as ‘0’
bit 2
PHA_S: Phase A Sign Bit. This is the sign bit of raw active power before absolute value taken
(if enabled, see MODE1 bits).
Negative active power, this may indicate the CT is wired in backwards
1=
0=
bit 1
Operation Normal
PHB_S: Phase B Sign Bit. This is the sign bit of raw active power before absolute value taken
(if enabled, see MODE1 bits).
1 = Negative active power, this may indicate the CT is wired in backwards
0=
bit 0
Operation Normal
PHC_S: Phase C Sign Bit. This is the sign bit of raw active power before absolute value taken
(if enabled, see MODE1 bits).
1 = Negative active power, this may indicate the CT is wired in backwards
0=
DS51643B-page 22
Operation Normal
© 2008 Microchip Technology Inc.
PIC18F2520 Calculation and Register Description
3.4.3
CAL_CONTROL Register
REGISTER 3-3:
CAL_CONTROL Register
Name
Bits
Address
Cof
CAL_CONTROL
16
0x008
R/W
This is the calibration mode control register. Bit 0 enables calibration mode. When bit
1 is set high, the energy accumulation registers are updated for LINE_CYC line cycles.
After this time, bit 1 is set low by the PIC18F2520 and the update of the energy accumulation registers will stop. This allows the calibration software to set bit 0, clear the
registers, set bit 1, and then start reading the energy accumulation registers as well as
this register to check the status of bit 1. When bit 1 goes low, then LINE_CYC lines
cycles have passed and the energy accumulation 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 energy accumulation registers will be ready to read. While in calibration
mode, those registers that are used as part of the meter calibration and normally
dependent on calibration registers will not be dependent while in calibration mode. For
example, PHA_W_RAW is not dependent on PHA_W_OFF in calibration mode.
U-0
U-0
U-0
U-0
U-0
U-0
U-0
U-0
—
—
—
—
—
—
—
—
bit 15
bit 8
U-0
U-0
U-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’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
x = Bit is unknown
bit 15-3
Unimplemented: Read as ‘0’
bit 2
Reserved:
bit 1
CAL_UPDATE: Calbration Update Bit
Power and energy registers updated for LINE_CYC line cycles when set. 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 this bit to enable update of power and energy registers
starting on next line cycle
0 = When CAL_MODE bit is set and this bit has been set, this bit will be cleared after
LINE_CYC line cycles. At that point, all registers will be updated, and no further updates
will be done until this 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
© 2008 Microchip Technology Inc.
DS51643B-page 23
MCP3909 3-Phase Energy Meter Reference Design
3.4.4
LINE_CYC
REGISTER 3-4:
LINE_CYC REGISTERS
Name
Bits
Address
Cof
LINE_CYC
16
0x00A
R/W
Number of line cycles as a power of two. A setting of 0 indicates 20 or 1 line cycle. A
setting of 1 is 2 line cycles (21), a setting of 2 is 4 lines cycles (22), up to a setting of 8
which is 256 line cycles. When written, this register will not take effect until the previous
number of line cycles has been acquired.
3.4.5
LINE_CYC_CNT
REGISTER 3-5:
LINE_CYC_CNT REGISTER
Name
Bits
Address
Cof
LINE_CYC_CNT
16
0x00C
R
This register counts from 0 and finishes at 2 (LINE_CYC) -1 and then re-starts at 0, where
LINE_CYC represents the value in the LINE_CYC register.
3.4.6
PHy_I_RMS_RAW2
REGISTER 3-6:
PHY_I_RMS_RAW2 REGISTERS
Name
Bits
Address
Cof
PHA_I_RMS_RAW2
48
0x010
R
PHB_I_RMS_RAW2
48
0x024
R
PHC_I_RMS_RAW2
48
0x038
R
These registers are the square of the raw RMS value from the phase y current A/D
converter in LSBs. By definition, these registers will always contain a positive value,
including the situation where power is negative from a backwards CT or otherwise.
These registers are overwritten every LINE_CYC line cycles and are written only once
if calibration is enabled.
3.4.7
PHy_I_RMS_RAW
REGISTER 3-7:
PHY_I_RMS_RAW REGISTERS
Name
Bits
Address
Cof
PHA_I_RMS_RAW
16
0x016
R
PHB_I_RMS_RAW
16
0x02A
R
PHC_I_RMS_RAW
16
0x03E
R
These registers are the raw RMS value from the phase y current A/D converter in LSBs
(square root of the top 32-bits of (PHA_I_RMS_RAW2 + PHA_I_RMS_OFF)). By
definition, these registers will always contain a positive value (even if the CT is in
backwards). These registers are overwritten every LINE_CYC line cycles and are written only once if calibration is enabled.
DS51643B-page 24
© 2008 Microchip Technology Inc.
PIC18F2520 Calculation and Register Description
3.4.8
PHy_I_RMS
REGISTER 3-8:
PHY_I_RMS REGISTERS
Name
Bits
Address
Cof
PHA_I_RMS
16
0x018
R
PHB_I_RMS
16
0x02C
R
PHC_I_RMS
16
0x040
R
These registers are the RMS value of phase y current in X A/LSB, as determined by
the value in the PHA_I_RMS_GLSB register. When displaying the RMS current for
phase y, simply display the (decimal) value in these registers with the decimal point two
digits in from the right. (Note this decimal point location of 0.01A LSB resolution is
specific for the 5(10)A, 220V rating that this meter is designed for). These registers are
overwritten every LINE_CYC line cycles (written only once if calibration is enabled).
3.4.9
PHy_V_RMS_RAW2
REGISTER 3-9:
PHY_V_RMS_RAW2 REGISTERS
Name
Bit
Address
Cof
PHA_V_RMS_RAW2
48
0x01A
R
PHB_V_RMS_RAW2
48
0x02E
R
PHC_V_RMS_RAW2
48
0x042
R
These registers are the square of the raw RMS value from the phase A voltage A/D
converter in LSBs. By definition, they will always contain a positive value. These
registers are overwritten every LINE_CYC line cycles (written only once if calibration is
enabled).
3.4.10
PHy_V_RMS_RAW
REGISTER 3-10:
PHY_V_RMS_RAW REGISTERS
Name
Bits
Address
Cof
PHA_V_RMS_RAW
16
0x020
R
PHB_V_RMS_RAW
16
0x034
R
PHC_V_RMS_RAW
16
0x048
R
This is the raw RMS value from the phase y voltage A/D converter in LSBs (square root
of the top 32-bits of PHA_V_RMS_RAW2 + PHA_V_RMS_OFF). By definition, these
registers will always contain a positive value. Each of these registers is overwritten
every LINE_CYC line cycles (written only once if calibration is enabled).
3.4.11
PHy_V_RMS
REGISTER 3-11:
PHY_V_RMS REGISTERS
Name
Bits
Address
Cof
PHA_V_RMS
16
0x022
R
PHB_V_RMS
16
0x036
R
PHC_V_RMS
16
0x04A
R
These registers are the RMS value of phase y voltage, in X 0.1V/LSB, as determined
by the value in the PHy_V_RMS_GLSB register. When displaying the RMS voltage for
phase y, simply display the value in these registers with the decimal point one digit in
from the right. (Note this decimal point location, or LSB resolution of 0.1V, is specific for
the 5(10)A, 220V rating that this meter is designed for). These registers are overwritten
every LINE_CYC line cycles (written only once if calibration is enabled).
© 2008 Microchip Technology Inc.
DS51643B-page 25
MCP3909 3-Phase Energy Meter Reference Design
3.4.12
I_RMS
REGISTER 3-12:
I_RMS REGISTER
Name
Bits
Address
Cof
I_RMS
24
0x04C
R
This is the sum of all currents (note: algebraic sum of PHA_I_RMS, PHB_I_RMS, and
PHC_I_RMS, NOT RMS sum). This value should equal X A/LSB. When displaying total
RMS current, simply display the (decimal) value in this register with the decimal point
two digits in from the right. (Note this decimal point location of 0.01A LSB resolution is
specific for the 5(10)A, 220V rating that this meter is designed for). This register is
overwritten every LINE_CYC line cycles (written only once if calibration is enabled).
3.4.13
PHy_W_RAW
REGISTER 3-13:
PHY_W_RAW REGISTERS
Name
Bits
Address
Cof
PHA_W_RAW
PHB_W_RAW
48
0x064
R
48
0x06A
R
PHC_W_RAW
48
0x070
R
These registers are the raw phase y active power as it represents the sum of each
phase y current A/D value times phase y 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, a 48-bit register is needed. This is the
register to be read during calibration for calculating the offset and gain values
associated with active phase y power, PHy_W_OFF, PHy_W_GAIN, and
PHy_W_GLSB. These registers are overwritten every line cycle, however if calibration
is enabled, updates will stop once LINE_CYC line cycles have elapsed.
3.4.14
PHy_W
REGISTER 3-14:
PHY_W REGISTERS
Name
Bits
Address
Cof
PHA_W
32
0x076
R
PHB_W
32
0x07A
R
PHC_W
32
0x07E
R
These registers are the value for phase y active power. The goal of calibration is to get
these registers values to equal X 0.1 mW/LSB. When displaying the active power for
phase y, simply display the value in these registers with the decimal point one digit in
from the right, in milli-watts. (Note this decimal point location, or LSB resolution of
0.1 mW, is specific for the 5(10)A, 220V rating that this meter is designed for). This
register is overwritten every LINE_CYC line cycles (written only once if calibration is
enabled).
DS51643B-page 26
© 2008 Microchip Technology Inc.
PIC18F2520 Calculation and Register Description
3.4.15
PHy_VA_RAW
REGISTER 3-15:
PHY_VA_RAW REGISTERS
Name
Bits
Address
Cof
PHA_VA_RAW
48
0x082
R
PHB_VA_RAW
48
0x088
R
PHC_VA_RAW
48
0x08E
R
These registers are the raw phase y apparent power. Unlike active power, this is simply
the multiplication of voltage (PHy_V_RMS) times current (PHy_I_RMS). This is the
register that should be read during calibration for calculating the gain values associated
with apparent phase A power, PHy_VA_GAIN and PHy_VA_GLSB. This register is
overwritten every LINE_CYC line cycles (written only once if calibration is enabled).
3.4.16
PHy_VA
REGISTER 3-16:
PHY_VA REGISTERS
Name
Bits
Address
Cof
PHA_VA
32
0x094
R
PHB_VA
32
0x098
R
PHC_VA
32
0x09C
R
This is the value for phase y apparent power. The goal of calibration is to get this value
to equal X 0.1 mVA/LSB. This is done with the PHy_VA_GLSB registers. When displaying the apparent power for phase y, simply display the value in these registers with the
decimal point one digit in from the right, in milli-volt-amperes. (Note this decimal point
location, or LSB resolution of 0.1 mVA, is specific for the 5(10)A, 220V rating that this
meter is designed for). This register is overwritten every LINE_CYC line cycles (written
only once if calibration is enabled).
3.4.17
PHy_VAR_RAW (NOT IMPLEMENTED)
REGISTER 3-17:
PHY_VAR_RAW REGISTERS
Name
Bits
Address
Cof
PHA_VAR_RAW
48
0x0A0
R
PHB_VAR_RAW
48
0x0A6
R
PHC_VAR_RAW
48
0x0AC
R
This is the raw phase y reactive power. This is the register to be read during calibration
for calculating the gain values associated with reactive phase y power,
PHy_VAR_GAIN and PHy_VAR_GLSB. This register is overwritten every LINE_CYC
line cycles (written only once if calibration is enabled).
NOT IMPLEMENTED IN THIS FIRMWARE/SOFTWARE RELEASE.
© 2008 Microchip Technology Inc.
DS51643B-page 27
MCP3909 3-Phase Energy Meter Reference Design
3.4.18
PHy_VAR (NOT IMPLEMENTED)
REGISTER 3-18:
PHY_VAR REGISTERS
Name
Bits
Address
Cof
PHA_VAR
32
0x0B2
R
PHB_VAR
32
0x0B6
R
PHC_VAR
32
0x0BA
R
This is the value for phase y reactive power. The goal is to get this value to equal X
VAR/LSB. This is done with the PHy_VAR_GLSB registers. When displaying the
reactive power for phase y, simply display the value in these registers with the decimal
point one digit in from the right, in milli-volt-amperes-reactive. (Note this decimal point
location, or LSB resolution of 0.1 mVAR, is specific for the 5(10)A, 220V rating that this
meter is designed for). This register is overwritten every LINE_CYC line cycles (written
only once if calibration is enabled).
NOT IMPLEMENTED IN THIS FIRMWARE/SOFTWARE RELEASE.
3.4.19
PERIOD
REGISTER 3-19:
PERIOD REGISTER
Name
Bits
Address
Cof
PERIOD
32
0x0C0
R
This 32-bit register represents the total number of clock ticks that elapsed over the most
recent LINE_CYC line cycles. Each LSB represents 1.6 us with a 40 MHz clock on the
microcontroller. This register is overwritten every LINE_CYC line cycles (written only
once if calibration is enabled).
DS51643B-page 28
© 2008 Microchip Technology Inc.
PIC18F2520 Calculation and Register Description
3.4.20
ENERGY_W_
REGISTER 3-20:
ENERGY_W_ REGISTERS
Name
Bits
Address
Cof
ENERGY_W
64
0x0C4
R
ENERGY_W_Z
64
0x0CC
R
ENERGY_W_L
32
0x0DA
R
ENERGY_W_L_RAW
48
0x0D4
R
These four registers represent the total active energy accumulated. The
ENERGY_W_L_RAW register is the total active energy accumulated over the previous
LINE_CYC line cycles.
Accumulation is done every line cycle and is:
EQUATION 3-1:
PHA_W_GAIN
ENERGY_W = ENERGY_W + ( PHA_W_RAW + PHA_W_OFF ) • ⎛ ------------------------------------⎞
⎝
⎠
32768
PHB_W_GAIN
+ ( PHB_W_RAW + PHB_W_OFF ) • ⎛⎝ ------------------------------------⎞⎠
32768
PERIOD
PHC_W_GAIN
⎛
+ ( PHC_W_RAW + PHC_W_OFF ) • -------------------------------------⎞ • ----------------------⎝
⎠
65536
32768
Where:
PERIOD
=
the period (in 1.6 µs clock ticks) for the most recent line cycle.
During calibration, ENERGY_W_Z, ENERGY_W, and ENERGY_W_L_RAW will all
have the same value.
Also, during calibration, the PHy_W_OFF register additions are skipped and the
PHy_W_GAIN values are all set to their default value of 0x4000 (16,384).
The ENERGY_W_L_RAW register is the register that should be read when calibrating
CFNUM and CFDEN.
This register is updated every line cycle (updating ends once LINE_CYC line cycles
have passed if calibration is enabled).
© 2008 Microchip Technology Inc.
DS51643B-page 29
MCP3909 3-Phase Energy Meter Reference Design
3.4.21
ENERGY_VA_
REGISTER 3-21:
ENERGY_VA_ REGISTERS
Name
Bits
Address
Cof
ENERGY_VA
64
0x0DE
R
ENERGY_VA_Z
64
0x0E6
R
ENERGY_VA_L
32
0x0F4
R
ENERGY_VA_L_RAW
48
0x0EE
R
These four registers represent the total apparent energy accumulated so far. Energy
from each LINE_CYC line cycles is:
EQUATION 3-2:
ENERGY_VA = ENERGY_VA + ( PHA_I_RMS_RAW
---------------------------------------⎞
• PHA_V_RMS_RAW ) • ⎛⎝ PHA_VA_GAIN
⎠
32768
+ ( PHB_I_RMS_RAW
---------------------------------------⎞
• PHB_V_RMS_RAW ) • ⎛⎝ PHB_VA_GAIN
⎠
32768
+ ( PHC_I_RMS_RAW
---------------------------------------⎞
• PHC_V_RMS_RAW ) • ⎛⎝ PHC_VA_GAIN
⎠
32768
PERIOD • 128
• -------------------------------------65536
Where:
PERIOD
=
the period (in 1.6 µs clock ticks) for the most recent LINE_CYC
line cycles.
Note that during calibration, this value, ENERGY_VA_Z, and ENERGY_VA_L_RAW
will all have the same value.
This register is updated every LINE_CYC line cycles (updating ends after first update
if calibration is enabled).
DS51643B-page 30
© 2008 Microchip Technology Inc.
PIC18F2520 Calculation and Register Description
3.4.22
PHy_I_ABS_MAX
REGISTER 3-22:
PHY_I_ABS_MAX REGISTER
Name
Bit
Address
Cof
PHA_I_ABS_MAX
8
0x0F8
R
PHB_I_ABS_MAX
8
0x0FA
R
PHC_I_ABS_MAX
8
0x0FC
R
Maximum absolute value of phase y raw current, where y is A, B, or C.
3.4.23
PHy_V_ABS_MAX
REGISTER 3-23:
PHY_V_ABS_MAX REGISTER
Name
Bit
Address
Cof
PHA_V_ABS_MAX
PHB_V_ABS_MAX
8
0x0F9
R/W
8
0x0FB
R/W
PHC_V_ABS_MAX
8
0x0FD
R/W
Maximum absolute value of phase y raw voltage, where y is A, B, or C. This register
can be used to check if all three phases are at nominal voltage or if there is a sag in the
voltage of one or more phases.
3.4.24
ENERGY_VAR (NOT IMPLEMENTED)
REGISTER 3-24:
ENERGY_VAR REGISTER
Name
Bit
Address
Cof
ENERGY_VAR
64
0x100
R
ENERGY_VAR_Z
64
0x108
R
ENERGY_VAR_L
32
0x116
R
ENERGY_VAR_L_RAW
48
0x110
R
NOT IMPLEMENTED IN THIS FIRMWARE/SOFTWARE RELEASE.
© 2008 Microchip Technology Inc.
DS51643B-page 31
MCP3909 3-Phase Energy Meter Reference Design
3.5
CALIBRATION REGISTERS
The calibration register set contains all of the offset, gain, LSB adjust, phase delay, and
calibration output pulse adjustment settings. The values to be placed in these
configuration registers come during meter calibration and can be automatically
generated using the “3-Phase Meter Calibration Software” available for download on
Microchip’s website.
3.5.1
PHy_DELAY
REGISTER 3-25:
PHY_DELAY REGISTER
Name
Bit
Address
Cof
PHA_DELAY
8
0x140
R/W
PHB_DELAY
8
0x141
R/W
PHC_DELAY
8
0x142
R/W
Phase y delay, signed 8-bit value, ±2.8125 degrees
(±130 µs for 60 Hz, ±156 µs for 50 Hz)
3.5.2
PHy_I_RMS_OFF
REGISTER 3-26:
PHY_I_RMS_OFF REGISTER
Name
Bit
Address
Cof
PHA_I_RMS_OFF
16
0x144
R/W
PHB_I_RMS_OFF
16
0x148
R/W
PHC_I_RMS_OFF
16
0x14A
R/W
Square of offset for phase y 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, 2 LSBs at a gain of 2 and 6 LSBs at a gain of 8 and 11 LSBs at a gain of
16. 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.5.3
PHy_V_RMS_OFF
REGISTER 3-27:
PHY_V_RMS_OFF REGISTER
Name
Bit
Address
Cof
PHA_V_RMS_OFF
16
0x146
R/W
PHB_V_RMS_OFF
16
0x14A
R/W
PHC_V_RMS_OFF
16
0x14E
R/W
Square of offset for phase y 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.5.4
PHy_I_RMS_GAIN (NOT IMPLEMENTED)
NOT IMPLEMENTED IN THIS FIRMWARE/SOFTWARE RELEASE.
3.5.5
PHy_V_RMS_GAIN (NOT IMPLEMENTED)
NOT IMPLEMENTED IN THIS FIRMWARE/SOFTWARE RELEASE.
DS51643B-page 32
© 2008 Microchip Technology Inc.
PIC18F2520 Calculation and Register Description
3.5.6
PHy_I_RMS_GLSB
REGISTER 3-28:
PHY_I_RMS_GLSB REGISTERS
Name
Bits
Address
Cof
PHA_I_RMS_GLSB
16
0x160
R/W
PHB_I_RMS_GLSB
16
0x164
R/W
PHC_I_RMS_GLSB
16
0x168
R/W
Phase y current gain to produce 0.01A/LSB. The value is always less than one (for
example, 32,767 = 0.9999695). (Note this decimal point location, or LSB resolution of
0.01A, is specific for the 5(10)A, 220V rating that this meter is designed for).
3.5.7
PHy_V_RMS_GLSB
REGISTER 3-29:
PHY_V_RMS_GLSB REGISTERS
Name
Bits
Address
Cof
PHA_V_RMS_GLSB
16
0x162
R/W
PHB_V_RMS_GLSB
16
0x166
R/W
PHC_V_RMS_GLSB
16
0x16A
R/W
Phase y voltage gain to produce 0.1 V/LSB in the PHA_Y_V_RMS register. The value
is always less than one (for example, 32,767 = 0.9999695). (Note this decimal point
location, or LSB resolution of 0.1V, is specific for the 5(10)A, 220V rating that this meter
is designed for).
3.5.8
PHy_W_OFF
REGISTER 3-30:
PHY_W_OFF REGISTERS
Name
Bits
Address
Cof
PHA_W_OFF
32
0x170
R/W
PHB_W_OFF
32
0x174
R/W
PHC_W_OFF
32
0x178
R/W
Phase y active power offset (this is straight offset, not the square as with voltage and
current). A much larger value is need because the power is a running sum. This is a
32-bit signed value.
3.5.9
PHy_W_GAIN
REGISTER 3-31:
PHY_W_GAIN REGISTERS
Name
Bits
Address
Cof
PHA_W_GAIN
16
0x17C
R/W
PHB_W_GAIN
16
0x17E
R/W
PHC_W_GAIN
16
0x180
R/W
Phase y active power gain so that all results can be calibrated to produce equal CF
pulses/watt-hour. The signed 16-bit number produces a change in the PHy_W_RAW
value before being added to the energy registers. A value of 32,767 represents a
99.9939% increase while a value of 8192 represents a decrease of 50%.
© 2008 Microchip Technology Inc.
DS51643B-page 33
MCP3909 3-Phase Energy Meter Reference Design
3.5.10
PHy_W_GLSB
REGISTER 3-32:
PHY_W_GLSB REGISTERS
Name
Bits
Address
Cof
PHA_W_GLSB
16
0x182
R/W
PHB_W_GLSB
16
0x184
R/W
PHC_W_GLSB
16
0x186
R/W
Phase y active power gain to produce X W/LSB. The value is always less than one (for
example, 32,767 = 0.9999695).
3.5.11
PHy_VA_GAIN
REGISTER 3-33:
PHY_VA_GAIN REGISTERS
Name
Bits
Address
Cof
PHA_VA_GAIN
PHB_VA_GAIN
16
0x188
R/W
16
0x18A
R/W
PHC_VA_GAIN
16
0x18C
R/W
Phase y apparent power gain so that all results can be calibrated to produce equal VA
hours. The signed 16-bit number produces a change in the PHy_VA_RAW value before
being added to the energy registers. A value of 32,767 represents a 99.9939%
increase while a value of 8192 represents a decrease of 50%.
3.5.12
PHy_VA_GLSB
REGISTER 3-34:
PHY_VA_GLSB REGISTERS
Name
Bits
Address
Cof
PHA_VA_GLSB
16
0x18E
R/W
PHB_VA_GLSB
16
0x190
R/W
PHC_VA_GLSB
16
0x192
R/W
Phase y apparent power gain to produce X 0.1 mVA/LSB. The value is always less than
one (for example, 32,767 = 0.9999695).
3.5.13
PHy_VAR_GAIN (NOT IMPLEMENTED)
NOT IMPLEMENTED IN THIS FIRMWARE/SOFTWARE RELEASE.
3.5.14
Phy_VAR_GLSB (NOT IMPLEMENTED)
NOT IMPLEMENTED IN THIS FIRMWARE/SOFTWARE RELEASE.
3.5.15
ENERGY_W_GLSB (NOT IMPLEMENTED)
REGISTER 3-35:
ENERGY_W_GLSB REGISTERS
Name
Bits
Address
Cof
ENERGY_W_GLSB
16
0x1A0
R/W
NOT IMPLEMENTED IN THIS FIRMWARE/SOFTWARE RELEASE.
DS51643B-page 34
© 2008 Microchip Technology Inc.
PIC18F2520 Calculation and Register Description
3.5.16
ENERGY_VA_GLSB (NOT IMPLEMENTED)
REGISTER 3-36:
ENERGY_VA_GLSB REGISTER
Name
Bits
Address
Cof
ENERGY_VA_GLSB
16
0x1A2
R/W
NOT IMPLEMENTED IN THIS FIRMWARE/SOFTWARE RELEASE.
3.5.17
ENERGY_VAR_GLSB (NOT IMPLEMENTED)
REGISTER 3-37:
ENERGY_VAR_GLSB REGISTER
Name
Bits
Address
Cof
ENERGY_VAR_GLSB
16
0x1A4
R/W
NOT IMPLEMENTED IN THIS FIRMWARE/SOFTWARE RELEASE.
3.5.18
CREEP_THRESH (NOT IMPLEMENTED)
REGISTER 3-38:
CREEP_THRESH REGISTER
Name
Bits
Address
Cof
CREEP_THRESH
32
0x1A6
R/W
NOT IMPLEMENTED IN THIS FIRMWARE/SOFTWARE RELEASE.
3.5.19
CF_PULSE_WIDTH
REGISTER 3-39:
CF_PULSE_WIDTH REGISTER
Name
Bits
Address
Cof
CF_PULSE
8
0x1AA
R/W
Defines CF pulse width from 0 to 255. Length of width is value * 8 * (1/LINEFREQ) /
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.5.20
CFDEN
REGISTER 3-40:
CFDEN REGISTER
Name
Bits
Address
Cof
CF_DEN
16
0x1AC
R/W
8-bit signed value. Represents the number of shifts for active power energy register
ENERGY_W_L before CFNUM is applied.
3.5.21
CFNUM
REGISTER 3-41:
CFNUM REGISTER
Name
Bits
Address
Cof
CF_NUM
16
0x1AE
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).
© 2008 Microchip Technology Inc.
DS51643B-page 35
MCP3909 3-Phase Energy Meter Reference Design
3.5.22
MODE1_DEF
REGISTER 3-42:
MODE1_DEF REGISTER
Name
Bits
Address
Cof
MODE1_DEF
16
0x1B0
R/W
Mode 1 default power-up settings. On power-up, this register will be read and placed
into the MOD1 register.
3.5.23
PHY_CAL_Status Register
REGISTER 3-43:
PHY_CAL_STATUS REGISTERS
Name
Bits
Address
Cof
PHA_CAL_STATUS
16
0x1B2
R/W
PHB_CAL_STATUS
16
0x1B4
R/W
PHC_CAL_STATUS
16
0x1B6
R/W
The PHASE_Y CAL_STATUS registers holds the calibration status for each individual
phase. Broken down by phase, these are the values that can be calibrated. Each bit
has the status of ‘0’ = Not calibrated, ‘1’ = Calibrated.
R/W-0
R/W-0
R/W-0
DELAY
I_RMS_OFF
V_RMS_OFF
R/W-0
R/W-0
I_RMS_GAIN V_RMS_GAIN
R/W-0
R/W-0
R/W-0
I_RMS_GLSB
V_RMS_GLSB
W_OFF
bit 15
bit 8
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
U-0
R/W-0
W_GAIN
W_GLSB
VA_GAIN
VA_GLSB
VAR_GAIN
VAR_GLSB
—
STANDARD
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-2
CALIBRATION REGISTER: Calibration register status for offset, gain, LSB, and phase delay
1 = This register has been calibrated
0 = This register is NOT calibrated
bit 1
Unimplemented: Read as ‘0’
bit 0
STANDARD: Standard Phase Bit
1 = Standard Phase is THIS phase
0 = This phase is NOT the standard phase
3.5.24
STANDARD_W_RAW
REGISTER 3-44:
STANDARD_W_RAW REGISTER
Name
Bits
Address
Cof
STANDARD_W_RAW
48
0x1B8
R/W
This calibration register holds the energy value that was accumulated during the
standard phase measurement under calibration configuration C1. The software will
read this value when performing phase to phase gain matching during active power
calibration.
DS51643B-page 36
© 2008 Microchip Technology Inc.
MCP3909 3-PHASE ENERGY
METER REFERENCE DESIGN
Chapter 4. Meter Protocol and Timings
4.1
PIC18F2520 PROTOCOL
The RS-232 port of the PIC18F2520 is used to access the register map of the meter.
In addition to reading and writing of registers, there are also dedicated commands for
clearing calibration registers, loading calibration registers, and storing calibration
registers to flash. The first byte RS-232 data is an ASCII character that represents the
command, and each command has a specific protocol. Each command ends with the
ASCII character “X”.
4.1.1
Command Description
The first byte of the data (byte 0) is an ASCII character E, L, S, W and R.
•
•
•
•
•
E - Echo All Data Received (ECHO)
L - Load Calibration Registers from Flash (LOAD)
S - Store Calibration Registers (STORE)
W - Write Bytes (WRITE)
R - Read Bytes (READ)
The last data byte is always an 'X' character. All commands will result in the same command being returned. The exception is the 'R' (read) command which will return additional data in lieu of the number of bytes.
4.1.1.1
“E” ECHO: - ECHO ALL DATA RECEIVED
Example: 'EABCDEFGHIJKLMNOPQRSTUVWYZ1234567890X'.
Returns: 'EABCDEFGHIJKLMNOPQRSTUVWYZ1234567890X'.
4.1.1.2
“L” LOAD: LOAD CALIBRATION REGISTERS FROM FLASH.
Example: 'LX'.
Returns: 'LX'.
This command is used to verify that the calibration values were actually written into
flash (or eeprom). Once the software executes a 'SX' command, it should verify that
the values were stored by issuing an 'LX' command and then reading the calibration
values with a 'R' command.
4.1.1.3
“S” STORE: STORE CALIBRATION REGISTERS INTO FLASH
Note that the store command will write all calibration values to internal EEPROM and
this function takes some time. During that time, the meter is not functional. The store
command should only be used after calibrating the meter and not while it is in actual
use.
Example: 'SX'.
Returns: 'SX'.
© 2008 Microchip Technology Inc.
DS51643B-page 37
MCP3909 3-Phase Energy Meter Reference Design
4.1.1.4
“W” WRITE: WRITE STARTING AT SPECIFIED ADDRESS
Write specified bytes.
Example: 'W030000102030405060708090A0B0C0D0E0FX'.
Returns: 'W030000102030405060708090A0B0C0D0E0FX'.
Note:
If number of data characters is odd, the last character (the one just prior to
the 'X') will be ignored.
3 Address Bytes (ASCII)
Command Byte
7
6
5
4
3
2
1
7
0
6
5
4
3
2
1
0
7
6
5
ASCII Data
7
6
5
4
3
2
TABLE 4-1:
1
0
3
2
1
0
7
6
5
4
3
2
1
0
“X” (ASCII)
7
6
5
4
3
2
1
0
7
6
5
4
3
2
1
0
WRITE COMMAND EXAMPLES
Description
WRITE of 255d to
PHA_W_OFF Register
FIGURE 4-1:
4
Command ASCII
Command Hex
“W 170 00 F F X”
57 31 37 30 30 30 46 46 58
WRITE Command Protocol.
4.1.1.5
“R” READ: READ STARTING AT SPECIFIED ADDRESS
Example: 'R03010X' (read 16 bytes starting at address 30h).
Returns: 'R030000102030405060708090A0B0C0D0E0FX'
Note:
For 16 bytes, there are 32 ASCII characters returned or two characters per
byte.
3 Address Bytes (ASCII)
Command Byte
7
6
5
4
3
2
1
0
7
6
5
4
3
2
1
0
7
6
# Bytes to Read (2 Bytes ASCII)
7
6
5
4
TABLE 4-2:
3
2
1
0
7
6
5
4
3
2
3
2
1
0
1
0
7
6
5
4
3
2
1
0
1
0
7
6
5
4
3
2
READ COMMAND EXAMPLES
READ on ENERGY_W_L_RAW Register
DS51643B-page 38
4
“X” (ASCII)
DESCRIPTION
FIGURE 4-2:
5
COMMAND ASCII
COMMAND HEX
“R 0D4 06 X”
52 00 44 34 30 36 58
Read Command Protocol.
© 2008 Microchip Technology Inc.
MCP3909 3-PHASE ENERGY
METER REFERENCE DESIGN
Chapter 5. Meter Calibration
5.1
CALIBRATION OVERVIEW
The method to calculate the values for the calibration registers in Chapter 3 are
described in this chapter. These registers are used to remove offset, set gain and
phase adjustments, and include (units)/LSB adjustments for all the meter outputs. The
calibration flow charts and equations presented in this section are all automated using
Microchip’s “3-phase Energy Meter Calibration Software”, downloadable from Microchip’s energy metering web site. The following calibration routines are described in this
chapter.
• Active Power Calibration
• RMS Current and Voltage Calibration
• Apparent Power Calibration
The method of calibrating these three separate signal flows can be combined into 4 different calibration configurations. These configurations consist of supplying specific
voltages and currents at specific phase angles to the meter during calibration.
In addition, one of the 3 phases needs to be set as the “standard” phase for phase
matching. This process is described in the following sections through steps and flow
charts and is handled automatically by the calibration software described in
Chapter 6. “3-Phase Energy Meter Calibration Software”.
5.1.1
IB, VB, PH<s>, PH<un> Meter Constant and Calibration
Configurations
Calibration of the 3-phase power meter involves four different test configurations and
three iterations of each of these four configurations, one iteration for each phase. The
first iteration is typically done on the "standard" phase. This phase represents the
standard that the other two phases must be calibrated to.
For example, meter design example 5(10)A, IB = 5, IMAX = 10A.
Calibrating the three phase power meter involves these four test configurations:
1. Configuration C1 - Basic voltage VB and basic current IB at a power factor of 1.
For example, 220V and 5A
2. Configuration C2 - Basic voltage VB and basic current IB at a power factor of
0.5.
3. Configuration C3 - Basic voltage VB and 1/100 of IB at a power factor of 1.
For example, 220V and 50 mA.
4. Configuration C4 - 1/10 of Basic voltage VB and 1/10 of IB at a power factor of 1.
For example, 22V and 1A.
These calibration configurations are typically steps in a sequence. Almost always,
configuration C1 is the most important and must be done first. The other configurations
require values obtained from configuration C1, but are not dependent on values
obtained from the other configurations. In other words, C1 is probably the first step,
while the other configurations can be done in any order.
© 2008 Microchip Technology Inc.
DS51643B-page 39
MCP3909 3-Phase Energy Meter Reference Design
Typically, phase A is the standard phase that the other two phases (B and C) are
calibrated to. However, there is no particular reason why this should be the case. Still,
there needs to be a way of signifying the standard phase. This document uses the
shorthand PHy<register name> to stand for an arbitrary register. For example,
PHy_W_GAIN stands for PHA_W_GAIN, PHB_W_GAIN, and PHC_W_GAIN.
The notation PH<s>… stands for the standard phase register whose value was
obtained from the three phase power meter during calibration setup C1. The notation
PH<u1> represents one of the two uncalibrated phases while PH<u2> represents the
other. In general, the calibration routines focus on the PH<u1> registers while the
PH<u2> registers would be calculated in the same way.
The meter constant is typically given in units of impulses per kilo-watt hour. As an
example, the calibration output frequency of CF, METER_CONSTANT =
3200 imp/kWh or 6400 imp/kWh.
Note:
DS51643B-page 40
To calibrate the offset for RMS voltage for a given phase at 1/10 of Vcal, the
meter must have power from one of the other two phases.
© 2008 Microchip Technology Inc.
Meter Calibration
5.2
ACTIVE POWER SIGNAL FLOW AND CALIBRATION
5.2.1
Active Power Calibration Overview & Signal Path
The active power signal flow has two separate signal paths. The first path is a total of
all 3 phases and leads to both the CF output pulse frequency, which is proportional to
the total active power being measured by the energy meter, and the active energy
registers, again, which are functions of all three phases. These energy outputs are in
units of kWh and can also be phase gated using the MODE1 register. The second path
is unique to each phase and leads to the active power output registers (PHy_W). Each
phase has its own separate active power registers.
Table 5-1 represents the registers being set during active power calibration.
TABLE 5-1:
CALIBRATION REGISTERS GENERATED THROUGH THIS ROUTINE
Register Name
Equations
CFDEN
Section 5.3.3
CFNUM
Section 5.3.3
PHy_W_GAIN
Section 5.3.5
PHy_DELAY
Section 5.3.7
PHy_W_OFF
Section 5.3.9
PHy_W_GLSB
Section 5.3.3
ENERGY_W_GLSB
Not Implemented
Note:
Important! There are two important items to consider when calibrating a meter. The first is that
each phase must be calibrated separately for the meter to be entirely calibrated. The second
item is that since the second signal path includes all 3 phases (CF output and ENERGY), one
of the phases must be used to coarsely adjust the calibration registers in this path (CFNUM,
CFDEN, and ENERGY_W_GLSB). This phase is the “standard phase”. The other two phases
can then be ‘fine tuned’ to gain match the standard phase by adjusting the registers in these
paths prior to the three phase summation (PHy_W_GAIN, and PHy_VA_GAIN). These registers MUST be set after the coarse registers have been set by one of the three phases.
Other 2
Phases
ADC
NOTE 1
CURRENT
PHy_DELAY:8
Σ
X
Φ
ADC
X
Σ
|X|
PHy_W_GAIN:16
PHy_W_OFF:32
VOLTAGE
PHy_W_GLSB:16
Phy_W_RAW:48
MCP3909
Digital to
Frequency
Converter
kW
X
Phy_W:32
ENERGY_W_GLSB:16 (NOT IMPLEMENTED)
CFNUM:16
/
CFDEN:8
PERIOD:16 (INTERNAL REGISTER)
ENERGY_W_L:32
ENERGY_W_L_RAW:48
ENERGY_W_Z:64
ENERGY_W:64
FIGURE 5-1:
kWh
X
X
Note 1:
CF OUTPUT
FREQUENCY!
This absolute value is controlled by the MODE1
register. See Section 3.4.1 for more information.
Active Power Signal Path showing Output and Calibration Registers.
© 2008 Microchip Technology Inc.
DS51643B-page 41
MCP3909 3-Phase Energy Meter Reference Design
5.3
RMS CURRENT, RMS VOLTAGE, APPARENT POWER SIGNAL FLOW AND
CALIBRATION
5.3.1
RMS Current, RMS Voltage, and Apparent Power Overview and
Signal Path
The RMS current and voltage outputs require a two point calibration reading at
configurations C1 and C4. The automated USB software performs these calibrations
suggested on the calibration values entered in the text boxes on the meter design
window.
The following table represents the registers being set for RMS Current and Voltage
calibration.
TABLE 5-2:
RMS CURRENT, RMS VOLTAGE, AND APPARENT POWER
CALIBRATION REGISTERS
Register
Equation
PHy_V_RMS_OFF
Section 5.3.11
PHy_I_RMS_OFF
Section 5.3.11
PHy_V_RMS_GLSB
Section 5.3.11
PHy_I_RMS_GLSB
Section 5.3.11
PHy_VA_GAIN
Section 5.3.5
PHy_VA_GLSB
Section 5.3.3
ENERGY_VA_GLSB
Not Implemented
PHy_I_RMS_OFF:16
PHy_I_RMS_RAW:16
ADC
Σ
X2
CURRENT
A
X
PHy_I_RMS:16
RMS Current
PHy_I_RMS_GLSB:16
PHy_V_RMS_OFF:16
Σ
X2
ADC
PHy_V_RMS_GLSB:16
V
X
PHy_V_RMS:16
RMS Voltage
Apparent Power
MCP3909
PHy_V_RMS_RAW:16
X
PHA_VA_RAW
X
ENERGY_VA_GLSB:16 (NOT IMPLEMENTED)
X
PHA_VA_GAIN:16
PERIOD:32 (INTERNAL REGISTER)
X
X
Σ
Other 2
Phases
ENERGY_VA_L_RAW:48
ENERGY_VA_Z:64
ENERGY_VA:64
FIGURE 5-2:
DS51643B-page 42
kVA
kVAh
ENERGY_VA_L:32
PHA_VA_GLSB:16
VOLTAGE
PHA_VA:32
RMS Current, Voltage, and Apparent Power Flow.
© 2008 Microchip Technology Inc.
Meter Calibration
5.3.2
Main Flow Chart for Calibration
Begin Calibration
for This Phase
Set MODE1 register
bits and LINE_CYC
register
Is this Phase
being set as
standard
phase?
YES
Proceed to Gain Matching
Flow
NO
Put meter in Calibration
Configuration C1 (VB
and IB at PF=1)
YES
Is this Phase
being gain
matched to
the standard
phase?
Enable Calibration Mode
by setting bit 0 and 1 of
CAL_CONTROL register
to 1
Has a
standard
phase been
calibrated
for CF
adjust
?
YES
NO
NO
Error, must Cal CF with
Standard Phase
Is
CAL_MODE
bit 1 low
?
YES
Calibrate
Phase delay
compensation
?
NO
Proceed to Active Power
Phase Delay Flow For This
Phase
NO
YES
Read contents of
ENERGY_W_RAW,
PHy_W_RAW
Calibrate
Active
Power
Offset?
YES
Calculate & Write
CFNUM, CFDEN,
PHy_W_GLSB, and
PHy_VA_GLSB contents
based equations in
Section 5.3.3
Proceed to
Active
Power Offset
Flow For
This Phase
Calibrate
RMS?
NO
NO
YES
Proceed to
RMS Flow
For This
Phase
End This
Phase
FIGURE 5-3:
Main Calibration Flow Chart.
© 2008 Microchip Technology Inc.
DS51643B-page 43
MCP3909 3-Phase Energy Meter Reference Design
5.3.3
Equations for Configuration C1 Calibration
The following equations represent the proper method for calculating the calibration and
correction factors after configuration C1. The PC calibration software handles these
calculations automatically.
The following equations only apply when calibrating a standard phase.
The first 4 equations apply for calculating the proper output frequency of the CF output.
See Figure 5-3 for meter input conditions.
EQUATION 5-1:
Meter Constant V B I B
CF_IMP_S = ------------------------------------- • -----------1000
3600
EQUATION 5-2:
LINE_CYC_NUM = 2
LINE_CYC
EQUATION 5-3:
32
2 • CF_IMP_S LINE_CYC_NUM • 256
LOG ---------------------------------------- ---------------------------------------------------------Line Freq • 128
ENERGY_W_L_RAW
CFDEN = --------------------------------------------------------------------------------------------------------------------------- + 1
LOG(2)
Note:
Convert to 8-bit signed integer for compatibility with 18F2520 register and
firmware calculations.
EQUATION 5-4:
32
• CF_IMP_S⎞
⎛ 2---------------------------------------⎝ Line Freq • 128 ⎠
CFDEN
CFNUM = ---------------------------------------------------------------- • 2
• 32768
ENERGY_W_L_RAW -⎞
⎛ --------------------------------------------------------⎝ LINE_CYC_NUM • 256⎠
Note:
Convert to 16-bit signed integer for compatibility with 18F2520 register and
firmware calculations.
The gain matching registers for the standard phase need to be set to the following values when calibrating a standard phase:
EQUATION 5-5:
PHY_W_GAIN = 16, 384
The following equations apply for calculating the proper GLSB registers when calibrating both a standard phase, and a non-standard phase. See flow chart for meter input
conditions.
DS51643B-page 44
© 2008 Microchip Technology Inc.
Meter Calibration
EQUATION 5-6:
PLSB = Value from Table 6-3 based on VB and IMAX values
EQUATION 5-7:
V B • I B⎞
⎛ ---------------⎝ PLSB ⎠
PHY_W_GLSB = ------------------------------------------------------------- • 32768
PHY_W_RAW -⎞
⎛ -----------------------------------------------------⎝ 64 • LINE_CYC_NUM⎠
Note:
Convert to 16-bit signed integer for compatibility with 18F2520 register and
firmware calculations.
The calculation for PHy_VA_GLSB is identical except that it uses the PHy_VA_RAW
register instead of PHy_W_RAW:
EQUATION 5-8:
B • I B⎞
⎛V
---------------⎝ PLSB ⎠
PHY_VA_GLSB = ------------------------------------------------------------- • 32768
PHY_VA_RAW -⎞
⎛ -----------------------------------------------------⎝ 64 • LINE_CYC_NUM⎠
Note:
© 2008 Microchip Technology Inc.
Convert to 16-bit signed integer for compatibility with 18F2520 register and
firmware calculations.
DS51643B-page 45
MCP3909 3-Phase Energy Meter Reference Design
5.3.4
Flow Chart for Gain Matching Flow
Set MODE1 register
bits and LINE_CYC
register
Put meter in Calibration
Configuration C1 (VB
and IB at PF=1).
Consider this phase U1
Enable Calibration Mode
by setting bit 0 and 1 of
CAL_CONTROL register
to 1
Is
CAL_MODE
bit 1 low
?
NO
YES
Read contents of
PHy_W_RAW register
Read contents of
STAND_W_RAW
register
Calculate & Write
PHy_W_GAIN and
PHy_VA_GAIN
calibration register
contents based on
equations in
Section 5.3.5
FIGURE 5-4:
DS51643B-page 46
Gain Matching Flow Chart.
© 2008 Microchip Technology Inc.
Meter Calibration
5.3.5
Gain Matching Equations
The following equations apply for calculating the gain matching in between phases.
The notation “<S>” is used for the standard phase measurement, thus the
PH<S>_W_RAW number is read from the standard phase register, STAND_W_RAW,
that was recorded during the standard phase calibration.
The notation “<Un>” represents the value for the phase being matched to the standard
phase.
For active power gain matching:
EQUATION 5-9:
STAND_W_RAW
PHY_W_GAIN = ⎛ -----------------------------------------⎞ • 16384
⎝ PHY_W_RAW ⎠
Note:
Convert to 16-bit signed integer for compatibility with 18F2520 register and
firmware calculations.
For apparent power gain matching:
EQUATION 5-10:
STAND_W_RAW
PHY_VA_GAIN = ⎛⎝ -----------------------------------------⎞⎠ • 16384
PHY_VA_RAW
Note:
© 2008 Microchip Technology Inc.
Convert to 16-bit signed integer for compatibility with 18F2520 register and
firmware calculations.
DS51643B-page 47
MCP3909 3-Phase Energy Meter Reference Design
5.3.6
Flow Chart for Active Power Phase Delay
Set MODE1 register bits
and LINE_CYC register
Put meter in Calibration
Configuration C2 (VB
and IB at PF=0.5)
Enable Calibration Mode
by setting bit 0 and 1 of
CAL_CONTROL reg to 1
Is
CAL_MODE
bit 1 low?
NO
YES
Read contents of
PHy_W_RAW register
Read contents of
STAND_W_RAW
register
Calculate & Write
PHy_DELAY calibration
register contents based
on equations in
Section 5.3.7
Proceed to
Offset Flow
For This
Phase
FIGURE 5-5:
DS51643B-page 48
YES
Calibrate
Active
Power
Offset?
NO
End This
Phase
Active Power Phase Delay Flow Chart.
© 2008 Microchip Technology Inc.
Meter Calibration
5.3.7
Phase Matching Equations
For active power the following equations apply for calculating the time shift delay for a
given phase.
EQUATION 5-11:
W1 = PHY_W_RAW @ PF = 1, Configuration C1
EQUATION 5-12:
W2 = PHY_W_RAW @ PF = 0.5, Configuration C2
EQUATION 5-13:
LINE_CYC_NUM_1 = LINE_CYC_NUM @ PF = 1, Configuration C1
EQUATION 5-14:
LINE_CYC_NUM_2 = LINE_CYC_NUM @ PF = 0.5, Configuration C2
EQUATION 5-15:
180
– 1 W2 ⁄ LINE_CYC_NUM2
COS ⎛⎝ -----------------------------------------------------------⎞⎠ × --------- – 60
W1 ⁄ LINE_CYC_NUM1
PI
PHY_DELAY = ------------------------------------------------------------------------------------------------------------------- • 128
2.8125
Note 1:
2:
© 2008 Microchip Technology Inc.
Convert to 8-bit signed integer for compatibility with 18F2520 register and
firmware calculations.
Since 60 degrees (default) is being subtracted from the measured
quantity, the current should lag the voltage under configuration C2.
DS51643B-page 49
MCP3909 3-Phase Energy Meter Reference Design
5.3.8
Flow Chart for Active Power Offset
Set MODE1 register bits
LINE_CYC register
(suggest 256 Line Cycles)
Put meter in Calibration
Configuration C3 (VB
and 1/100 IB at PF=1)
Enable Calibration Mode
by setting bit 0 and 1 of
CAL_CONTROL register
to 1
Is
CAL_MODE
bit 1 low
?
NO
YES
Read contents of
ENERGY_W_L_RAW
Register
Calculate & Write
PHy_W_OFF register
contents based on
equations in
Section 5.3.9
End of This
Phase
FIGURE 5-6:
DS51643B-page 50
Active Power Offset Flow Chart.
© 2008 Microchip Technology Inc.
Meter Calibration
5.3.9
Equations for Active Power Offset Calibration
For active power offset the following equations apply for a given phase. W1 corresponds to the PHy_W_RAW register obtained during configuration C1. LINE_CYC_W1
corresponds to the LINE_CYC during this measurement.
W2 corresponds to the PHy_W_RAW register obtained during configuration C3.
LINE_CYC_W2 is the LINE_CYC during this measurement.
EQUATION 5-16:
W1 = PHY_W_RAW @ I B, Configuration C1
EQUATION 5-17:
W2 = PHY_W_RAW @ 1/100 I B , Configuration C3
EQUATION 5-18:
LINE_CYC_NUM_1 = LINE_CYC_NUM in Configuration C1
EQUATION 5-19:
LINE_CYC_NUM_2 = LINE_CYC_NUM in Configuration C3
EQUATION 5-20:
W1 ⁄ 100
W2
PHY_W_OFF = ------------------------------------------------------ – -----------------------------------------------------LINE_CYC_NUM_W1
LINE_CYC_NUM_W2
Note:
Convert to 32-bit signed integer for compatibility with 18F2520 register and
firmware calculations
The PHy_W_OFF registers hold a signed 32-bit value. However, the math in the
microcontroller could overflow for some values near the limits. Limit check the resulting
value to make sure the value is between -2,130,706,432 and 2,130,706,431 (inclusive).
Values less than -2,130,706,432 should be set to -2,130,706,432 while values greater
than 2,130,706,431 should be set to 2,130,706,431. If the value is limited, the user
should be aware that the meter could not completely correct the offset.
It is expected that this value will always be negative. If the value is positive, it may
indicate that the user has not provided a large enough number of line cycles for
configuration C4 (where the number of line cycles should be set to a larger value such
as 64 or 128). This may also be true if offset does not contribute a large enough
percentage to W2 (for example, 10% to 50% or more).
© 2008 Microchip Technology Inc.
DS51643B-page 51
MCP3909 3-Phase Energy Meter Reference Design
5.3.10
Flow Chart for RMS Calibration
Set MODE1 register bits
and LINE_CYC register
Put meter in Calibration
Configuration C4 (VB
and 1/10 IB at PF=1)
Is
CAL_MODE
bit 1 low?
NO
YES
Read contents of
Phy_I_RMS_RAW2 and
Phy_V_RMS_RAW2
registers (referred to as
IR2 and VR2 in equation
set)
Fetch values from
Calibration
Configuration C1
Calculate & Write
PHy_I_RMS_OFF,
PHy_V_RMS_OFF,
PHy_I_RMS_GLSB,
PHy_V_RMS_GLSB,
calibration register
contents based
equations in
Section 5.3.11
End of This
Phase
FIGURE 5-7:
DS51643B-page 52
Flow Chart for RMS Calibration.
© 2008 Microchip Technology Inc.
Meter Calibration
5.3.11
Equations for RMS Calibration
The following equations represent the proper method for calculating the calibration and
correction factors for the RMS current and RMS voltage. The PC calibration software
handles these calculations automatically.
Typically, the VMIN and IMIN voltages and currents will be 1/10 of the VB and IB values.
For RMS Offset the following equations apply:
EQUATION 5-21:
IR1 = PHY_I_RMS_RAW2 @ I B , Configuration C1
EQUATION 5-22:
VR1 = PHY_V_RMS_RAW2 @ I B , Configuration C1
EQUATION 5-23:
IR2 = PHY_I_RMS_RAW2 @ I B , Configuration C4
EQUATION 5-24:
VR2 = PHY_V_RMS_RAW2 @ I B , Configuration C4
EQUATION 5-25:
I B @ C1
I G = -------------------I B @ C4
EQUATION 5-26:
V B @ C1
V G = ---------------------V B @ C4
EQUATION 5-27:
IR1 – IR2-⎞
⎛ --------------------------– IR 2
⎝ IG • IG – 1⎠
PHY_I_RMS_OFF = -----------------------------------------------65536
Note:
© 2008 Microchip Technology Inc.
Convert to 16-bit signed integer for compatibility with 18F2520 register and
firmware calculations
DS51643B-page 53
MCP3909 3-Phase Energy Meter Reference Design
EQUATION 5-28:
VR1 – VR2-⎞
⎛ -----------------------------– VR 2
⎝ VG • VG – 1⎠
PHY_V_RMS_OFF = ----------------------------------------------------65536
Note:
Convert to 16-bit signed integer for compatibility with 18F2520 register and
firmware calculations
For RMS LSB correction, the following equations apply:
EQUATION 5-29:
ILSB = Value from Table 6-2 based on IMAX value
EQUATION 5-30:
VLSB = Value from Table 6-4 based on VB value
EQUATION 5-31:
IB ⎞
⎛ -----------⎝ ILSB⎠
PHY_I_RMS_GLSB = ------------------------------------------------------------------------ • 32768
IR 1
-------------- + PHY_I_RMS_OFF
65536
Note:
Convert to 16-bit signed integer for compatibility with 18F2520 register and
firmware calculations
EQUATION 5-32:
VB ⎞
⎛ ------------⎝ VLSB⎠
PHY_V_RMS_GLSB = ------------------------------------------------------------------------- • 32768
VR 1
-------------- + PHY_V_RMS_OFF
65536
Note:
DS51643B-page 54
Convert to 16-bit signed integer for compatibility with 18F2520 register and
firmware calculations
© 2008 Microchip Technology Inc.
MCP3909 3-PHASE ENERGY
METER REFERENCE DESIGN
Chapter 6. 3-Phase Energy Meter Calibration Software
6.1
OVERVIEW
This chapter is meant to serve as a user’s guide for Microchip’s energy meter
calibration software “3-Phase Energy Meter Calibration Software”. The software is
compatible with Windows® XP and Windows® 2000. The software uses USB to
communicate to the energy meter, however, the commands are converted to RS-232
commands which are carried out on the PIC18F2520. The USB interface is solely for
the calibration software and meter connection.
6.2
USING THE CALIBRATION SOFTWARE WITH THE USB INTERFACE
MODULE
LCD Display
USB
PIC18F4550
USB to PC
To use the monitoring and calibration software on the PC you must have the USB
Interface Module installed on the main board of the MCP3909 3-Phase Energy Meter
Reference Design, OR have a customized meter and USB to RS-232 interface located
off the meter. This board does not have to be in the final meter design for RS-232
low-cost meters.
USB
Personal
Computer
USB Interface Module
RS-232
Isolation Barrier
PIC18F2520
Main Board and Meter Engine
FIGURE 6-1:
USB to RS-232 Communication.
The PIC18F4550 is set up as a full speed HID device (Host Interface Device). The USB
communication uses 64 byte reports. The full 64-byte report is 64 8-bit bytes with
values from 0x00 to 0xFF. The USB report structure will be the same as the RS-232
command structure from the PIC18F4550 to the PIC18F2520. This will allow a RS-232
version of the software to be easily written. The PIC18F4550 simply shifts these
commands from the USB port out the RS-232 port to the PIC18F2520.
© 2008 Microchip Technology Inc.
DS51643B-page 55
MCP3909 3-Phase Energy Meter Reference Design
6.3
SOFTWARE OVERVIEW AND TAB CONTROL
The software has three tabs at the top that correspond to three different frames in the
main screen.
• Results
• Log
• Communications
The results frame shows the power readings coming back from the meter, such as
active power, apparent power, RMS current and RMS voltage.
The log frame shows the message logs that are used to record all activity that is taking
place inside the software during calibration, reading, writing registers, etc.
The communications frame shows all USB activity that takes place during calibration
or meter reading. This can be used to track activity and generate customized meter
calibration scripts.
Note that at software start, the program polls to see if the meter is connected to the PC
via USB. If the meter hardware is found connected (or not connected), an appropriate
message is placed in the scrolling message/status window, e.g. “Meter not connected
(PID0x0xx)”, and the icon in the bottom right hand corner of the results window is
turned red. When a meter is connected, the icon is green and the software refreshes
all visible registers and calibration icons.
DS51643B-page 56
© 2008 Microchip Technology Inc.
3-Phase Energy Meter Calibration Software
6.4
RESULTS FRAME
This frame shows the present readings coming back from the meter, contains buttons
for calibration control, contains a frame for all the registers in the PIC18F2520, and
contains a frame to input the meter design constants such as calibration current,
maximum current, meter constant, and others.
FIGURE 6-2:
Main Screen with Results Frame Active.
The results frame contains the current power and energy measurement results from the
three phases. The registers in this frame are continually polled from the USB device
and refreshed on the PC side every 2.5 seconds.
The following registers represent the results that are ready from the meter in this area
of the software. The text boxes in the results frame that are totals, are the sum of the
three phases. This total is done on the software side, all other numbers in this frame
are the exact number that is read from the registers in Table 6-1.
TABLE 6-1:
REGISTERS BEING READ FOR THE METER READING (NOTE 1)
Meter Reading
Register
Example
Active Power, Phase A
PHA_W
102.88 W
Active Power, Phase B
PHB_W
104.22 W
Active Power, Phase C
PHC_W
103.77 W
Apparent Power, Phase A
PHA_VA
273.2371 VA
Note 1:
© 2008 Microchip Technology Inc.
At the time of this software and document release, reactive power and reactive
energy is not supported. Contact Microchip for updated software and firmware that
will be available for these power quantities.
DS51643B-page 57
MCP3909 3-Phase Energy Meter Reference Design
TABLE 6-1:
REGISTERS BEING READ FOR THE METER READING (NOTE 1)
Meter Reading
Apparent Power, Phase B
Apparent Power, Phase C
RMS Current Phase A
Register
Example
PHB_VA
266.2323 VA
PHC_VA
208.11 VA
PHA_I_RMS
0.45 A
RMS Current Phase B
PHB_I_RMS
0.33 A
RMS Current Phase C
PHC_I_RMS
10.23 A
RMS Voltage Phase A
PHA_V_RMS
220.1 V
RMS Voltage Phase B
PHB_V_RMS
222.4 V
RMS Voltage Phase C
PHC_V_RMS
220.9 V
Note 1:
6.4.1
At the time of this software and document release, reactive power and reactive
energy is not supported. Contact Microchip for updated software and firmware that
will be available for these power quantities.
Decimal Point Location
The location of the decimal point, i.e the resolution of the power quantities, is
determined by the values that are entered in the meter design section of this screen.
When the meter is calibrated using the calibration steps automated with this software,
the proper GLSB correction factor is calculated to ensure the least significant bit
represents the least significant digit for a given quantity. For example, if the
PHA_I_RMS register, which represents the RMS current for Phase A, contains the
decimal value 4523 and the ILSB has been defined to be 0.01 based on the meter
design entry, this value represents exactly 45.23 Amperes.
Another example for active power as shown in Figure 6-2, the PHA_W register contains the value 1014498. For this meter design example the power resolution was
defined to be 0.1 mW. Therefore this register represents exactly 101.4498 Watts.
DS51643B-page 58
© 2008 Microchip Technology Inc.
3-Phase Energy Meter Calibration Software
6.5
CALIBRATION ICONS
The results frame contains small symbols that represent if a given calibration STEP has
occurred, and a given calibration register has been written, or not.
There are 5 symbols for total that represent the steps of calibration.
•
•
•
•
•
CF for standard phase calibration
φ - Phase delay
O - Offset
G - Gain
L - GLSB
The status of these symbols (enabled / disabled) are saved in the PH_Y_CAL_STATUS
registers and is loaded when the software detects a meter connected to the PC. A
yellow icon represents that a given step HAS OCCURED.
It should be noted that the CF icon can only be enabled in 1 of the 3 phases. This is
because only 1 phase can be selected as the ‘standard phase’, and the other phases
must then be gained matched to this standard phase. For this reason you will note that
the gain icons for active power and apparent power ‘G’ are disabled in the standard
phase by turning a dark grey color.
For more information on the various steps of calibration, refer to Chapter 5. “Meter
Calibration”.
6.6
REGISTER LIST
The results screen also includes a complete list of the registers, their address, name,
width, state (readable (R) or readable and writable (R/W)), value, description, and if
they have been selected for monitor refresh.
Unless they have been selected to be monitored, the registers in this frame are NOT
updated every 2.5 seconds like the meter reading section. To refresh the complete
register list, select “Refresh” from the menu.
To select a specific register for monitor, right click on the row in this frame and then
select “monitor” from the menu by left-clicking.
6.7
WRITING TO INDIVIDUAL REGISTERS
While not recommended as it will interfere with the calibration process, it is possible to
write to individual registers. All writes to registers is automated during the calibration
process, and it should not be necessary to write to a specific register to calibrate a
meter. However you can perform writes to your meter and test various configurations
by writing to the registers individually.
To write a value to a specific register, right click on the register and then select “write
value” on the menu by left clicking. At this point, you will be asked the value to be
written to the meter.
© 2008 Microchip Technology Inc.
DS51643B-page 59
MCP3909 3-Phase Energy Meter Reference Design
6.8
METER CALIBRATION
One of the main functions of the software is to assist in meter calibration. This process
is accomplished by selecting the phase for calibration and clicking the “CALIBRATE”
button. The following steps will occur for a given phase:
1. Calibrate phase under configuration C1 as either a standard phase or a
non-standard phase.
2. Calibrate phase under configuration C2 for phase delay.
3. Calibrate phase under configuration C3 for active power offset.
4. Calibrate phase under configuration C4 for RMS offset.
For a meter to be entirely calibrated, all 3 phases must be calibrated separately, with
one of the phases being selected as the standard phase.
6.8.1
Calibration Step 1 - Configuration C1
The first step is to apply VCAL and ICAL to a given phase and choose whether or not
this phase is being selected as the standard phase. The software will prompt the user
with this question and also instruct the user to apply the correct voltages and currents.
The software calculates the calibration registers through the equations defined in
Chapter 5. “Meter Calibration” and allows the user to input the exact voltages and
current for more correct calibration register numbers.
The following dialog window will appear in configuration C1:
FIGURE 6-3:
Calibration Step C1 with calibration settings input boxes.
At this point, the software will default to the VCAL and ICAL values that are currently in
the meter design frame. The user can MODIFY these values to the exact currents and
voltages that are being read from the calibrated meter equipment present during
calibration. In the example above, the user modified the numbers 220 to be 220.23V
and 10A to be 10.15A.
Once the user selects the “OK” button, energy accumulation will occur and status can
be observed via the energy accumulation bar.
Section 5.3.3 and Section 5.3.5 describes the registers and equations that the software uses to calibrate the meter.
DS51643B-page 60
© 2008 Microchip Technology Inc.
3-Phase Energy Meter Calibration Software
6.8.2
Calibration Step 2 - Configuration C2
The next step will be to calibrate the PHASE ANGLE correction, if desired. The
software will prompt the user if this calibration step is necessary. Then the following
dialog box will be given.
FIGURE 6-4:
Calibration Step C2 with calibration settings input boxes.
At this point, the software will default to the value of 60 degrees for the phase delay.
The user can MODIFY these values to the exact phase delay based on calibrated
equipment readings.
Note that the dialog box uses the values for VCAL AND ICAL that were given during
configuration C1. This is because the user is expected to not change the currents and
voltages during this step, only the phase angle. If the voltages and currents change
between steps 1 and 2, the calibration will not be accurate.
Once the user selects the “OK” button, energy accumulation will occur and status can
be observed via the energy accumulation bar.
Section 5.3.7 describes the registers and equations that the software uses at this point
to calibrate the phase angle correction of the meter and PHy_DELAY register for the
appropriate phase.
Note:
© 2008 Microchip Technology Inc.
IMPORTANT! The equations that are hard-coded into the software subtract
60 degrees from the measured quantity. For this reason, it is expected that
the current lag the voltage during this calibration step.
DS51643B-page 61
MCP3909 3-Phase Energy Meter Reference Design
6.8.3
Calibration Step 3 - Configuration C3
The next step will be to calibrate the active power offset of the meter, if desired. The
default value for this calibration step is 1% of the ICAL current that was used for steps
1 and 2. The user can enter the exact value in the dialog box for more accurate meter
calibration.
FIGURE 6-5:
Calibration Step C3 with calibration settings input boxes for the
minimum current for active power offset calibration (in Amperes).
Section 5.3.9 describes the registers and equations that the software uses at this point
to calibrate the active power offset correction of the meter and PHy_OFF register for
the appropriate phase.
DS51643B-page 62
© 2008 Microchip Technology Inc.
3-Phase Energy Meter Calibration Software
6.8.4
Calibration Step 4 - Configuration C4
The final calibration step will be to calibrate the RMS current offset of the meter, if
desired. The default value for this calibration step is 10% of the ICAL current that was
used for steps 1 and 2. The user can enter the exact value at this point in the dialog
box for more accurate meter calibration.
FIGURE 6-6:
Calibration Step C4 with calibration settings input boxes for the
minimum current for active power offset calibration (in Amperes).
Section 5.3.11 describes the registers and equations that the software uses at this
point to calibrate the RMS offset correction of the meter for the appropriate phase. Note
that the software does not calculate the RMS voltage offset.
After the completion of step 4, the software will prompt you to save the calibration
registers to EEPROM.
Calibration of this phase is now complete.
6.8.5
Calibration Line Cycle Selection Pull Down
The line cycle pull drop down box allows the user to change the number of line cycles
being used to accumulate the energy during calibration. After this occurs, the software
automatically performs a write to the LINE_CYC register.
© 2008 Microchip Technology Inc.
DS51643B-page 63
MCP3909 3-Phase Energy Meter Reference Design
6.9
METER DESIGN FRAME
This frame contains the editable options for the meter design. All fields in this box are
editable with the exception of current resolution, voltage resolution, and power
resolution. These 3 boxes are set based on the following 3 tables.
These tables are important and are used to calculate the resolution values that are
used when calculating the _GLSB registers that occur while calibrating the meter.
It is these values that are also used to place the decimal point in the reading or results
frame.
The resolutions presented here are based on the assumption that the IMAX and VCAL
voltages will be at approximately 50% of the input voltage to the A/D converters. To
change the headroom of the A/D input simply change the MAXIMUM current number
and the GLSB registers will scale accordingly.
TABLE 6-2:
CURRENT RESOLUTION TABLE
Maximum Current Less than or Equal To
(A)
8.1
81
810
8,100
TABLE 6-3:
LSB Resolution
(A)
0.001
0.01
0.1
1
POWER RESOLUTION TABLE
Maximum Wattage Less than or Equal To
(W - IMAX times VCAL)
125
1,250
12,500
125,000
1,250,000
12,500,000
TABLE 6-4:
LSB Resolution
(mW)
0.001
0.01
0.1
1
10
100
VOLTAGE RESOLUTION TABLE
Maximum Voltage Less than or Equal To
(V)
ALL
LSB Resolution
(V)
0.1
Note that the decimal point location in the reading frame is updated whenever the VCAL,
ICAL, or IMAX values are changed.
DS51643B-page 64
© 2008 Microchip Technology Inc.
3-Phase Energy Meter Calibration Software
6.10
MESSAGE LOG FRAME
The message log frame is located by clicking on the Log tab at the top of the screen.
Double clicking on the message frame copies the messages to the Windows clipboard
for easy transfer in debugging situations.
FIGURE 6-7:
Main Screen with Message Log Frame Active.
© 2008 Microchip Technology Inc.
DS51643B-page 65
MCP3909 3-Phase Energy Meter Reference Design
6.11
COMMUNICATIONS LOG FRAME
The communications log frame records all commands being sent to the PIC18F2520
through RS-232 and USB. This frame can be used to record communications activity
when designing a customized meter calibration script.
FIGURE 6-8:
DS51643B-page 66
Main Screen with Communications Log Frame Active.
© 2008 Microchip Technology Inc.
MCP3909 3-PHASE ENERGY
METER REFERENCE DESIGN
Appendix A. Schematic and Layouts
A.1
INTRODUCTION
This appendix contains the following schematics and layouts for Revision 2 of the
MCP3909 3-Phase Energy Meter Reference Design:
•
•
•
•
•
•
•
•
•
•
•
•
A.2
Main Board Schematic - Page 1
Main Board Schematic - Page 2
Main Board Schematic - Page 3
Main Board Schematic - Page 4
Main Board Schematic - Page 5
Main Board - Top Layer And Silk-Screen
Main Board - Bottom Layer
USB Interface Module - Schematic
USB Interface Module - Top Silk-Screen Layer
USB Interface Module - Top Traces And Pads Layer
USB Interface Module - Bottom Silk-Screen Layer
USB Interface Module - Bottom Traces And Pads Layer
SCHEMATICS AND PCB LAYOUT
The layer order is shown in Figure A-1.
Top Layer
Bottom Layer
FIGURE A-1:
© 2008 Microchip Technology Inc.
Layer Order
DS51643B-page 67
MCP3909 3-Phase Energy Meter Reference Design
A.3
MAIN BOARD SCHEMATIC - PAGE 1
DS51643B-page 68
© 2008 Microchip Technology Inc.
Schematic and Layouts
A.4
MAIN BOARD SCHEMATIC - PAGE 2
© 2008 Microchip Technology Inc.
DS51643B-page 69
MCP3909 3-Phase Energy Meter Reference Design
A.5
MAIN BOARD SCHEMATIC - PAGE 3
DS51643B-page 70
© 2008 Microchip Technology Inc.
Schematic and Layouts
A.6
MAIN BOARD SCHEMATIC - PAGE 4
© 2008 Microchip Technology Inc.
DS51643B-page 71
MCP3909 3-Phase Energy Meter Reference Design
A.7
MAIN BOARD SCHEMATIC - PAGE 5
DS51643B-page 72
© 2008 Microchip Technology Inc.
Schematic and Layouts
A.8
MAIN BOARD - TOP LAYER AND SILK-SCREEN
© 2008 Microchip Technology Inc.
DS51643B-page 73
MCP3909 3-Phase Energy Meter Reference Design
A.9
MAIN BOARD - BOTTOM LAYER
DS51643B-page 74
© 2008 Microchip Technology Inc.
Schematic and Layouts
M
A.10 USB INTERFACE MODULE - SCHEMATIC
© 2008 Microchip Technology Inc.
DS51643B-page 75
MCP3909 3-Phase Energy Meter Reference Design
A.11 USB INTERFACE MODULE - TOP SILK-SCREEN LAYER
PIC18F4550 USB INTERFACE MODULE
A.12 USB INTERFACE MODULE - TOP TRACES AND PADS LAYER
DS51643B-page 76
© 2008 Microchip Technology Inc.
Schematic and Layouts
A.13 USB INTERFACE MODULE - BOTTOM SILK-SCREEN LAYER
A.14 USB INTERFACE MODULE - BOTTOM TRACES AND PADS LAYER
© 2008 Microchip Technology Inc.
DS51643B-page 77
MCP3909 3-Phase Energy Meter Reference Design
NOTES:
DS51643B-page 78
© 2008 Microchip Technology Inc.
MCP3909 3-PHASE ENERGY
METER REFERENCE DESIGN
Appendix B. Bill Of Materials (BOM)
0
TABLE B-1:
Qty
MAIN BOARD - BILL OF MATERIALS (BOM)
Reference
Description
Manufacturer
Part Number
4
C1, C11, C13,
C16
DO NOT POPULATE
—
—
18
C2, C3, C9,
C17, C21, C26,
C28, C29, C30,
C36, C39, C40,
C43, C44, C49,
C51, C52, C53
CAP .1UF 25V CERAMIC X7R 0805
Panasonic® - ECG
ECJ-2VB1E104K
12
C4, C5, C7, C8, CAP 68000PF 25V CERM X7R 0805
C31, C32, C34,
C35, C45, C46.
C47, C48
Panasonic - ECG
ECJ-2VB1E683K
3
C6, C12, C14
DO NOT POPULATE
—
—
7
C10, C19, C25,
C37, C50, C54,
C55
CAP CER 2.2UF 10V 10% X7R 0805
Murata Electronics®
North America
GRM21BR71A225KA01L
3
C18, C22, C24
CAP CER 10UF 10V 10% X5R 0805
Murata Electronics
North America
GRM21BR61A106KE19L
1
C20
CAP CER 100PF 100V 5% C0G 0805
Murata Electronics
North America
GRM2165C2A101JA01D
1
C23
CAP CERM .082UF 5% 50V NPO 1206
Murata Electronics
North America
GRM31C5C1H823JA01L
2
C27, C33
CAP CERAMIC 18PF 50V NP0 0805
Kemet Electronics®
C0805C180J5GACTU
1
C41
CAP 470UF 25V ELECT FC SMD
Panasonic - ECG
EEE-FC1E471P
7
D1, D2, D4, D5, DIODE SCHOTTKY 20V 0.5A SOD123
D7, D8, D9
ON Semiconductor®
MBR0520LT1G
1
D3
LED RED CLEAR 0805 SMD
LITE-ON INC
LTST-C170CKT
1
D6
TVS ZENER 200W 15V SOD123FL
ON Semiconductor
SMF15AT1G
3
FB1, FB2, FB6
150 Ohm 300mA 1806 Ferrite Chip
Steward
LI1806C151R-10
6
FB3, FB4, FB7,
R4, R42, R69
RES 10.0 OHM 1/8W 1% 0805 SMD
Yageo®
1
FB5
FERRITE 500MA 600 OHM 0805 SMD
Steward
3
J2, J4,.J6
TERMINAL BLOCK 10MM VERT 2POS On Shore Technology ED200/2DS
1
J7
DO NOT POPULATE
CONN POWER JACK 2.5MM PCB
CIRC
—
—
1
J8
6 X 1 Header 2.54mm on center 6
mm/2.5mm
Samtec
TSW-102-07-G-S
2
J9
64-pin Surface Mount Header 0.1" Cen- Samtec
ters
Note 1:
Corporation
RC0805FR-0710RL
HZ0805E601R-10
SSM-132-L-DV
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.
© 2008 Microchip Technology Inc.
DS51643B-page 79
MCP3909 3-Phase Energy Meter Reference Design
TABLE B-1:
Qty
MAIN BOARD - BILL OF MATERIALS (BOM) (CONTINUED)
Reference
Description
Manufacturer
Part Number
1
L1
10uH Inductor
Coilcraft
0805PS-103KL
3
MOV1, MOV2,
MOV3
VARISTOR 275VRMS 20MM RADIAL
LITTELFUSE
V20E275P
1
P1
6 X 1 Header 2.54mm on center 6
mm/2.5mm
Samtec
TSW-106-07-G-S
1
PCB
RoHS Compliant Bare PCB, MCP3909
3-Phase Energy Meter Reference
Design Using PIC18F2520
Microchip Technology 104-00111
Inc.
6
R1, R5, R40,
R43, R59, R60
RES 23.2 OHM 1/8W 0.1% 25PPM TF
0805 SMD
KOA Speer Yageo
Corporation
RN732ALTDK23R2B25
9
R7, R8, R10,
R45, R46 R49,
R70, R71, R73
RES 1.00K OHM 1/8W 1% 0805 SMD
Panasonic - ECG
ERJ-6ENF1001V
30
R9, R11, R12,
R14, R15, R17,
R18, R38, R41,
R44, R47, R48,
R51, R57, R58,
R62, R64, R65,
R66, R67, R72,
R74, R75, R77,
R78, R80, R81,
R85, R86, R88
RES 1.0K OHM 1/16W .1% 0603 SMD
Susumu Co Ltd
RR0816P-102-B-T5
5
R13, R31, R50,
R76, R87
RES 0.0 OHM 1/8W 5% 0805 SMD
Panasonic - ECG
ERJ-6GEY0R00V
3
R16, R52, R79
RES 1.00K OHM 1/8W 0.1% 25PPM TF Susumu Co Ltd
0805 SMD
RG2012P-102-B-T5
1
R19
RES 698 OHM 1/8W 1% 0805 SMD
Yageo Corporation
RC0805FR-07698RL
3
R20, R53, R82
RES 4.99K OHM 1/8W 1% 0805 SMD
Yageo Corporation
RC0805FR-074K99L
6
R21, R27, R55,
R56, R61, R84
RES 221K OHM 1/8W 0.1% 25PPM TF
0805 SMD
Susumu Co Ltd
RG3216N-2213-B-T1
2
R22, R30
RES 215K OHM 1/8W 1% 0805 SMD
Yageo Corporation
RC0805FR-07215KL
9
R23, R26, R33,
R35, R36, R37,
R39, R54, R83
RES 2.00K OHM 1/8W 1% 0805 SMD
Panasonic - ECG
ERJ-6ENF2001V
1
R24
RES 10.0K OHM 1/8W 1% 0805 SMD
Yageo Corporation
RC0805FR-0710KL
2
R25, R29
RES 16.2K OHM 1/8W 1% SMD 0805
Yageo Corporation
RT0805FRE0716K2L
1
R28
RES 309 OHM 1/8W 1% 0805 SMD
Yageo Corporation
RC0805FR-07309RL
2
R32, R34
DO NOT POPULATE
—
—
1
R63
RES 4.7K OHM 1/8W 5% 0805 SMD
Yageo Corporation
RC0805JR-074K7L
3
T1, T2, T3,
TRANSFORMER 230V 2.3VA 2X9V
TransERA Electronics BV030-7347.0
Inc
3
T4, T5, T6
5A/2.5mA Current Transformer
Shanghai He Hua
Electronic Co. Ltd
SCT954F
4
TP1, TP10,
TP11, TP12
Wire Test Point 0.3" Length
Component
Corporation
PJ-202-30
8
TP2 <-->TP9
DO NOT POPULATE
—
—
1
U13
IC ISOLATOR DIGITAL DUAL 8-SOIC
Analog Devices Inc
ADUM1201CRZ-RL7
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.
DS51643B-page 80
© 2008 Microchip Technology Inc.
Bill Of Materials (BOM)
TABLE B-1:
Qty
MAIN BOARD - BILL OF MATERIALS (BOM) (CONTINUED)
Reference
Description
Manufacturer
Part Number
3
U2, U8, U15
Energy Meter ADC SSOP24
Microchip Technology MCP3909-I/SS
Inc.
1
U3
IC INVERTER SCHMITT INPUT
SOT-23
Fairchild
Semiconductor®
1
U4
IC INVERTER UNBUFFERED SOT23-5 Fairchild
Semiconductor
NC7SZU04M5X
1
U5
IC PLL W/VCO/LOCK DETECT
16-SOIC
Texas Instruments
CD74HCT7046AM
1
U6
Op-amp SOT23-5
Microchip Technology MCP6291T-E/OT
Inc.
1
U7
IC SWITCH ANALOG SP3T LV US8
Fairchild
Semiconductor
FSA3357K8X
1
U9
IC REG 5.0V 800MA LDO SOT-223
National
Semiconductor
LM1117MPX-5.0
1
U10
PHOTOCOUPLER DARL OUT 4-SMD
Sharp
Microelectronics
PC365NJ0000F
1
U11
Flash Microcontroller with10-Bit A/D
Microchip Technology PIC18F2520I/SO
Inc.
1
U16
256K I2C™ CMOS Serial EEPROM
Microchip Technology 24FC256-I/SM
Inc.
1
U17
IC ISO DC/DC CONV 5V/5V 14-DIP
Texas Instruments
DCP010505BP
1
X1
CRYSTAL 40.0000MHZ 10PF SMD
Abracon Corporation
ABM3B-40.000MHZ-10-1
-U-T
Note 1:
NC7SZ14M5X
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.
© 2008 Microchip Technology Inc.
DS51643B-page 81
MCP3909 3-Phase Energy Meter Reference Design
TABLE B-2:
Qty
USB INTERFACE MODULE - BILL OF MATERIALS (BOM)
Reference
Description
2
C1, C2
CAP CER 10UF 16V X5R 0805
Murata Electronics
GRM21BR61C106KE15L
2
C3, C4
CAP CER 18PF 50V 5% C0G 0603
Murata Electronics
GQM1885C1H180JB01D
8
C5, C6, C7,
C8, C9, C10,
C11, C12
CAP CER .1UF 16V 10% X7R 0603
Murata Electronics
GRM188R71C104KA01D
1
D1
Red LED SOT-23
SunLED
XZUR48WA
0
J1
DO NOT POPULATE
—
CONN USB RTANG FEMALE TYPE B
PCB
—
1
J2
CONN RECEPT MINI USB2.0 5POS
Hirose Electronic Co.
Ltd
UX60-MB-5ST
1
L1
Power Chip Inductors -0805PS Series
Coilcraft
0805PS-103KL
1
M1
16 X 2 LCD Character Display
Fema
CG1626-SGR1-Z
1
P1
CONN HEADER 64POS .100 VERT
GOLD
http://www.samtec.co
m
MTSW-132-23-L-D-240
1
P2
CONN HEADER 6POS .100 R/A TIN
Molex/Waldom Electronics Corp
22-05-2061
1
PCB
USB Interface Module
Microchip Technology 102-00113
Inc.
1
R1
RES 523 OHM 1/10W 1% 0603 SMD
Panasonic - ECG
5
R2, R6, R11,
R12, R13
RES 4.70K OHM 1/10W 1% 0603 SMD Rohm
MCR03EZPFX4701
2
R3, R4
RES 24.9 OHM 1/10W 1% 0603 SMD
Panasonic - ECG
ERJ-3EKF24R9V
4
R5, R7, R8, R9 RES 1.00K OHM 1/10W 1% 0603 SMD Panasonic - ECG
ERJ-3EKF1001V
1
R10
RES 332 OHM 1/10W 1% 0603 SMD
Panasonic - ECG
ERJ-3EKF3320V
0
R14
DO NOT POPULATE
—
—
4
SW1, SW2,
SW3, SW4
Pushbutton Tact Switch 6mm SMD
Mom 230gF
Omron
B3S-1002
1
TP1
Wire Test Point 0.3" Length
Nedco Electronics
PJ-202-30
1
U1
High-Performance, Enhanced Flash,
USB Microcontroller
44-Pin, QFP
Microchip Technology PIC18F4550
Inc.
1
X1
CRYSTAL 20.0000MHZ 10PF SMD
Abracon Corporation
Note 1:
ERJ-3EKF5230V
ABM3B-20.000MHZ-10-1U-T
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.
DS51643B-page 82
© 2008 Microchip Technology Inc.
Bill Of Materials (BOM)
NOTES:
© 2008 Microchip Technology Inc.
DS51643B-page 83
WORLDWIDE SALES AND SERVICE
AMERICAS
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://support.microchip.com
Web Address:
www.microchip.com
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
India - Bangalore
Tel: 91-80-4182-8400
Fax: 91-80-4182-8422
India - New Delhi
Tel: 91-11-4160-8631
Fax: 91-11-4160-8632
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
India - Pune
Tel: 91-20-2566-1512
Fax: 91-20-2566-1513
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Japan - Yokohama
Tel: 81-45-471- 6166
Fax: 81-45-471-6122
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Farmington Hills, MI
Tel: 248-538-2250
Fax: 248-538-2260
Kokomo
Kokomo, IN
Tel: 765-864-8360
Fax: 765-864-8387
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
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
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
China - Hong Kong SAR
Tel: 852-2401-1200
Fax: 852-2401-3431
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
Malaysia - Kuala Lumpur
Tel: 60-3-6201-9857
Fax: 60-3-6201-9859
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
China - Shenzhen
Tel: 86-755-8203-2660
Fax: 86-755-8203-1760
Taiwan - Hsin Chu
Tel: 886-3-572-9526
Fax: 886-3-572-6459
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
Taiwan - Kaohsiung
Tel: 886-7-536-4818
Fax: 886-7-536-4803
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
Taiwan - Taipei
Tel: 886-2-2500-6610
Fax: 886-2-2508-0102
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
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
UK - Wokingham
Tel: 44-118-921-5869
Fax: 44-118-921-5820
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
01/02/08
DS51643B-page 84
© 2008 Microchip Technology Inc.