Microchip Technology MCP3901 User Manual
Microchip Technology MCP3901 User Manual

Microchip Technology MCP3901 User Manual

Energy meter reference design
Table of Contents

Advertisement

Quick Links

MCP3901 and PIC18F65J90
Energy Meter Reference Design
User's Guide
© 2012 Microchip Technology Inc.
DS51968A

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MCP3901 and is the answer not in the manual?

Questions and answers

Summary of Contents for Microchip Technology MCP3901

  • Page 1 MCP3901 and PIC18F65J90 Energy Meter Reference Design User’s Guide © 2012 Microchip Technology Inc. DS51968A...
  • Page 2 Select Mode, Total Endurance, TSHARC, UniWinDriver, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies.
  • Page 3: Table Of Contents

    Customer Support ....................10 Document Revision History ................. 10 Chapter 1. Product Overview 1.1 Introduction ....................11 1.2 What the MCP3901 and PIC18F65J90 Energy Meter Reference Design Kit Includes ............... 12 1.3 Getting Started ..................... 12 Chapter 2. Hardware 2.1 Overview ...................... 13 2.2 Input and Analog Front End .................
  • Page 4 MCP3901 and PIC18F65J90 Energy Meter Reference Design 3.20 PERIOD ...................... 24 3.21 ENERGY_ACT ................... 24 3.22 ENERGY_APP ..................25 3.23 I_ABS_MAX ....................25 3.24 V_ABS_MAX ....................25 3.25 ENERGY_REACT ..................25 3.26 PHASE_COMPENSATION ................ 25 3.27 OFFSET_I_RMS ..................26 3.28 OFFSET_V_RMS ..................26 3.29 GAIN_I_RMS .....................
  • Page 5: Microchip Technology Inc. Ds51968A

    A.9 Board – Bottom Silk and Pads ..............40 A.10 Board – Top 3D ..................41 A.11 Board – Bottom 3D ..................42 Appendix B. Bill of Materials (BOM) Worldwide Sales and Service ..................46 © 2012 Microchip Technology Inc. DS51968A-page 5...
  • Page 6 MCP3901 and PIC18F65J90 Energy Meter Reference Design © 2012 Microchip Technology Inc. DS51968A-page 6...
  • Page 7: Preface

    Select the Help menu, and then Topics to open a list of available online help files. INTRODUCTION This chapter contains general information that will be useful to know before using the MCP3901 and PIC18F65J90 Energy Meter Reference Design User’s Guide. Items discussed in this chapter include: • Document Layout •...
  • Page 8: Document Layout

    MCP3901 and PIC18F65J90 Energy Meter Reference Design DOCUMENT LAYOUT This document describes how to use the MCP3901 and PIC18F65J90 Energy Meter Reference Design as a development tool to emulate and debug firmware on a target board. The manual layout is as follows: •...
  • Page 9: Conventions Used In This Guide

    Curly brackets and pipe Choice of mutually exclusive errorlevel {0|1} character: { | } arguments; an OR selection Ellipses... Replaces repeated text var_name [, var_name...] Represents code supplied by void main (void) user { ... © 2012 Microchip Technology Inc. DS51968A-page 9...
  • Page 10: Recommended Reading

    MCP3901 and PIC18F65J90 Energy Meter Reference Design RECOMMENDED READING This user's guide describes how to use the MCP3901 and PIC18F65J90 Energy Meter Reference Design. Other useful documents are listed below. The following Microchip documents are available and recommended as supplemental reference resources.
  • Page 11: Chapter 1. Product Overview

    Chapter 1. Product Overview INTRODUCTION The MCP3901 and PIC18F65J90 Energy Meter Reference Design is a fully functional IEC Class 0.5 compliant single-phase meter. This low-cost design does not use any transformers and requires few external components. The PIC18F65J90 directly drives the LCD, and includes both an isolated USB connection for meter calibration and access to the device power calculations.
  • Page 12: What The Mcp3901 And Pic18F65J90 Energy Meter Reference Design Kit Includes

    ) of 60A. To test a calibrated meter, the following connections apply for a two-wire connection. 1.3.1 Step 1: Wiring Connections Figure 1-2 identifies the line and load connections of the MCP3901 and PIC18F65J90 Energy Meter Reference Design. Line Line...
  • Page 13: Chapter 2. Hardware

    MCP3901 AND PIC18F65J90 ENERGY METER REFERENCE DESIGN Chapter 2. Hardware OVERVIEW Figures 2-1 show the MCP3901 and PIC18F65J90 and Energy Meter Reference Design: D9D8 LCD1 DANGER HIGH VOLTAGE MCP3901 / PIC18F65J90 SHUNT METER Legend: 1 = IR for meter communication...
  • Page 14 MCP3901 and PIC18F65J90 Energy Meter Reference Design R27 R26 C24 C25 DANGER HIGH VOLTAGE MOV1 Legend: Opto-isolators for Pulse outputs Power supply Non-volatile memory for calibration constants and energy usage data PIC18F65J90 Isolation IC MCP2200 for USB connection FIGURE 2-2: Bottom View –...
  • Page 15 Hardware PIC18F65J90 SWITCH SWITCH Active Reactive Power Power RC7/RX USB to UART Mini - USB Connector Converter RC6/TX MCP2200 (ISOLATED) MCP3901 RC3/SCK RC4/SDI RC5/SDO 25LC256 SPI - EEPROM FIGURE 2-3: Digital Connections. © 2012 Microchip Technology Inc. DS51968A-page 15...
  • Page 16: Input And Analog Front End

    MCP3901 and PIC18F65J90 Energy Meter Reference Design INPUT AND ANALOG FRONT END The MCP3901 and PIC18F65J90 and Energy Meter Reference Design comes populated with components designed for 220V line voltage. At the bottom of the main board are the high voltage line and neutral connections. There are four connections that are made from the PCB to the meter casing.
  • Page 17: Chapter 3. Calculation Engine And Register Description

    MCP3901 AND PIC18F65J90 ENERGY METER REFERENCE DESIGN Chapter 3. Calculation Engine and Register Description CALCULATION ENGINE SIGNAL FLOW SUMMARY RMS voltage, RMS current, Active Power, Reactive Power and Apparent Power, and the calibration output pulse are all calculated through the following process described in Figure 3-1.
  • Page 18: Register List

    MCP3901 and PIC18F65J90 Energy Meter Reference Design REGISTER LIST Note: Important! Not all registers and features are implemented in this version of firmware release. TABLE 3-1: INTERNAL REGISTER SUMMARY Name Bits R/W Description MODE R/W Configuration register for operating mode of the meter...
  • Page 19: Mode

    Bit = 0 Both negative and positive energy accumulated (negative energy is subtracted) bit 1 PHASE: Phase bit Single-Point Phase Correction Multi-Point Phase Correction (future) bit 0 CREEP: No-Load Threshold bit Enabled Disabled © 2012 Microchip Technology Inc. DS51968A-page 19...
  • Page 20: Status

    MCP3901 and PIC18F65J90 Energy Meter Reference Design STATUS The STATUS register contains the operational status of the energy meter. The bit functions are defined in the table below. REGISTER 3-2: STATUS REGISTER — — — — — — PH_S —...
  • Page 21: Line_Cyc

    LSBs. By definition, this register will always contain a positive value, including the sit- uation where power is negative from a backwards CT or otherwise. This register is overwritten every LINE_CYC line cycle and is written only once, if calibration is enabled. © 2012 Microchip Technology Inc. DS51968A-page 21...
  • Page 22: Raw_I_Rms

    MCP3901 and PIC18F65J90 Energy Meter Reference Design RAW_I_RMS Name Bits RAW_I_RMS This register is the raw RMS value from the current A/D converter in LSBs (square root of the top 32-bits of RAW2_I_RMS + OFFSET_I_RMS). By definition, this register will always contain a positive value (even if the CT is in backwards).
  • Page 23: Line_Frequency

    A, multiply the (decimal) value in this register by X to get the display value in watts. This register is overwritten every LINE_CYC line cycle (written only once if calibration is enabled). © 2012 Microchip Technology Inc. DS51968A-page 23...
  • Page 24: Raw_Power_React

    MCP3901 and PIC18F65J90 Energy Meter Reference Design 3.18 RAW_POWER_REACT Name Bits RAW_POWER_REACT This is the raw reactive power. This register is read during the calibration for calculating the gain values associated with the reactive power and GAIN_POWER_REACT. This register is overwritten every LINE_CYC line cycle (written only once if calibration is enabled).
  • Page 25: Energy_App

    ENERGY_REACT = ENERGY_REACT + (1/METER_CONSTANT) The gain calibration registers GAIN_NUMR_ENERGY_ACT and GAIN_DENR_ENERGY_ACT operate the same for this method also. 3.26 PHASE_COMPENSATION Name Bits PHASE_COMPENSATION Phase delay, signed 8-bit value, provides the phase compensation by sampling time/2. © 2012 Microchip Technology Inc. DS51968A-page 25...
  • Page 26: Offset_I_Rms

    MCP3901 and PIC18F65J90 Energy Meter Reference Design 3.27 OFFSET_I_RMS Name Bits OFFSET_I_RMS Square of the offset for RMS current reading, signed 16-bit value. Note that this value should be similar to the ADC’s noise squared. At a gain of 1, the noise will be about 1 LSB, 2 LSBs at a gain of 2, 6 LSBs at a gain of 8, 11 LSBs at a gain of 16, and 22 LSBs at a gain of 32.
  • Page 27: Gain_Power_Act

    Apparent energy gain to produce X VAh/LSB. The value is always less than one (for example, 32,767 = 0.9999695). 3.37 GAIN_ENERGY_REACT Name Bits GAIN_ENERGY_REACT Reactive energy gain to produce X VARh/LSB. The value is always less than one (for example, 32,767 = 0.9999695). © 2012 Microchip Technology Inc. DS51968A-page 27...
  • Page 28: Cf_Pulse_Width

    MCP3901 and PIC18F65J90 Energy Meter Reference Design 3.38 CF_PULSE_WIDTH Name Bits CF_PULSE_WIDTH Defines the CF pulse width from 0 to 255. Length of width is valued * 8 * (1/LINE_FREQUENCY)/128) ms. A maximum of 0.266 seconds for 60 Hz and 0.319 seconds for 50 Hz.
  • Page 29: Maximum Current

    This register holds the calibration current of the meter (I 3.46 CALIBRATION_FREQUENCY Name Bits CALIBRATION_FREQUENCY This register holds the calibration frequency of the meter. 3.47 METER_CONSTANT Name Bits METER_CONSTANT This register holds the meter constant in imp/kWh or imp/kVARh. © 2012 Microchip Technology Inc. DS51968A-page 29...
  • Page 30: Calibration_Line_Cycle

    MCP3901 and PIC18F65J90 Energy Meter Reference Design 3.48 CALIBRATION_LINE_CYCLE Name Bits CALIBRATION_FREQUENCY This register holds the number of line cycles used during the calibration. 3.49 GAIN_DENR_ENERGY_REACT Name Bits GAIN_DENR_ENERGY_REACT 8-bit signed value. Represents the number of shifts for reactive power energy register, before GAIN_NUMR_ENERGY_REACT is applied.
  • Page 31: Chapter 4. Meter Protocol And Timings

    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'. © 2012 Microchip Technology Inc. DS51968A-page 31...
  • Page 32 MCP3901 and PIC18F65J90 Energy Meter Reference Design 4.1.1.4 “W” WRITE: WRITE STARTING AT SPECIFIED ADDRESS Write specified bytes. Example: 'W030000102030405060708090A0B0C0D0E0FX'. Returns: 'W030000102030405060708090A0B0C0D0E0FX'. Note: If the number of data characters is odd, the last character (the one just prior to the 'X') will be ignored.
  • Page 33: Appendix A. Schematic And Layouts

    ENERGY METER REFERENCE DESIGN Appendix A. Schematic and Layouts INTRODUCTION This appendix contains the following schematics and layouts for the MCP3901 and PIC18F65J90 Energy Meter Reference Design: • Board – ADC Schematic • Board – MCU Schematic • Board – LCD and USB Schematic •...
  • Page 34: Board - Adc Schematic

    MCP3901 and PIC18F65J90 Energy Meter Reference Design BOARD – ADC SCHEMATIC © 2011 Microchip Technology Inc. DS51968A-page 34...
  • Page 35: Board - Mcu Schematic

    Schematic and Layouts BOARD – MCU SCHEMATIC © 2011 Microchip Technology Inc. DS51968A-page 35...
  • Page 36: Board - Lcd And Usb Schematic

    MCP3901 and PIC18F65J90 Energy Meter Reference Design BOARD – LCD AND USB SCHEMATIC © 2011 Microchip Technology Inc. DS51968A-page 36...
  • Page 37: Board - Top Silk And Pads

    Schematic and Layouts BOARD – TOP SILK AND PADS © 2011 Microchip Technology Inc. DS51968A-page 37...
  • Page 38: Board - Top Copper

    MCP3901 and PIC18F65J90 Energy Meter Reference Design BOARD – TOP COPPER © 2011 Microchip Technology Inc. DS51968A-page 38...
  • Page 39: Board - Bottom Copper

    Schematic and Layouts BOARD – BOTTOM COPPER © 2011 Microchip Technology Inc. DS51968A-page 39...
  • Page 40: Board - Bottom Silk And Pads

    MCP3901 and PIC18F65J90 Energy Meter Reference Design BOARD – BOTTOM SILK AND PADS © 2011 Microchip Technology Inc. DS51968A-page 40...
  • Page 41: A.10 Board - Top 3D

    Schematic and Layouts A.10 BOARD – TOP 3D © 2011 Microchip Technology Inc. DS51968A-page 41...
  • Page 42: A.11 Board - Bottom 3D

    MCP3901 and PIC18F65J90 Energy Meter Reference Design A.11 BOARD – BOTTOM 3D © 2011 Microchip Technology Inc. DS51968A-page 42...
  • Page 43 VARISTOR 275V RMS 20MM RADIAL EPCOS Inc. S20K275E2 6 X 1 Header 2.54 mm on center 6 mm/2.5 Samtec TSW-106-07-G-S RoHS Compliant Bare PCB, MCP3901 — 104-00342 PIC18F65J90 Shunt Meter Ref Des IC REG LDO 3.3V 250MA SOT23-3 Microchip MCP1700T-3302E/TT Technology Inc.
  • Page 44 MCP3901 and PIC18F65J90 Energy Meter Reference Design TABLE B-1: BILL OF MATERIALS (BOM) (CONTINUED) Reference Description Manufacturer Part Number RES 100 OHM 1W 5% 2512 SMD Panasonic - ECG ERJ-1TNF1000U R13, R15 RES 4.70K OHM 1/10W 1% 0603 SMD Panasonic - ECG...
  • Page 45 © 2012 Microchip Technology Inc. DS51968A-page 45...
  • Page 46: Worldwide Sales And Service

    Thailand - Bangkok Tel: 86-29-8833-7252 Tel: 66-2-694-1351 Toronto Fax: 86-29-8833-7256 Fax: 66-2-694-1350 Mississauga, Ontario, Canada China - Xiamen Tel: 905-673-0699 Tel: 86-592-2388138 Fax: 905-673-6509 Fax: 86-592-2388130 China - Zhuhai Tel: 86-756-3210040 11/29/11 Fax: 86-756-3210049 © 2012 Microchip Technology Inc. DS51968A-page 46...
  • Page 47 Mouser Electronics Authorized Distributor Click to View Pricing, Inventory, Delivery & Lifecycle Information: Microchip ARD00342...

This manual is also suitable for:

Pic18f65j90

Table of Contents