MCP39F511A Data Sheet 20006044A
MCP39F511A Data Sheet 20006044A
Sag/Surge Detection
• Two Wire Serial Protocol with Selectable Baud
MCLR
DVDD
DGND
DGND
ZCD
COMMONB
NC
PWM
Digital Filter
UART_RX
SINC3
I1+ + 24-bit Delta-Sigma Interface
PGA Multi-level
I1- - Modulator ADC 16-BIT
CORE PWM
FLASH
Digital Filter
24-bit Delta-Sigma
SINC3
V1+ + EVENT1
PGA Multi-level
V1- - Modulator ADC Calculation EVENT2
Engine Digital Outputs
(CE)
LOAD 1 µF 0.1 µF
0.1 µF
NC
NC EVENT1
N.C.
Leave Floating NC EVENT2
NC
DR
Connect on PCB COMMONA,B ZCD
+3.3V
MCP9700A AN_IN PWM
OSCO
4 MHz
OSCI DGND AGND
22 pF 22 pF
(OPTIONAL)
+3.3V
0.47 µ F 470
MCP1754
0.01 µF 470 µF
L N AGND
DGND
Note 1: The MCP39F511A demonstration board uses a switching power supply, however a low-cost
capacitive-based supply, as shown here, is sufficient for many applications.
2: The external sensing components shown here, a 2 m shunt, two 499 k and 1 k resistors for the
1000:1 voltage divider, are specifically chosen to match the default values for the calibration registers
defined in Section 6.0 “Register Descriptions”. By choosing low-tolerance components of these
values (for instance 1% tolerance), measurement accuracy in the 2-3% range can be achieved with
zero calibration (AC only, offset calibration may be needed in DC mode). See Section 9.0
“MCP39F511A Calibration” for more information.
1.1 Specifications
Note: Unless otherwise indicated, AVDD = +3.3V, DVDD = +3.3V, TA = +25°C, GAIN = 1, VIN = -0.5 dBFS at 60 Hz.
0.50% 0
fIN = -60 dBFS @ 60 Hz
0.40% -20 fD = 3.9 ksps
Measurement Error (%)
Amplitude (dB)
0.10% -80
0.00% -100
-0.10% -120
-0.20% -140
-0.30% -160
-0.40% -180
-0.50% -200
0.01 0.1 1 10 100 1000 0 200 400 600 800 1000 1200 1400 1600 1800 2000
Current Channel Input Amplitude (mVPEAK) Frequency (Hz)
0.100%
Frequency of Occurrence
RMS Current Error (%)
0.050%
0.000%
-0.050%
-107.3
-107.1
-107.0
-106.8
-106.7
-106.5
-106.4
-106.2
-106.1
-105.9
-105.8
-0.100%
0.1 1 10 100 1000
Input Voltage RMS (mVPP) Total Harmonic Distortion (-dBc)
1
Energy Accumulation Error (%)
0
Total HDrmonic Distortion(dBc)
0.8 -10
G=1 G=2 G=4
G=8 G = 16 G = 32
0.6 -20
0.4 -30
-40
0.2
-50
0 -60
-0.2 -70
-0.4 -80
-90
-0.6 -100
-0.8 -110
-1 -120
1 10 100 1000 10000 100000 -50 -25 0 25 50 75 100 125 150
Temperature (°C)
Energy Accumulation (Watt-Hours)
FIGURE 2-3: Energy, Gain = 8. FIGURE 2-6: THD vs. Temperature.
5
4
3
Frequency of Occurrence
FIGURE 2-7: SNR Histogram. FIGURE 2-9: Gain Error vs. Temperature.
100 1.2008
Signal-to-Noise and Distortion
60
1.2004
50
40 1.2003
30 1.2002
20 1.2001
10 G=1 G=2 G=4 1.2000
G=8 G = 16 G = 32
0 1.1999
-50 -25 0 25 50 75 100 125 150 -50 0 50 100 150
Temperature (°C) Temperature (C)
FIGURE 2-8: SINAD vs. Temperature. FIGURE 2-10: Internal Voltage Reference
vs. Temperature.
This approach allows for single, secure transmission Note: There is one unique device ID response
from the host processor to the MCP39F511A device that is used to determine which
with either a single command or multiple commands. MCP39FXXX device is present:
No command in a frame is processed until the entire [NAK(0x15) + ID_BYTE]. If the command
frame is complete and the checksum and number of received is a single byte (0x5A) instead of
bytes are validated. a command frame, the response is NAK
The number of bytes in an individual command packet followed by the ID_BYTE. For the
depend on the specific command. For example, to set MCP39F511A device, the ID_BYTE is
the instruction pointer, three bytes are needed in the 0x04.
packet: the command byte and two bytes for the
address you want to set to the pointer. The first byte in
a command packet is always the command byte.
This protocol can also be used to set up transmission
from the MCP39F511A device on specific registers. A
predetermined single-wire transmission frame is
defined for one-wire interfaces. The Auto-Transmit
mode can be initiated by setting the SINGLE_WIRE bit
in the System Configuration register, allowing for
single-wire communication within the application. See
Section 4.8 “Single-Wire Transmission Mode” for
more information on this communication.
Frame
Header Byte (0xA5) Number of Bytes Command Packet1 Command Packet2 ...Command Packet n Checksum
IDLE START
D0 D1 D2 D3 D4 D5 D6 D7 STOP IDLE
N N
2 –1 2 –1
2 2
in vn
I RMS = n=0
----------------------------- V RMS = n=0
------------------------------
N N
2 2
Digital Filter
I1+ + 24-bit ADC
SINC3
I1- -
PGA Multi-Level
Modulator + HPF 1
i
+
CHANNEL I1
Ch0_Offset:s24(2)
SystemConfiguration:b32 Ch1_Offset:s24(2)
PhaseCompensation:s16
+
Digital Filter
24-bit ADC
SINC3
V1+ + +
V1- -
PGA Multi-Level
Modulator HPF 1
v
CHANNEL V1
Note 1: High-Pass Filters (HPFs) are automatically disabled in the absence of an AC signal on the voltage channel.
2: Ch0_Offset and Ch1_Offset are 24-bit values. The 24-bit two's complement MSB first coding values are calculated internally using
the corresponding byte from the OFFCAL_MSB register and OFFCAL_CHn 16-bit values. The result is added to the output code
of the corresponding channel bit-by-bit.
Range:b32
2N-1
i X 0 ÷ 2 N
X ÷2RANGE CurrentRMS:u32
ACCU +
+
GainCurrentRMS:u16
OffsetCurrentRMS:s16
GainVoltageRMS:u16
ApparentPower:u32
X
2N-1
v X 0 ÷ 2 N
X ÷2RANGE VoltageRMS:u16
ACCU
Range:b32
S
Q
P
Consume, Capacitive
Generate, Inductive
-P, -Q +P, -Q
FIGURE 5-3: The Power Circle and Triangle (S = Apparent, P = Active, Q = Reactive).
GainActivePower:u16
i
Range:b32
2N-1
X 0 ÷ 2
N
ACCU +
X ÷2RANGE ActivePower:u32
OffsetActivePower:s16
v
GainReactivePower:u16
i HPF Range1,2:b32
2N-1
X 0 ÷ 2
ACCU1
N
+ X ÷2RANGE
ReactivePower:u32
+
OffsetReactivePower:s16
v HPF (+90deg.)
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
6.4 System Version Register The PGA block can be used to amplify very low signals,
but the differential input range of the Delta-Sigma
The System Version register is hard-coded by modulator must not be exceeded. The PGA is
Microchip Technology Incorporated and contains controlled by the PGA_CHn<2:0> bits in Register 6-2
calculation engine date code information. The the System Configuration register. Table 6-2
System Version register is a date code in the YYWW represents the gain settings for the PGAs.
format, with year and week number in decimal (for
instance, 0x1810 = 2018, 10th week). TABLE 6-2: PGA CONFIGURATION
SETTING (Note 1)
6.5 System Configuration Register Gain Gain Gain VIN Range
The System Configuration register contains bits for the PGA_CHn<2:0> (V/V) (dB) (V)
following control: 0 0 0 1 0 ±0.6
• PGA settings 0 0 1 2 6 ±0.3
• ADC Reset State 0 1 0 4 12 ±0.15
• ADC Shutdown State 0 1 1 8 18 ±0.075
• UART baud rate
1 0 0 16 24 ±0.0375
• Single Wire Auto-Transmission
1 0 1 32 30 ±0.01875
• ZCD pin behavior
Note 1: This table is defined with VREF = 1.2V.
• Temperature compensation
The two undefined settings, 110 and 111
• PWM are G=1.
• Energy counting
These options are described in the following sections. 6.5.2 24-BIT ADC RESET MODE
(SOFT RESET MODE)
6.5.1 PROGRAMMABLE GAIN 24-bit ADC Reset mode (also called Soft Reset) can
AMPLIFIERS (PGA) only be entered through setting high the
The two Programmable Gain Amplifiers (PGAs) reside RESET<1:0> bits in the System Configuration Register
at the front-end of each 24-bit Delta-Sigma ADC. They register. This mode is defined as the condition where
have two functions: the converters are active but their output is forced to ‘0’.
• Translate the common mode of the input from
6.5.3 ADC SHUTDOWN MODE
AGND to an internal level between AGND and AVDD
• Amplify the input differential signal ADC Shutdown mode is defined as a state where the
converters and their biases are OFF, consuming only
The translation of the common mode does not change leakage current. When the Shutdown bit is reset to ‘0’,
the differential signal but enters the common mode so the analog biases will be enabled, as well as the clock
that the input signal can be properly amplified. and the digital circuitry.
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
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 31-24 ENERGY<7:0>: Sets the number of right-bit shifts for the Energy output registers. Note that the value
is read-only and is calculated automatically as 29 – Accumulation Interval.
bit 23-16 POWER<7:0>: Sets the number of right-bit shifts for the Active and Reactive Power output registers
bit 15-8 CURRENT<7:0>: Sets the number of right-bit shifts for the Current RMS output register
bit 7-0 VOLTAGE<7:0>: Sets the number of right-bit shifts for the Voltage RMS output register
bit 15 bit 8
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
Period
Duty Cycle
EQUATION 8-1:
PWM Period = [(PWM_Frequency) + 1] × 2 × PTIMER × (Prescale Value)
EQUATION 8-2:
PWM Duty Cycle (%) = (PWM_DUTY CYCLE>)/(4 × PWM_FREQUENCY)
PWM Duty Cycle (time in s) = (PWM_DUTY_CYCLE) × PWM_TIMER_PERIOD/2 × (Prescale Value)
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
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
9.3 Single-Point Gain Calibrations at It is the user’s responsibility to ensure that the proper
range settings, PGA settings and hardware design
Unity Power Factor settings are correct to allow for successful calibration
When using the device in AC mode with the high-pass using this command.
filters turned on, most offset errors are removed and The value of the Thermistor Voltage register is auto-
only a single-point gain calibration is required. matically transfered to the Ambient Temperature Ref-
Setting the gain registers to properly produce the erence Voltage register after executing the command.
desired outputs can be done manually by writing to the This value is used internally by the temperature
appropriate register. The alternative method is to use compensation algorithm, if enabled.
the auto-calibration commands described in this
section.
EQUATION 9-3:
Expected 1000
GAIN NEW = GAIN OLD --------------------------- = 33480 ------------ = 29113
Measured 1150
EQUATION 9-8:
EQUATION 9-9:
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-8 OFFCAL_CH1_MSB<7:0>: MSB of the 24-bit offset for CH1 (voltage channel)
bit 7-0 OFFCAL_CH0_MSB<7:0>: MSB of the 24-bit offset for CH0 (current channel)
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 15-0 OFFCAL_CH0<15:0>: Lower 16-bit of the 24-bit offset for CH0 (current channel)
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 15-0 OFFCAL_CH1<15:0>: Lower 16-bit of the 24-bit offset for CH1 (voltage channel)
Note 1: The 24-bit two's complement MSb first coding values are calculated internally using the corresponding
byte from the OFFCAL_MSB register and OFFCAL_CHn 16-bit values. The result is added to the output
code of the corresponding channel bit-by-bit.
The measurement of the line frequency is only valid After a successful calibration (response = ACK), a
from 45 to 65 Hz. Save Registers to Flash command can then be
issued to save the calibration constants calculated by
the device. Issuing the command in DC mode
generates a NAK response.
The following register is set when the
Auto-Calibrate Frequency command is issued:
• Gain Line Frequency
Note that the command is only required when running
off the internal oscillator. The formula used to calculate
the new gain is shown in Equation 9-1.
TemperatureCompensation Register
c = ----------------------------------------------------------------------------------------------- cfV
M y = x + -------------------
-
2 M
2
Where:
x = Uncompensated output (corresponding to line Where:
frequency, current RMS, active power and
x = Uncompensated current RMS
reactive power)
y = Compensated current RMS
y = Compensated output
c = Compensation value found in
c = Temperature compensation coefficient
InCapCurrentComp register
(depending on the shunt's temperature
coefficient of resistance or on the internal RC f = Measured frequency
oscillator temperature frequency drift). There V = Measured voltage RMS
are six registers two for line frequency M = INCAPCURRENT value found in
compensation, two for current compensation
RANGEVDROPINCAPCOMP register
and two for power compensation (active and
reactive). TempPosComp registers are used
when T is greater than TCAL. TempNegComp EXAMPLE 9-1:
registers are used when T is less than TCAL. A 1 F input capacitor at 220V [rms], 50 Hz corresponds to
T = Thermistor voltage (in 10-bit ADC units) an offset current of . 0.0691A [rms].
TCAL = Ambient temperature reference voltage. It
M
should be set at the beginning of the y – x 2
calibration procedure, by reading the c = -----------------------------
f V
thermistor voltage and writing its value to the
ambient temperature reference voltage Where
register. The auto-calibration gain command
does this automatically. y - x = offset current
M = 32 (default value)
At the calibration temperature, the effect of the com- c = 691 * 4294967296 / (50000 * 2200)
pensation coefficients is null. The coefficients need to
c = 26980, this is the value that should be written to
be tuned when the difference between the calibration the InCapCurrentComp register
temperature and the device temperature is significant.
It is recommended to use the default values as starting
points.
EQUATION 9-12:
cI
y = x + ----------
M
2
Where:
x = Uncompensated voltage RMS
y = Compensated voltage RMS
c = Compensation value found in
VoltageDropComp register
I = Measured current RMS
M = VOLTAGEDROP value found in
RANGEVDROPINCAPCOMP register
EXAMPLE 9-2:
A 0.1 resistor at 10A [rms] corresponds to an offset
voltage of 1V [rms].
M
y – x 2
c = -----------------------------
I
Where:
y -x = offset value
M = 28 (default value)
c = 10 * 268435456 / 100000
c = 26843, this is the value that should be written to
the VoltageDropComp register
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
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
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-8 VOLTAGEDROP<7:0>: Sets the number of right-bit shifts for the VoltageDropComp register
bit 7-0 INCAPCURRENT<7:0>: Sets the number of right-bit shifts for the InCapCurrentComp register
39F511A
e33
-E/MQ e
^^
1802156
Note: In the event the full Microchip part number cannot be marked on one line, it will
be carried over to the next line, thus limiting the number of available
characters for customer-specific information.
28-Lead Plastic Quad Flat, No Lead Package (MQ) – 5x5x0.9 mm Body [QFN or VQFN]
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D A B
NOTE 1 N
1
2
E
(DATUM B)
(DATUM A)
2X
0.10 C
2X
0.10 C TOP VIEW
0.10 C
C A1
A
SEATING
PLANE 28X
A3 0.08 C
SIDE VIEW
0.10 C A B
D2
0.10 C A B
E2
2 28X K
1
NOTE 1
N
28X L 28X b
e 0.10 C A B
0.05 C
BOTTOM VIEW
28-Lead Plastic Quad Flat, No Lead Package (MQ) – 5x5x0.9 mm Body [QFN or VQFN]
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Units MILLIMETERS
Dimension Limits MIN NOM MAX
Number of Pins N 28
Pitch e 0.50 BSC
Overall Height A 0.80 0.90 1.00
Standoff A1 0.00 0.02 0.05
Contact Thickness A3 0.20 REF
Overall Width E 5.00 BSC
Exposed Pad Width E2 3.15 3.25 3.35
Overall Length D 5.00 BSC
Exposed Pad Length D2 3.15 3.25 3.35
Contact Width b 0.18 0.25 0.30
Contact Length L 0.35 0.40 0.45
Contact-to-Exposed Pad K 0.20 - -
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Package is saw singulated.
3. Dimensioning and tolerancing per ASME Y14.5M.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.
28-Lead Plastic Quad Flat, No Lead Package (MQ) – 5x5 mm Body [QFN] Land Pattern
With 0.55 mm Contact Length
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
• 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.
== ISO/TS 16949 ==