The STPM01 is designed for effective
measurement of active, reactive and apparent
energy in a power line system using Rogowski
coil, current transformer and shunt sensors. This
device can be implemented as a single chip
monophase energy meter or as a peripheral
measurement in a microcontroller based
monophase or 3-phase energy meter. The
STPM01 consists, essentially, of two parts: the
analog part and the digital part. The former, is
composed by preamplifier and 1
converter blocks, band gap voltage reference, low
drop voltage regulator, the latter, is composed by
system control, oscillator, hard wired DSP and
SPI interface. There is also an OTP block, which
is controlled through the SPI by means of a
st
order Δ ∑ A/D
STPM01
with tamper detection
TSSOP20
dedicated command set. The configured bits are
used for testing, configuration and calibration
purpose. From a pair of Δ
from analog section, a DSP unit computes the
amount of consummated active, reactive and
apparent energy, RMS and instantaneous values
of voltage and current. The results of computation
are available as pulse frequency and states on
the digital outputs of the device or as data bits in a
data stream, which can be read from the device
by means of SPI interface. This system bus
interface is used also during production testing of
the device and/or for temporary or permanent
programming of bits of internal OTP. In the
STPM01 an output signal with pulse frequency
proportional to energy is generated, this signal is
used in the calibration phase of the energy meter
application allowing a very easy approach. When
the device is fully configured and calibrated, a
dedicated bit of OTP block can be written
permanently in order to prevent accidental
entering into some test mode or changing any
configuration bit.
∑ output signals coming
Table 1.Device summary
Order codeTemperature rangePackagePackaging
STPM01FTR- 40 to 85 °CTSSOP20 (tape and reel)2500 parts per reel
15SYND I/OProgrammable input/output pin, see Ta bl e 5
16CLKINA INCrystal oscillator input or resistor connection if RC oscillator is selected
17CLKOUTA OUTOscillator Output (RC or crystal)
18SCL/NLCD I/OProgrammable input/output pin, seeTa bl e 5
19SDA/TDD I/OProgrammable input/output pin, see Ta bl e 5
20LEDD OProgrammable output pin, see Ta bl e 5
1. A: Analog, D: Digital, P: Power
(1)
Name and function
A OUT1.5 V Output of internal low drop regulator which supplies the digital core
GNDGround
P INSupply voltage
P INrSupply voltage for OTP cells
A OUT3 V Output of internal low drop regulator which supplies the analog part
A INPositive input of primary current channel
A INNegative input of primary current channel
A INPositive input of secondary current channel
A INNegative input of secondary current channel
A INPositive input of voltage channel
A INNegative input of voltage channel
Doc ID 10853 Rev 87/60
Maximum ratingsSTPM01
3 Maximum ratings
Table 3.Absolute maximum ratings
SymbolParameterValueUnit
V
V
I
V
V
CC
PIN
ID
IA
OTP
DC Input voltage-0.3 to 6V
Current on any pin (sink/source)± 150mA
Input voltage at digital pins (SCS, MOP, MON, SYN, SDATD,
SCLNLC, LED)
Input voltage at analog pins (I
IP1
, I
, I
, I
IN1
, VIP, VIN)-0.7 to 0.7V
IP2
IN2
-0.3 to V
+ 0.3V
CC
Input voltage at OTP pin-0.3 to 25V
ESDHuman body model (all pins)± 3.5kV
Operating ambient temperature- 40 to 85°C
Junction temperature- 40 to 150°C
Storage temperature range- 55 to 150°C
T
T
T
STG
OP
J
Note:Absolute maximum ratings are those values beyond which damage to the device may occur.
Functional operation under these condition is not implied.
Table 4.Thermal data
SymbolParameterValueUnit
R
thJA
1. This value is referred to single-layer PCB, JEDEC standard test board.
Thermal resistance junction-ambient114.5
(1)
°C/W
8/60Doc ID 10853 Rev 8
STPM01Functions
4 Functions
Table 5.Programmable pin functions
Programmable
pin
MONOutput for Stepper’s node (MB)
MOPOutput for Stepper’s node (MA)
If APL=2 then LED provides high frequency
pulses proportional to Active Energy with 50%
duty cycle.
LED
SCLNLC
SDATD
SYN
SCS
If APL=3 then LED provides pulses proportional
to Active Energy (internal signal AW). The
number of pulses per kWh can be selected
according to the value of KMOT configuration bit.
No-load indicator:
when low, a no-load condition is detected
Tamper indicator:
when low tamper condition is detected
Negative active power indicator:
when low a negative active power condition is
detected
Must be high to activate SCLNLC, SDATAD and
SYN indications
Stand-alone mode
(APL register=2 or 3)
Peripheral mode
(APL register=0 or 1)
If APL=0 then Watchdog signal.
If APL=1 then ΔΣ signal of current channel
If APL=0 then ZCR
If APL=1 then ΔΣ signal of voltage channel
If APL=0 then LED can provide Active,
Reactive or Apparent Energy according to
value of KMOT configuration bit.
If APL=1 then LED is connected to the MUX
signal generated from the tamper detection
circuit.
When LED=low then the primary current
channel is selected, if LED=high the
secondary current channel is selected.
Used for SPI interface (see SPI interface
section for details)
Doc ID 10853 Rev 89/60
FunctionsSTPM01
Table 6.Internal signal description
SymbolNameDescription
ZCRZero crossing signalProvides positive pulse every time the line voltage crosses zero
AWActive energyPulse frequency signal proportional to active energy
RWReactive energyPulse frequency signal proportional to reactive energy
SWApparent energyPulse frequency signal proportional to apparent energy
LINLine frequency signal
BFRBase frequency range
MA
Stepper motor signalsSignal available in MOP and MON to drive a stepper motor
MB
BITTamper flag
BILNo load condition
This signal is high when the voltage channel value is rising and it is low when
the voltage channel is falling. Basically this signal is the sign of dv/dt.
This signal is high when either the voltage line frequency is outside the
nominal band or the voltage register is below 64.
It is cleared when the voltage line frequency is inside the nominal band and
the voltage register goes above 128.
This signal provides the information on the tamper status. If low no tamper is
detected, when high a tamper condition has been detected. This signal is part
of the status register but is also available on the SDATD pin when in
standalone mode.
Provides information on the load condition. This signal is part of the status
register but is also available on the SCLNLC pin when in standalone mode.
BIL=1 no load condition, BIL=0 normal operation.
10/60Doc ID 10853 Rev 8
STPM01Electrical characteristics
5 Electrical characteristics
VCC = 5 V, TA = 25 °C, 100 nF to 1 uF between V
and V
Table 7.Electrical characteristics
, 100 nF to 1 uF between VCC and VSS unless otherwise specified.
SS
and VSS, 100 nF to 1 uF between V
DDA
SymbolParameterTest conditionsMin.Typ.Max.Unit
Energy measurement accuracy
f
e
e
e
Effective bandwidthLimited by digital filtering5400Hz
BW
Accuracy of active power
AW
Accuracy of reactive power
RW
Accuracy of apparent powerOver 1 to 500 of dynamic range0.1%
SW
Over 1 to 1000 of dynamic
range
Over 1 to 1000 of dynamic
range
0.1%
0.1%
SNRSignal to noise ratioOver the entire bandwidth52db
rms
rms
/50Hz
/50Hz
0.2%
PSRR
Power supply DC rejection
DC
Voltage signal: 200 mV
Current signal: 10 mV
= 4.194 MHz
f
CLK
VCC=3.3V±10%, 5V±10%
PSRR
Power supply AC rejection
AC
Voltage signal: 200 mV
Current signal: 10 mV
f
= 4.194 MHz
CLK
VCC=3.3V+0.2V
=5.0V+0.2V
V
CC
rms
rms
/50Hz
rms
/50Hz
rms
1@100Hz
1@100Hz
0.1%
General section
DDD
V
Operating supply voltage3.1655.5V
CC
Supply current configuration
I
registers cleared or device
CC
locked (TSTD=1)
Increase of supply current per
configuration bit, during
programming
ΔI
CC
Increase of supply current per
configuration bit with device
locked
PORPower on reset on V
V
V
f
f
LINE
V
Analog supply voltage2.853.03.15V
DDA
Digital supply voltage1.4251.501.575V
DDD
Oscillator clock frequency
CLK
Nominal line frequency4565Hz
OTP programming voltage1420V
OTP
CC
4 MHz, V
= 5V34
CC
mA
8 MHz, V
4 MHz, V
= 5V56
CC
= 5V120
CC
µA/bit
4 MHz, V
= 5V2
CC
2.5V
MDIV bit = 04.0004.194MHz
MDIV bit = 18.0008.192MHz
Doc ID 10853 Rev 811/60
Electrical characteristicsSTPM01
Table 7.Electrical characteristics (continued)
SymbolParameterTest conditionsMin.Typ.Max.Unit
I
t
I
LATCH
OTP programming current per
OTP
bit
OTP programming time per bit100300µs
OTP
Current injection latch-up
immunity
Analog Inputs (I
V
f
ADC
f
V
Z
G
I
LEAK
Maximum input signal levels
MAX
A/D Converter bandwidth10kHz
A/D Sampling frequencyF
SPL
Amplifier offset±20mV
OFF
Z
VIP, VIN Impedance
IP
V
, V
IN
ERR
I
VL
IP1
Impedance
Current channels gain error±10%
Voltage channel leakage current-11µA
Current channel leakage current
IP1
IN1
, I
, V
IN1
IP2
2.5mA
300mA
, I
, I
, VIP, VIN)
IP2
IN2
Voltage channel-0.30.3V
Gain 8X-0.150.15
Current
channels
Gain 16X-0.0750.075
V
Gain 24X-0.050.05
Gain 32X-0.0350.035
/4Hz
CLK
, V
IN2
Over the total operating voltage
range
Over the total operating voltage
range
100400kΩ
100kΩ
Channel disabled (PST=0 to 3;
CH2 disabled if C
disabled if C
SEL
=0; CH1
SEL
=1) or device off
-11
µA
Input enabled-1010
Digital I/O Characteristics (SDA, CLKIN, CLKOUT, SCS, SYN, LED)
SDA, SCS, SYN, LED0.75V
V
Input high voltage
IH
CLKIN1.5
SDA, SCS, SYN, LED0.25V
V
Input low voltage
IL
V
V
I
Output high voltageIO = -2mAVCC-0.4V
OH
Output low voltageIO = +2mA0.4V
OL
Pull up current15µA
UP
t
Transition timeC
TR
CLKIN0.8
= 50pF10ns
LOAD
Power I/O Characteristics (MOP, MON)
V
V
Output high voltageIO = -14mAVCC-0.5V
OH
Output low voltageIO = +14mA0.5V
OL
t
Transition timeC
TR
= 50pF510ns
LOAD
12/60Doc ID 10853 Rev 8
CC
CC
V
V
STPM01Electrical characteristics
Table 7.Electrical characteristics (continued)
SymbolParameterTest conditionsMin.Typ.Max.Unit
Crystal oscillator (see circuit Figure 20)
Input current on CLKIN1µA
I
I
R
External resistor14MΩ
P
External capacitors22pF
C
P
f
Nominal output frequency
CLK
RC oscillator (see circuit Figure 20)
44.194
MHz
88.192
I
CLKIN
R
t
Settling current
Settling resistor12kΩ
SET
Frequency jitter1ns
JIT
On chip reference voltage
Reference voltage1.23V
V
REF
Reference accuracy±1%
T
Temperature coefficientAfter calibration3050
C
SPI interface timing
F
SCLKr
F
SCLKw
t
t
t
t
t
Data read speed32MHz
Data write speed100kHz
Data setup time20ns
DS
Data hold time0ns
DH
Data driver on time20ns
ON
Data driver off time20ns
OFF
SYN active width2/f
SYN
f
CLK
= 4 MHz
4060µA
ppm/
°C
CLK
s
Doc ID 10853 Rev 813/60
TerminologySTPM01
6 Terminology
6.1 Measurement error
The error associated with the energy measurement made by the STPM01 is defined as:
This is the error due to the DC component associated with the analog inputs of the A/D
converters. Due to the internal automatic DC offset cancellation the STPM01 measurement
is not affected by DC components in voltage and current channel. The DC offset
cancellation is implemented in the DSP.
6.3 Gain error
The gain error is gain due to the signal channel gain amplifiers. This is the difference
between the measured ADC code and the ideal output code. The difference is expressed as
percentage of the ideal code.
6.4 Power supply DC and AC rejection
This parameter quantifies the STPM01 measurement error as a percentage of reading when
the power supplies are varied. For the PSRRAC measurement, a reading at two nominal
supplies voltages (3.3 and 5 V) is taken. A second reading is obtained with the same input
signal levels when an ac (200 mV
error introduced by this ac signal is expressed as a percentage of reading.
For the PSRRDC measurement, a reading at two nominal supplies voltages (3.3 and 5V) is
taken. A second reading is obtained with the same input signal levels when the supplies are
varied ± 10 %. Any error introduced is again expressed as a percentage of the reading.
/100 Hz) signal is introduced onto the supplies. Any
RMS
6.5 Conventions
The lowest analog and digital power supply voltage is named VSS which represent the
system ground (GND). All voltage specifications for digital input/output pins are referred to
GND.
Positive currents flow into a pin. Sinking current means that the current is flowing into the pin
and then it is positive. Sourcing current means that the current is flowing out of the pin and
then it is negative.
Timing specifications of signal treated by a digital control part are relative to CLKOUT. This
signal is provided from the crystal oscillator of 4.194 MHz nominal frequency or from the
internal RC oscillator, eventually an external source of 4.194 MHz or 8.192 MHz can be
used.
Timing specifications of signals of the SPI interface are relative to the SCLNLC, there is no
direct relationship between the clock (SCLNLC) of the SPI interface and the clock of the
DSP block. A positive logic convention is used in all equations.
14/60Doc ID 10853 Rev 8
STPM01Typical performance characteristics
7 Typical performance characteristics
Figure 3.Supply current vs. supply voltage,
T
= 25 °C
A
Figure 5.RC oscillator: frequency jitter vs.
temperature
Figure 4.RC oscillator frequency vs. V
R = 12 kΩ, T
= 25 °C
A
CC
,
Figure 6.Analog voltage regulator: line - load
regulation
Figure 7.Digital voltage regulator: line - load
regulation
Doc ID 10853 Rev 815/60
Figure 8.Voltage channel linearity at
different V
voltages
CC
Typical performance characteristicsSTPM01
Figure 9.Power supply AC rejection vs. V
CC
Figure 11. Error over dynamic range gain
dependence
Figure 10. Power supply DC rejection vs. V
CC
Figure 12. Primary current channel linearity at
different V
CC
Figure 13. Gain response of ΔΣ AD converters
16/60Doc ID 10853 Rev 8
STPM01Theory of operation
8 Theory of operation
8.1 General operation description
The STPM01 is able to perform active, reactive and apparent energy measurements, RMS
and instantaneous values for voltage and current, line frequency information.
Most of the functions are fully programmable using internal configuration bits accessible
through SPI interface. The most important configuration bits are the two application bits
(APL - see Ta bl e 1 6 for configuration register). Using these bits the STPM01 can be
programmed as peripheral (APL = 0 or APL = 1) in microcontroller based meter systems or
as standalone meter device (APL = 2 or APL = 3).
In standalone mode, the STPM01 is able to drive a stepper motor with the MOP and MON
pins, while some of the SPI pins (see Ta b le 5 ) are used to provide information on tamper, no
load and negative power.
In peripheral mode, due to the fact that the stepper motor is not used, the MOP and MON
pins are used to provide different information (see Ta bl e 5 ), while the SPI pins are used to
communicate with the microcontroller.
The STPM01 includes internal registers that hold the useful information for the meter
system. Two kinds of active energy are available: the total active energy that includes all
harmonic content called type 0 and the active energy limited to the 1st harmonic called type
1. This last energy value is obtained filtering the type 0 active energy. The resolution of both
the two active energies is 20-bit. Reactive and Apparent energies are also available with a
20-bit resolution.
STPM01 provides also the RMS values of voltage and current. Due to the modest dynamic
variation of the voltage, the RMS value is stored with a resolution of 11 bit. While the RMS
current value has a resolution of 16 bit. The momentary sampled value of voltage and
current are available also with a resolution of 11 and 16 bit respectively. The line frequency
value is stored with a resolution of 14 bits.
Due to the proprietary energy computation algorithm, STPM01 calibration is very easy and
fast allowing calibration in only one point over the whole current range. The calibration
parameters are stored permanently in the OTP (one time programmable) cells, preventing
calibration tampering.
8.2 Analog inputs
Input amplifiers
The STPM01 has one fully differential voltage input channel and two fully differential current
input channels.
The voltage channel consists of a differential amplifier with a gain of 4. The maximum
differential input voltage for the voltage channel is ± 0.3 V.
The two current channels are multiplexed (see tamper section for details) to provide a single
input to a preamplifier with a gain of 4. The output of this preamplifier is connected to the
input of a programmable gain amplifier (PGA) with possible gain selections of 2, 4, 6, 8. The
total gain of the current channels are then 8, 16, 24, 32. The gain selections are made by
writing to the gain register and it can be different for the two current channels. In case the
tamper function is not used, the secondary current can be disabled.
Doc ID 10853 Rev 817/60
Theory of operationSTPM01
The maximum differential input voltage is dependent on the selected gain according to the
following table.
Table 8.Gain of voltage and current channels
Voltage channelsCurrent channels
GainMax Input voltage (V)GainMax input voltage (V)
8X±0.15
4±0.30
16X±0.075
24X±0.05
32X±0.035
The gain register is included in the device configuration register with the address names
PST and ADDG. The table below shows the gain configuration according to the register
values:
Table 9.Configuration of current sensors
PrimarySecondaryConfiguration Bits
GainSensorGainSensorPST (3 bits)ADDG (1 bit)
8
1601
2410
3211
8CT2 X
32Shunt3X
8
161641
242450
323251
8
832Shunt7X
Rogowsky Coil
Rogowsky Coil
CT
Disabled (No Tamper)
8
Rogowsky Coil
8CT6 X
00
40
Note:If the device is used in configuration PST = 7 (primary channel with CT, secondary channel
with Shunt), the shunt Ks must always be equal to one fourth of the current transformer Ks.
Both the voltage and current channels implement an active offset correction architecture
which gives the benefit to avoid any offset compensation.
The analog voltage and current signals are processed by the ∑ Δ Analog to digital
converters that feed the hardwired DSP. The DSP implements an automatic digital offset
cancellation that make possible avoiding any manual offset calibration on the analog inputs.
18/60Doc ID 10853 Rev 8
STPM01Theory of operation
8.3 ∑Δ A/D converters
The analog to digital conversion in the STPM01 is carried out using two first order ∑ Δ
converters. The device performs A/D conversions of analog signals on two independent
channels in parallel. The current channel is multiplexed as primary or secondary current
channel in order to be able to perform a tamper function, if it is enabled. The converted ∑ Δ
signals are supplied to the internal hardwired DSP unit, which filters and integrates those
signals in order to boost the resolution and to yield all the necessary signals for
computations.
A ∑ Δ modulator converts the input signal into a continuous serial stream of 1 s and 0 s at a
rate determined by the sampling clock. In the STPM01, the sampling clock is equal to f
The 1-bit DAC in the feedback loop is driven by the serial data stream. The DAC output is
subtracted from the input signal. If the loop gain is high enough, the average value of the
DAC output (and therefore the bit stream) can approach that of the input signal level. When
a large number of samples are averaged a very precise value of the analog signal is
obtained. This averaging is carried out in the DSP section which implements decimation,
integration and DC offset cancellation of the supplied ∑ Δ signals. The gain of the
decimation filters is 1.004 for the voltage channel and 0.502 for the current channel. The
resulting signal has a resolution of 11bits for voltage channel and 16 bits for current
channel.
CLK/4
.
Figure 14. First order ∑ Δ A/D converter
Integrator
+
Input analog signal
Σ
-
∫
8.4 Zero crossing detection
The STPM01 has a zero crossing detector circuit on the voltage channel which can be used
by application for synchronization of some utility equipment to event of zero crossing of line
voltage. This circuit produces the internal signal ZCR which has a rising edge every time the
line voltage crosses zero and a negative edge every time the voltage reaches its positive or
negative peak. The ZCR signal is then at twice the line voltage frequency. The ZCR signal is
available on the MOP pin only when STPM01 works as peripheral with the configuration bit
APL = 0.
DAC
f
CLK
/4
Output digital signal
Doc ID 10853 Rev 819/60
Theory of operationSTPM01
Figure 15. ZCR signal
8.5 Period and line voltage measurement
The period module measures the period of the base frequency of the voltage channel and
checks if the voltage signal frequency is within the f
LIN signal is produced, which is low when the line voltage is rising, and high when the line
voltage is falling. This means that the LIN signal is the sign of dv/dt. With further elaboration,
the ZCR signal is also produced. On the trailing edge of LIN (line frequency) the period
counter starts counting up pulses of the f
/4 reference signal. The LIN signal is available
CLK
on the status bit register (see Tab le 1 5).
If the counted number of pulses between two trailing edges of LIN is higher than 2
the counting is never stopped (no LIN trailing edge) this means that the base frequency is
lower than f
/217 Hz and a BFR (base frequency range) error flag is set.
CLK
If the number of pulses counted between two trailing edges of LIN is lower than 2
base frequency exceeds the limit (means it is higher than f
must be repeated three consecutive times in order to set the BFR error flag.
For example, with a 4.194304 MHz oscillator frequency and MDIV bit clear (or 8.192 MHz
with MDIV set), f
/4 is 1048.576 MHz. If the line frequency is 30 Hz, the counted f
CLK
pulses between two LIN trailing edges are 34952, more than 2
low frequency limit is then:
f
/217 = 4194304/131072 = 32 Hz.
CLK
With the same clock frequency, if the line frequency is 130Hz, the f
LIN trailing edges are 8066, more than 2
13
(8192). The BFR high frequency limit is then:
CLK
/217 to f
CLK
/215 band. To do this, the
CLK
15
, or if
13
, the
/215. In this case, the error
15
(32768 pulses). The BFR
/4 pulses between two
CLK
CLK
/4
f
/215 = 4194304/32768 = 128 Hz.
CLK
When the line frequency re-enters the nominal band, the BFR flag is automatically reset.
This BFR error flag is also assembled as part of the 8-bit status register (see Ta b le 1 5 ).
20/60Doc ID 10853 Rev 8
STPM01Theory of operation
Figure 16. LIN and BFR signal
The BFR flag is also set if the register value of the RMS voltage drops below 64. BFR is
cleared when the register value goes above 128. The BFR, then, also gives information
about the presence of the line voltage within the meter.
When the BFR error is set, the computation of power is zero unless the FRS bit is set or the
single wire mode operation is selected (see Section 8.6).
In fact, the effect of the BFR bit can be overridden by setting FRS configuration bit.
It means that if FRS is set and BFR is also set, all the energy computation is carried on as
BFR was cleared. In this case then p=u*i, where u could be zero or not (if BFR was set
because voltage RMS register value is below 64).
In standalone mode, the MOP, MON and LED provide the energy information, their
operation is not affected by FRS bit, it means that when BFR is set they stop switching
regardless the FRS value.
8.6 Single wire meter mode (only Rogowsky coil sensor)
STPM01 support single wire meter (SWM) operation when working with Rogowsky coil
current sensors. In SWM mode there is no available voltage information in the voltage
channel. It is possible that someone has disconnected one wire (live or neutral) of the meter
Doc ID 10853 Rev 821/60
Theory of operationSTPM01
for tampering purposes or in case the line voltage is very stable, it is possible to use a
predefined value for computing the energy without sensing it.
In order to enable the SWM mode, the STPM01 must be configured with PST values of 4 or
5, (tamper enabled-Rogowsky coils). In this way, if the BFR error is detected, STPM01
enters in SWM. If BFR is cleared the energy calculation is performed normally, when BFR is
set (no voltage information is available) the energy computation is carried out using a
nominal voltage value according to the NOM configuration bits.
Since there is no more information on the phase shift between voltage and current, the
apparent rather than active power is used for tamper and energy computation. The
calculated apparent energy is the product between I
equivalent V
V
= VPK*K
RMS
where V
PK
that can be calculated as follows:
RMS
,
NOM
represents the maximum line voltage reading of the STPM01 and K
(effectively measured) and an
RMS
NOM
is a
coefficient that changes according to the following table:
Table 10.Nominal voltage values
NOMK
00.3594
10.3906
20.4219
30.4531
For example, if a R
= 783 kΩ and R2 = 475 Ω are used as resistor divider when the line
1
NOM
voltage is present, the positive voltage present at the input of the voltage channel of
STPM01 is:
VI
2
=
⋅
RR
+
21
RMS
2V
R
since the maximum voltage value applicable to the voltage channel input of STPM01 is +0.3
V, the equivalent maximum line voltage applicable is:
V
= R1+R2/R2 • 0.3 = 494.82
PK
considering the case of NOM=2, the correspondent RMS values used for energy
computation are:
V
= VPK • 0.4219 = 208.76 [V]
RMS
Usually the supply voltage for the electronic meter is taken from the line voltage, in SWM,
since the line voltage is not present any more, some other power source must be used in
order to provide the necessary supply to STPM01 and the other electronic components of
the meter.
8.7 Power supply
The main STPM01 supply pin is the VCC pin. From the VCC pin two linear regulators provide
the necessary voltage for the analog part V
The V
22/60Doc ID 10853 Rev 8
pin represents the reference point for all the internal signals. 100 nF low ESR
SS
DDA
(3 V) and for the digital part V
DDD
(1.5 V).
STPM01Theory of operation
capacitor should be connected between VCC and VSS, V
these capacitors must be located very close to the device.
The STPM01 contains a power on reset (POR) detection circuit. If the V
than 2.5 V then the STPM01 goes into an inactive state, all the functions are blocked
asserting a reset condition. This is useful to ensure correct device operation at power-up
and during power-down. The power supply monitor has built-in hysteresis and filtering,
which give a high degree of immunity to false triggering due to noisy supplies.
A bandgap voltage reference (VBG) of 1.23 V ±1 % is used as reference voltage level
source for the two linear regulators and for the A/D converters. Also, this module produces
several bias currents and voltages for all other analog modules and for the OTP module. The
bandgap voltage can be compensated regardless to the temperature variations with the
BGTC bits.
Figure 17. Bandgap temperature variation
and VSS, V
DDA
and VSS. All
DDD
supply is less
CC
8.8 Load monitoring
The STPM01 includes a no load condition detection circuit with adjustable threshold. This
circuit monitors the voltage and the current channels and, when the measured voltage is
below the set threshold, the internal signal BIL becomes high. The information about this
signal is also available in the status bit BIL.
The no load condition occurs when the product between V
below a given value. This value can be set with the LTCH configuration bits.
Four different no-load threshold values can be chosen according to the two configuration
bits LTCH (see Ta b le 1 1 ).
Table 11.No load detection thresholds
LTCHK
0800
11600
23200
36400
and I
RMS
LT CH
Doc ID 10853 Rev 823/60
register values is
RMS
Theory of operationSTPM01
When a no load condition occurs (BIL=1) the integration of power is suspended and the
tamper module is disabled.
In standalone mode, if a no load condition is detected, the BIL signal blocks generation of
pulses for stepper and forces SCLNLC pin to be low. If APL = 2 (see Section 8.14) the LED
pin continues providing the high frequency pulses, while if APL = 3, the pulses are stopped
as happens for MOP and MON.
In peripheral mode, the BIL signal can be accessed only through the SPI interface.
8.9 Error detection
In addition to the no load condition and the line frequency band, the integration of power can
be suspended also due to detected error on the source signals.
There are two kinds of error detection circuits involved. The first checks all the ∑ Δ signals
from the analog part if any is stacked at 1 or 0 within the 1/128 of f
In case of detected error the corresponding ∑ Δ signal is replaced with an idle ∑ Δ signal,
which represents a constant value 0. All error and other resolved flags are treated as bits of
a device status and can be read out by means of SPI interface.
Another error condition occurs if the MOP, MON and LED pin outputs signals are different
from the internal signals that drive them. This can occur if some of this pin is forced to GND
or to some other imposed voltage value. In this case the internal status bit PIN is activated
providing the information that some hardware problem has been detected, for example the
stepper motor has been mechanically blocked.
period of observation.
CLK
8.10 Tamper detection module
The STPM01 is able to measure the current in both live and neutral wire with a time domain
multiplexing approach on a unique sigma delta modulator. This mechanism is adopted to
implement anti-tamper function. If this function is selected (see Ta bl e 9 ), the live and neutral
wire currents are monitored; when the difference between the two measurements exceeds a
rated threshold the STPM01 enters the "tamper state", while in "normal state" the two
measurements are below the threshold.
In particular, both channels are not observed all the time, rather a time multiplex mechanism
is used. During the observation time of each channel, its active energy is calculated. A
tamper condition occurs when the absolute value of the difference between the two active
energy values is greater than a certain percentage of the averaged energy during the
activated tamper module (see Equation 1: ).
This percentage value can be selected between two different values (12.5 % and 6.25 %)
according to the value of the configuration bit CRIT.
The tamper condition is detected when the following formula is satisfied:
Equation 1
EnergyCH1 - EnergyCH2 > K
where K
The detection threshold is much higher than the accuracy difference of the current channels,
which should be less than 0.2 %, but, some headroom should be left for possible transition
effect, due to accidental synchronism of actual load current change with the rhythm of taking
the energy samples.
can be 12.5 % or 6.25 %.
CRIT
(EnergyCH1 + EnergyCH2)/2;
CRIT
24/60Doc ID 10853 Rev 8
STPM01Theory of operation
The tamper circuit works if the energies associated with the two current channels are both
positive or negative, if the two energies have different sign, the tamper is on all the time
however, the channel with the associated higher power is selected for the final computation
of energy.
In single wire mode, the apparent energy rather than the active is used for tamper detection.
When internal signals are not good enough to perform the calculations, i.e. line period is out
or range or ΔΣ signals from analog section are stacked at high or low logic level, or no load
condition is activated, the tamper module is disabled and its state is preset to normal.
8.10.1 Detailed operational description
The meter is initially set to normal state, i.e. tamper not detected.In this condition the
primary channel is selected for final integration of energy. In such state the values of both
load currents should not differ more than the accuracy difference of the channels does.
Sixty-four periods of line voltage is used as a tamper checking period.
After 24 periods of line voltage two internal signals MUX and INH are changed in order to
enable secondary current channel and to freeze the last power and RMS values of primary
current channel. The following 16 periods of line frequency are used for tamper detection
integration. During this gap, the final energy calculation does not use the signal from
selected channel but the frozen values.
Four line periods after the INH switch, the integration of power from secondary current
channel is started and lasts four periods. Additional four line periods later MUX signal is
switched back to primary current channel and the integration for tamper detection is started.
The timings of MUX and INH signals are shown in Figure 18 below.
Figure 18. Timings of tamper module - Primary channel selected
MUXCh1Ch2Ch1Ch1
INH
Tampe rpowerintegratorsBA
Cycles44442424
When the secondary channel is selected to be integrated by the final energy integrator, the
MUX and INH signals change according to Figure 19 below.
Figure 19. Timings of tamper module - Secondary channel selected
This means that energy of four periods from secondary channel followed by energy of four
periods from primary channel is sampled within the tamper module. From these two
Doc ID 10853 Rev 825/60
Theory of operationSTPM01
samples, called B and A respectively, the criteria of tamper is calculated and the channel
with higher current is selected, resulting in a new tamper state. If four consecutive new
results of criteria happen, i.e. after elapsed 5.12 s at 50 Hz, the meter will enter into tamper
state. Thus, the channel with the higher current will be selected for the energy calculation. If
samples of power A and B would have different signs, the Tamper would be on all the time
but, the channel with bigger power would be still selected for the final integration of energy.
If a tamper status has been detected, the multiplex ratio will be 56:8 if the primary channel
energy is greater than the secondary one, otherwise it will be 8:56.
The detected tamper condition is stored in the BIT status bit. If BIT = 0 tamper is not
detected, if BIT = 1 a tamper condition has been detected. In standalone mode the BIT flag
is also available in the SDATD pin.
8.11 Phase compensation
The STPM01 is does not introduce any phase shift between voltage and current channel.
However, the voltage and current signals come from transducers, which could have inherent
phase errors. For example, a phase error of 0.1° to 0.3° is not uncommon for a current
transformer (CT). These phase errors can vary from part to part, and they must be corrected
in order to perform accurate power calculations. The errors associated with phase mismatch
are particularly noticeable at low power factors. The STPM01 provides a means of digitally
calibrating these small phase errors through a introducing delays on the voltage or current
signal. The amount of phase compensation can be set using the 4 bits of the phase
calibration register (CPH).
The default value of this register is at value of 0 which gives 0° phase compensation. When
the 4 bits give a CPH of 15 (1111) the introduced compensation is +0.576°. This
compensates the phase shift usually introduced by the current sensor, while the voltage
sensor, normally a resistor divider, does not introduce any delay. The resolution step of the
phase compensation is 0.038°.
8.12 Clock generator
All the internal timing of the STPM01 is based on the CLKOUT signal. This signal can be
generated in three different ways:
1.RC: this oscillator mode can be selected using the RC configuration bit. If RC = 1 the
STPM01 will run using the RC oscillator. A resistor connected between CLKIN and
ground will set the RC current. For 4 MHz operation the suggested settling resistor is
12 kΩ; The oscillator frequency can be compensated using the CRC configuration bit
(see Ta bl e 1 6 )
2. Quartz: If RC = 0 the oscillator will work with an external crystal. The suggested circuit
is depicted in Figure 20;
3. External clock: keeping RC=0, it is also possible to feed the CLKOUT pin with an
external oscillator signal
The clock generator is powered from analog supply and is responsible for two tasks. The
first one is to retard the turn on of some function blocks after POR in order to help smooth
start of external power supply circuitry by keeping off all major loads.
The second task of the clock generator is to provide all necessary clocks for analog and
digital parts. Within this task, the MDIV configuration bit is used to inform the device about
26/60Doc ID 10853 Rev 8
STPM01Theory of operation
the nominal frequency value of CLKOUT. Two nominal frequency ranges are expected, from
4.000 MHz to 4.194 MHz (MDIV = 0) or from 8.000 MHz to 8.192 MHz (MDIV = 1).
Figure 20. Different oscillator circuits (a): with quartz; (b): internal oscillator; (c): with external
source
8.12.1 RC Startup procedure
To use the device with RC oscillator the configuration bit RC (see Ta bl e 1 6) must be set.
Since the default configuration is for a crystal oscillator, when a RC oscillator is used instead
and the device is supplied for the very first time it is not internally clocked and consequently
the DSP is inactive. In this condition it is not possible to set RC or any other configuration bit.
The following SPI procedure can be run in order to set the RC bit and provide the clock to
the device:
●Set the mode signal BANK;
●Perform a software reset;
●Read the registers: BANK mode signal should be checked and the records should
show something (not 000000F0);
●Set the mode signal RD;
●Read the registers through SPI just to check that RD mode signal has been set;
●Clear the mode signal BANK;
●DO NOT perform a reading, and write configuration bit RC;
In this way the RC oscillator is started. If the registers are read again, it can be seen that RD
and RC bits are set, and BANK is cleared.
Once the RC startup procedure is complete, the device is clocked and active and it is
possible to permanently write the RC bit.
For details on mode signals refer to Chapter 8.20, for SPI operations refer to Chapter 8.21.
Doc ID 10853 Rev 827/60
Theory of operationSTPM01
8.13 Resetting the STPM01
The STPM01 has no reset pin. The device is automatically reset by the POR circuit when
the V
crosses the 2.5 V value but it can be reset also through the SPI interface giving a
CC
dedicated command (see SPI section for remote reset command details).
In case of reset caused by POR circuit all clocks and both DC buffers in the analog part are
kept off for about 30 ms and all blocks of digital part, except for SPI interface, which is hold
in a reset state for about 125 ms after a reset condition.
When the reset is performed through SPI no delayed turn on is generated.
Resetting the STPM01 causes all the functional modules of STPM01 to be cleared including
the OTP shadow latches (see paragraph 16 for OTP shadow latches description).
The reset through SPI (remote reset request) will normally take place during production
testing or in an application of meter with some on-board microprocessor when some
malfunction of metering device will be detected.
8.14 Energy to frequency conversion (standalone)
When used in standalone mode the STPM01 provides energy to frequency conversion both
for calibration and energy readout purposes. In fact one convenient way to verify the meter
calibration is to provide a pulse train signal with 50 % duty cycle whose frequency signal is
proportional to the active energy under steady load conditions. In this case the user will
choose a certain number of pulses on the LED pin that will corresponds to 1 kWh. We will
name this value as P.
The active energy frequency-based signal is available in the LED pin when APL = 2 or APL
= 3.
If APL = 2 the LED is driven from internal signal AW (active energy) whose frequency is
proportional to the active energy. The signal AW is taken from the 11
energy register, consequently a relationship between the LSB value of the active energy
register and the number of pulses provided per each kWh (P) can be defined as.
k
= 1000/(211•P) [Wh]
AW
If APL = 3 the LED pin provides active energy frequency-based signal dependent on the
value of the KMOT configuration bit according to the following table. In this case the pulses
will have a fixed width of 31.25 ms.
Table 12.Different settings for LED signal
KMOT (2 Bits)
0
1P/128
2P/32
3P/256
th
bit of the active
APL=2APL=3
PulsesPulses
P/64
P
Due to the innovative and proprietary power calculation algorithm the frequency signal is not
affected by any ripple at twice the line frequency, this feature strongly reduces the
calibration time of the meter.
28/60Doc ID 10853 Rev 8
STPM01Theory of operation
In a practical example where APL = 2, and the desired P is 64000 pulses/kWh (= 17.7
Hz*kW), we have:
K
= 7.63*10-6 Wh
AW
This means that the reading of 0x00001 in the active energy register represents 7.63 µWh,
while 0xFFFFF represents 8 Wh.
8.15 Driving a stepper motor (standalone)
When used in standalone mode (APL = 2 or APL = 3), the STPM01 is able to directly drive a
stepper motor. From signal AW, a stepper driving signals MA and MB are generated by
means of internal divider, mono-flop and decoder. The MA and MB signals are brought to
the MOP and MON pins that are able to drive the stepper motor. Several kinds of selections
are possible for the driving signals according to the configuration bits LVS and KMOT.
The numbers of pulses per kWh (PM) in the MOP and MON outputs are linked with the
number of pulses of the LED P (see previous paragraph) pin with the following relationship:
Table 13.Configuration of MOP and MON pins
LVS (1 Bit)KMOT (2 Bits)Pulses lengthPM
0031.25 msP/64
0131.25 msP/128
0231.25 msP/32
0331.25 msP/256
10156.25 msP/640
11156.25 msP/1280
12156.25 msP/320
13156.25 msP/2560
The mono-flop limits the length of the pulses according to the LVS bit value.
The decoder distributes the pulses to MA and MB alternatively, which means that each of
them has only a half of selected frequency.
Negative power is computed with its own sign, and the MOP and MON signals invert their
logic state in order to make the backward rotation direction of the motor. See the diagram
below.
Doc ID 10853 Rev 829/60
Theory of operationSTPM01
Figure 21. Positive energy stepper driving signals
Hi
MON
Lo
Hi
MOP
Lo
Figure 22. Negative energy stepper driving signals
Hi
MON
Lo
Hi
MOP
Lo
When a no-load condition is detected MOP and MON are held low.
8.16 Using STPM01 in microcontroller based meter (peripheral)
The higher flexibility of STPM01 allows its use in very high end microcontroller based energy
meters. In this case the STPM01 must be programmed to work in peripheral mode, all the
SPI pins (SCS, SCLNCL, SDATD, SYN) are used only for communication purposes allowing
the microcontroller to write and read the internal STPM01 registers. The peripheral mode
has two further different configuration modes according to the status of the APL
configuration bit. The APL bit status changes the function of MOP, MON and LED pins
according to the description below.
APL = 0:
In the MOP pin, the ZCR signal is available (see paragraph 3 for details about ZCR signal);
The pin MON provides the DOG signal. The DOG signal generates a 16 ms long positive
pulse every 1.6 seconds. Generation of these pulses can be suspended if data are read in
intervals shorter than 1.6 s. The DOG signal is actually a watchdog reset signal which can
be used to control an operation of an on-board microcontroller. It is set to high whenever the
V
voltage is below 2.5 V, but after V
DDA
30/60Doc ID 10853 Rev 8
goes above 2.5 V this signal starts to run.
DDA
STPM01Theory of operation
It is expected that an application microcontroller should access the data in the metering
device on regular basis at least 1/s (recommended is 32/s). Every latching of results in the
metering device requested from the microcontroller also resets the watchdog. If latching
requests does not follow each other within 1.6 second, an active high pulse on MON is
produced, because device assumes that microcontroller does not operate properly. An
application can use this signal either to control the RESET pin of its microcontroller or it can
be tied to some interrupt pin. The last possibility is recommended for a battery backup
application which can enter some sleep mode due to power down condition and should not
be reset by metering device because it would exit from the sleep mode.
The LED pin can be driven from AW wide band (active energy as in standalone mode), AW
limited at fundamental, RW (reactive energy) or SW (apparent energy) according to the
value of KMOT bit.
Table 14.LED pin configuration in peripheral mode
KMOT (2 Bits)Signal available in LED pin# of Pulses
0AW Type 0
1AW Type 1
2RWP [kVARh]
3SWP [kVAh]
1. * Type0 is the Wide band Active Energy and Type1 is the fundamental Active Energy if FUND=0, if FUND=1 they are
swapped.
(1)
(1)
P [kWh]
P [kWh]
In this case, since the LED pin is driven by signals different from AW, some other
relationship between the LSB of the register and must be defined:
K
AWFun d
K
RW
K
SW
= 4*KAW [Wh]
= 2*KAW [VARh]
= KAW [VAh]
APL = 1:
MOP provides the ∑ Δ signal generated from the analog voltage input;
MON provides the ∑ Δ signal generated from the analog current input, according to the
selection of the tamper module
LED provides the information about the selection of the current channel made by the tamper
module. If LED is low it means the primary channel is selected, if LED is high the secondary
channel is actually selected.
8.17 Status bits
The STPM01 includes 8 status bits that provide several information on the current meter
status. The status bits are the following:
Doc ID 10853 Rev 831/60
Theory of operationSTPM01
Table 15.Status bit description
Bit #NameDescriptionCondition
0BILNo load condition
1BCF∑ Δ signals status
2BFRLine frequency range
3BITTamper condition
4MUXCurrent channel selection
5LINTrend of the line voltage
6PINOutput pins check
7HLTData Validity
BIL=0: No load condition not detected
BIL=1: No load detected
BCF=0: ∑ Δ signals alive
BCF=1: one or both ∑ Δ signals are stacked
BFR=0: Line frequency inside the 45Hz-65Hz range
BFR=1: Line frequency out of range
BIT=0: Tamper not detected;
BIT=1: Tamper detected;
MUX=0: Primary current channels selected by the tamper module;
MUX=1: Secondary current channels selected by the tamper
module;
LIN=0: line voltage is going from the minimum to the maximum value.
(Δv/Δt >0);
LIN=1: line voltage is going from the maximum to the minimum value.
(Δv/Δt < 0);
PIN=0: the output pins are consistent with the data
PIN=1: the output pins are different with the data, this means some
output pin is forced to 1 or 0.
HLT=0: the data records reading are valid.
HLT=1: the data records are not valid. A reset occurred and a restart
is in progress.
When STPM01 is used in peripheral mode all these signal can be read through the SPI
interface. See paragraph 16 for details on the Status bit location in the STPM01 data
records.
In standalone mode the BIL signal is available in SCLNLC pin and the BIT signal in the
SDATD pin. All the other signals can be read only through SPI interface.
8.18 Programming the STPM01
Data records
The STPM01 has 8 internal data records registers. Every data record consists of 4-bit parity
code and 28-bit data value where the parity code is computed from the data value, which
makes total of 32 bits or 4 bytes.
The figure below shows the data records structure with the name of the contained
information.
Each bit of parity nibble is defined as odd parity of all seven corresponding bits of data
nibbles.
32/60Doc ID 10853 Rev 8
STPM01Theory of operation
The first 6 registers are read-only except for the 8 bit mode signals in the DFP register (the
mode signals will be described later in this paragraph). The last two registers CFL and CFH
can be also written because they contain the configuration bits. Among these last 64 bits (32
of CFL and 32 of CFH), 8 bits are used for parity nibbles, then only 56 bits are used for
configuring and programming the STPM01.
Figure 23. STPM01 data records map
20 bit
DAP
4 bit
parity
20 bit8 bit
1bit
type0 active energy
1bit 1bit
6 bit
Status
DRP
DSP
DFP
DEV
DMV
CFL
CFH
parity
parity
parity
parity
parity
parity
parity
p
p
uMOM
msblsb
8.19 Configuration bits
All the configuration bits that control the operation of the device (CFL and CFH data records)
can be written in a temporary or permanent way. In case of temporary writing the
configuration bits value are written in the so called shadow registers which are simple
latches that hold the configuration data. In case of permanent writing the configuration bits
are stored in the OTP (one time programmable) cells that keep the information for an
undefined period of time even if the STPM01 is without supply, but, once written, they
cannot be changed anymore.
reactive energy
apparent energy
type 1 energy
iRMSuRMS
iMOM
lower part of configurators
upper part of configurators
11 bit16 bit
upper f(u)0 1
lower f(u)
mode signals
The shadow registers are cleared whenever a reset condition occurs (both POR and remote
reset).
As indicated in the data records table, the configuration bits are 56. Each of them consists of
paired elements, one is latch, the OTP shadow, and another is the OTP antifuse element.
When the STPM01 is released in the market, all antifuses represents logic low state but they
can be written by the user in order to configure the STPM01.This means that STPM01 can
retain 56 bits of information even if it has been unsupplied for an undefined time. That’s why
the CFG signals are used to keep certain configuration and calibration values of device.
Doc ID 10853 Rev 833/60
Theory of operationSTPM01
The very first CFG bit, called TSTD, is used to disable any change of system signals after it
was permanently set. During the configuration phase, each bit set to logic level 1 will
increase the supply current of STPM01 of about 120 µA, until the TSTD bit is set to 1. The
residual increase of supply current is 2 µA per each bit set to 1. It is then recommended to
set the TSTD bit to 1 after the configuration procedure in order to keep the supply current as
low as possible.
The STPM01 can work either using the data stored in the OTP cells either the data available
in the shadow latches. This can be chosen according to the value RD Mode signal (see
mode signal paragraph for description). If the RD is set, the CFG bits originates from
corresponding OTP shadow latches otherwise, if the RD is cleared, the CFG bits originates
from corresponding OTP antifuses. This way one can temporary sets up certain
configuration or calibration of device then verify it and then change it, if it is necessary. For
example, this is extensively exercised during production tests.
Each configuration bit can be written sending a byte command to STPM01 through its SPI
interface. The procedure to write the configuration bits is described in the SPI section.
After the TSTD bit has been set, the only write commands accepted will be the precharge
and the remote reset, this implies that the shadow latches cannot be used as source of
configuration data anymore.
Table 16.Configuration bits map
Address
n. of
bits
(1)
Name
APL2
6-bit
binary
0000000TSTD1
0000011MDIV1
0000102RC1
0000113
0001004
DEC
Description
Test mode and OTP write disable:
- TSTD=0: testing and continuous pre-charge of OTP when in read mode,
- TSTD=1:normal operation and no more writes to OTP
- APL=1: peripheral, MOP=ΔΣ Voltage; MON=ΔΣ current; LED=Mux (current) APL=2: standalone, MOP,MON=stepper, LED=pulses, SCLNLC=no load
condition, SDATD=tamper detected, SYN=negative active power direction
- APL=3: standalone, MOP:MON=stepper, LED=pulses according to KMOT,
SCLNLC=no load condition, SDATD=tamper detected, SYN=negative active
power direction
(1)
34/60Doc ID 10853 Rev 8
STPM01Theory of operation
Table 16.Configuration bits map (continued)
Address
6-bit
binary
DEC
Name
n. of
bits
Description
(1)
0001015
0001106
Current channel sensor type, gain and tamper selection:
- PST=0: primary is coil x8 (x16 if ADDG=1), secondary is not used, no tamper
- PST=1: primary is coil x24 (x32 if ADDG=1), secondary is not used, no tamper
- PST=2: primary is CT x8, secondary is not used, no tamper
- PST=3: primary is shunt x32, secondary is not used, no tamper
0001117
PST3
(1)
- PST=4: primary is coil x8 (x16 if ADDG=1), secondary is coil x8 (x16 if
ADDG=1), tamper
- PST=5: primary is coil x24 (x32 if ADDG=1), secondary is coil x24 (x32 if
ADDG=1), tamper
- PST=6: primary is CT x8, secondary is CT x8, tamper
- PST=7: primary is CT x8, secondary is shunt x32, tamper
Power calculation when BFR=1 and PST
0010008FRS1
- FRS=0: energy accumulation is frozen, power is set to zero;
- FRS=1: normal energy accumulation and power computation (p=u*i);
Bit sequence output during record data reading selection:
0010019MSBF1
- MSBF=0: msb first
- MSBF=1: lsb first
This bit swap the information stored in the type0 (first 20 bits of DAP register)
and type1 (first 20 bits of DFP register) active energy.
00101010FUND1
- FUND = 0: type 0 contains wide band active energy, type1 contains
fundamental active energy
- FUND = 1: type 0 contains fundamental active energy, type1 contains wide
band active energy
001011111RESERVED
00110012
No load condition threshold as product between V
LTCH=0 800
001101 13
(1)
LT CH2
LTCH=1 1600
LTCH=2 3200
LTCH=3 6400
Constant of stepper pulses/kWh (see par. 16) selection when APL=2 or 3:
If LVS=0,
KMOT=0 P/64
KMOT=1 P/128
KMOT=2 P/32
Selection of pulses for LED when APL=0:
KMOT=0 Type0 Active Energy
KMOT=1 Type1 Active Energy
KMOT=2 Reactive Energy
KMOT=3 Apparent Energy
Doc ID 10853 Rev 835/60
Theory of operationSTPM01
Table 16.Configuration bits map (continued)
Address
6-bit
binary
DEC
Name
n. of
bits
Description
(1)
01000016
010001 17
01001018
010011 19
01010020
01010121
01011022
010111 23
01100024
01100125
01101026
01101127
01110028
01110129
01111030
011111 31
10000032
10000133
10001034
10001135
10010036
10010137
10011038
100111 39
10100040
10100141
(1)
BGTC2Bandgap Temperature compensation bits. See Figure 17 for details.
(1)
2RESERVED
4-bit unsigned data for compensation of phase error, 0°+0.576°.
CPH4
16 values are possible with a compensation step of 0.0384°. When CPH=0 the
compensation is 0°, when CPH=15 the compensation is 0.576°.
(1)
8-bit unsigned data for voltage channel calibration.
CHV8
256 values are possible. When CHV is 0 the calibrator is at -12.5 % of the
nominal value. When CHV is 255 the calibrator is at +12.5 %. The calibration
step is then 0.098%.
(1)
8-bit unsigned data for primary current channel calibration.
CHP8
256 values are possible. When CHP is 0 the calibrator is at -12.5 % of the
nominal value. When CHP is 255 the calibrator is at +12.5 %. The calibration
step is then 0.098%.
(1)
10101042
10101143
CHS8
10110044
8-bit unsigned data for secondary current channel calibration.
256 values are possible. When CHS is 0 the calibrator is at -12.5 % of the
nominal value. When CHS is 255 the calibrator is at +12.5 %. The calibration
step is then 0.098 %.
10110145
10111046
101111 47
(1)
36/60Doc ID 10853 Rev 8
STPM01Theory of operation
Table 16.Configuration bits map (continued)
Address
6-bit
binary
DEC
Name
n. of
bits
Description
(1)
11000048
CRC2
110001 49
11001050
110011 51
11010052ADDG1
11010153CRIT1
11011054LVS1
110111551Reserved
1. IMPORTANT: This bit represents the MSB of the decimal value indicated in the description column.
(1)
(1)
NOM2
2-bit unsigned data for calibration of RC oscillator.
CRC=0, or CRC=3 cal=0%
CRC=1, cal=+10%;
CRC=2, cal=-10%.
2-bit modifier of nominal voltage for Single Wire Meter.
NOM=0: K
NOM=3: K
Selection of additional gain on current channels:
ADDG=0: Gain+=0 / ADDG=1: Gain+=8
Type of stepper selection:
LVS=0: pulse width 31.25 ms, 5V, / LVS=1: pulse width, 156.25 ms, 3V
=0.3594 / NOM=1: K
NOM
=0.4531;
NOM
=0.3906 / NOM=2: K
NOM
As it is indicated above, the STPM01 includes 56 CFG bits. Normally, some of these bits
should be permanently set during production of application of STPM01 in order to protect
the application from power fails. Of course, if an application would include an on-board
microcontroller, it could reload the configuration and calibration values after power on restart
and so, the permanent set of STPM01 would not be necessary. But this is not very safe way
to do it, because due to some EMI even imposed to tamper the meter, the microcontroller
may become lost and during such state, it can change some system signals in the STPM01
or somebody can change the calibration and configuration by changing the software of onboard microcontroller.
NOM
=0.4219 /
8.20 Mode signals
The STPM01 includes 8 mode signals located in the DFP data record, 3 of these are used
only for internal testing purposes while 5 are useful to change some of the operation of the
STPM01. The mode signals are not retained when the STPM01 supply is not available and
then they are cleared when a POR occurs but they are not cleared when a remote reset
command (RRR) is sent through SPI.
The mode signals bit can be written using the normal writing procedure of the SPI interface
(see SPI section).
Of course, we can clear the RD by clearing all system signals. The first way is to generate
POR signal but this way we clear and reset the whole device. An alternative way is to set the
TSTD bit in the shadow latches. This setting becomes effective after SCS goes to idle state
when the TSTD clears all system signals including itself but, it does not reset the whole
device.
Doc ID 10853 Rev 837/60
Theory of operationSTPM01
Table 17.Mode signals description
Bit #
0BANK
1PUMP
2Reserved
3Reserved
4CSEL
5RD
6WE
7Precharge1
Signal
name
Bit
value
0
Used for RC startup procedure
11111000xF0 or F1
0MOP and MON operates normally0111001x72 or 73
MOP and MON provides the driving signals to implement a
1
charge-pump DC-DC converter
0Current Channel 1 selected when tamper is disabled0111100x78 or 79
1Channel 2 selected when tamper is disabled1111100xF8 or F9
0The 56 Configuration bits originated by OTP antifuses0111101x7A or 7B
1The 56 Configuration bits originated by shadow latches1111101xFA or FB
Any writing in the configuration bits is recorded in the
0
shadow latches
Any writing in the configuration bits is recorded both in the
1
shadow latches and in the OTP antifuse elements
Swap the 32 bits data records reading. From
1,2,3,4,5,6,7,8, to 5,6,7,8,1,2,3,4 and viceversa
Status
Binary
command
0111000x70 or 71
1111001xF2 or F3
0111110x7C or 7D
1111110xFC or FD
1111111xFF
Hex
command
– RD mode signal has been already described in the SPI section but there is another
implied function of the signal RD. When it is set, each sense amplifier is disconnected
from corresponding antifuse element and this way, its 3 V NMOS gate is protected
from the high voltage of VOTP during permanent write operation. This means that as
long as the VOTP voltage reads more than 3 V, the signal RD should be set.
– PUMP: when set, the PUMP mode signal transform the MOP and MON pins to act as
driving signals to implement a charge-pump DC-DC converter (see schematic page
36). This feature is useful in order to boost the V
supply voltage of the STPM01 to
CC
generate the VOTP voltage (14 V to 20 V) needed to program the OTP antifuse
elements.
– CSEL In normal operation, if the anti-tamper module is not activated (see PST
configuration bits) the STPM01 will select the channel 1 as source of current
information. For debug or calibration purposes it is possible to select channel 2 as
source of current channel signal when the tamper module is disabled. This is done
setting CSEL mode bit.
– WE (write enable): This mode signal is used to permanently write to the OTP antifuse
element. When this bit is not set, any write to the configuration bit is recorded in the
shadow latches. When this bit is set the writing is recorded both in the shadow latch
and in the OTP antifuse element.
– Precharge: this command swaps the sequence of data record read, allowing the
reading of the last four data records as first and the first four as second. The reading
sequence will be 5, 6, 7, 8, 1, 2, 3, 4. Differently from the other mode signals, the
precharge command is not retained inside the STPM01, in fact it should be sent each
time before the reading of the data records. This is the only command that can be
sent to STPM01 when the TSTD bit has been set.
38/60Doc ID 10853 Rev 8
STPM01Theory of operation
– BANK: it is used to activate RC oscillator (see Chapter 8.12.1).
8.21 SPI interface
The SPI interface supports a simple serial protocol, which is implemented in order to enable
a communication between some master system (microcontroller or PC) and the device.
Three tasks can be performed with this interface:
- remote resetting the device,
- reading data records,
- writing the Mode bits and the configuration bits (temporarily or permanently);
Four pins of the device are dedicated to this purpose: SCS, SYN, SCLNCN, SDATD. SCS,
SYN and SCLNLC are all input pins while SDATD can be input or output according if the SPI
is in write or read mode. A high level signal for these pins means a voltage level higher than
0.75 x V
The internal register are not directly accessible, rather a 32 bit of transmission latches are
used to pre-load the data before being read or written to the internal registers.
The condition in which SCS, SYN and SCLNLC inputs are set to high level determines the
idle state of the SPI interface and no data transfer occurs.
– SCS: as already described in the document, when STPM01 is in standalone mode,
– SYN: this pin operates different functions according to the status of SCS pin. When
– SCLNLC: it is basically the clock pin of the SPI interface. This pin function is also
– SDATD is the Data pin. If SCS is low, the operation of SDATD is dependent on the
, while a low level signal means a voltage value lower than 0.25 x VCC.
CC
the SYN, SCLNLC and SDATD are used also for providing information on the meter
status (see Ta bl e 5 ) and are not used for SPI communication. The SCS pin allows
using the above pins for SPI communication even when the STPM01 is working in
standalone mode, in fact SCS pin enables SPI operation when low. In this section, the
SYN, SCLNLC and SDATD operation as part of the SPI interface is described.
SCS is low the SYN pin status select if the SPI is in read (SYN=1) or write mode
(SYN=0). When SCS is high and SYN is also high the results of the input or output
data are transferred to the transmission latches.
controlled by the SCS status. If SCS is low, SCLNCL is the input of serial bit
synchronization clock signal. When SCS is high, SCLNLC is also high determining
the idle state of the SPI.
status of SYN pin. if SYN is high SDATD is the output of serial bit data (read mode) if
SYN is low SDATD is the input of serial bit data signal (write mode). If SCS is high
SDATD is input of idle signal.
Any pin above has internal weak pull up device of nominal 15 µA. This means that when
some pin is not forced by external signals, the state of pin is logic high. A high state of any
input pin above is considered as an idle (not active) state. For the SPI to operate correctly
the STPM01 must be correctly supplied as described in the power supply section. Idle state
of SPI module is recognized when the signals of pins SYN, SCS, SCLNLC and SDATD are
in a logic high state. Any SPI operations should start from such idle state. The exception to
this rule is when STPM01 has been put into mode of standalone application. In such mode it
can happen that states of pins SCLNLC, SDATD and SYN are not high due to states of
corresponding internal status bits.
When SCS is active (low), signal SDATD should change its state at trailing edge of signal
SCLNLC and the signal SDATD should be stable at next leading edge of signal SCLNLC.
The first valid bit of SDATD is always started with activation of signal SCLNLC.
Doc ID 10853 Rev 839/60
Theory of operationSTPM01
0
8.21.1 Remote reset
The timing diagram of the operation is shown on the Figure 24. The time step can be as
short as 30 ns.
The internal reset signal is named RRR. Unlike the POR, the RRR signal does not cause
the 30 ms retard restart of analog module and the 120 ms retard restart of digital module.
This signal doesn’t clear the mode signals.
Figure 24. Timing for providing remote reset request
SCS
SCS
SYN
SYN
SCLNLC
SCLNLC
(1)
SDATD
SDATD
t1t2t3t4t5t6t
1. All the time intervals must be longer than 30 ns. t7 → t8 is the reset time, this interval must be longer than 30 ns as well.
7
t8t9t
1
8.22 Reading data records
Data records reading will take place most often when there will be an on-board
microcontroller in an application. Such microcontroller will be able to read all measurement
results and all system signals (configuration, calibration, status, mode). Again, the time step
can be as short as 30 ns. There are two phases of reading, called latching and shifting.
Latching is used to sample results into transmission latches. The transmission latches are
the flip-flops that hold the data in the SPI interface. This is done with the active pulse on
SYN when SCS is idle. The length of pulse on SYN must be longer than 2 periods of
measurement clock, i.e. more than 500 ns at 4 MHz.
The shifting starts when SCS become active. In the beginning of this phase another, but
much shorter pulse (30 ns) on SYN should be applied in order to ensure that an internal
transmission serial clock counter is reset to zero. An alternative way is to extend the pulse
on SYN into the second phase of reading. After that reset is done, a 32 serial clocks per
data record should be applied. Up to 8 data records can be read this way. This procedure
can be aborted at any time by deactivation of SCS (see Figure 24).
The first read out byte of data record is least significant byte (LSB) of data value and of
course, the fourth byte is most significant byte (MSB) of data value. Each byte can be further
divided into a pair of 4-bit nibbles, most and least significant nibble (MSN, LSN). This
40/60Doc ID 10853 Rev 8
STPM01Theory of operation
division makes sense with the MSB of data value because the MSN of it holds the parity
code rather than useful data.
Figure 25. Data records reconstruction
The sequence of data record during the reading operation is fixed. Normally, an application
will read 1st,.., 6th data record, the 7th and 8th data record would read only when it need to
fetch the configuration data. However, an application may apply a precharge command (see
Ta bl e 1 7 ) prior reading phase. This command forces the device to respond with the
sequence 5th,.., 8th, 1st,.., 4th. Such change of sequence can be used to skip the first four
data records.
The timing diagram of the reading operation is shown on the Figure 26. One can see the
latching and beginning of shifting phase of the first byte (0x5F) of the first data record and
end of reading. Also, both alternatives to reset the internal transmission serial clock counter
is shown in signal SYN.
Figure 26. Timing for data records reading
SCS
SCS
SYN
SYN
SCLNLC
SCLNLC
f(read)
f(read)
SDATD
SDATD
t
1t2
1st byte
1st byte
t
t
3
t
t
4
6
5
t7t
8
last bit of 32nd byte
last bit of 32nd byte
Doc ID 10853 Rev 841/60
Theory of operationSTPM01
t1 → t2: Latching phase. Interval value > 2/f
t2 → t3: Data latched, SPI idle. Interval value > 30 ns
t
→ t4: Enable SPI for read operation. Interval value > 30 ns
3
t
→ t5: Serial clock counter is reset. Interval value > 30 ns
4
t
→ t6: SPI reset and enabled for read operation. Interval value > 30 ns
5
t
: Internal data transferred to SDATD
7
t
: SDATD data is stable and can be read
8
The system that reads the data record from the STPM01 should check the integrity of each
data record. If the check fails, the reading should be repeated, but this time only the shifting
should be applied otherwise a new data would be latched into transmission latches and
incorrectly read one would be lost.
Normally, each byte is read out as most significant bit (MSB) first. But this can be changed
by setting the MSBF configuration bit in the STPM01 CFL data record. If this is done, each
byte is read out as least significant bit (LSB) first.
8.23 Writing procedure
Each writable bit (configuration and mode bits) has its own 6-bit absolute address. For the
configuration bits, the 6-bit address value corresponds to its decimal value, while for the
mode bits the addresses are the ones indicated in the Mode Signal paragraph.
In order to change the state of some latch one must send to STPM01 a byte of data which is
normal way to send data via SPI. This byte consists of 1-bit data to be latched (MSB),
followed by 6-bit address of destination latch, followed by 1-bit don’t care data (LSB) which
makes total 8 bits of command byte.
CLK
For example, if we would like to set the configuration bit 47 (part of the secondary current
channel calibrator) to 0, we must convert the decimal 47 to its 6-bit binary value: 101111.
The byte command will be then composed like this:
1 bit DATA value+6-bits address+1 bit (0 or 1) as depicted in Figure 27. In this case the
binary command will be 01011111 (0x5F) which is the one depicted in the figure or
01011110 (0x5E).
Figure 27. Timing for writing configuration and mode bits
42/60Doc ID 10853 Rev 8
STPM01Theory of operation
t1 → t2 (> 30 ns): SPI out of idle state
t
→ t3 (> 30 ns): SPI enabled for write operation
2
t
: data value is placed in SDA
3
t
: SDA value is stable and shifted into the device
4
t
→ t5 (> 10 µs): writing clock period
3
t
→ t5: 1 bit data value
3
t
→ t6: 6 bits address of the destination latch
5
t
→ t7: 1 bit EXE command
6
t
: end of SPI writing
8
t
: SPI enters idle state
9
The same procedure should be applied for the mode signals, but in this case the 6-bits
address must be taken from the Ta bl e 1 7 .
The LSB of command is also called EXE bit because instead of data bit value, the
corresponding serial clock pulse is used to generate the necessary latching signal. This way
the writing mechanism does not need the measurement clock in order to operate, which
makes the operation of SPI module of STPM01 completely independent from the rest of
device logic except from the signal POR.
Commands for changing system signals should be sent during active signals SCS and SYN
as it is shown in the Figure 27. The SYN must be put low in order to disable SDATD output
driver of STPM01 and make the SDATD as an input pin. A string of commands can be send
within one period of active signals SCS and SYN or command can be followed by reading
the data record but, in this case, the SYN should be deactivated in order to enable SDATD
output driver and a SYN pulse should be applied before activation of SCS in order to latch
the data.
Interfacing the standard 3-wire SPI with STPM01 SPI.
Due to the fact a 2-wire SPI is implemented in STPM01 it is clear that sending any
command from a standard 3-wire SPI would require 3-wire to 2-wire interface, which should
produce a proper signal on SDATD from host signals SDI, SDO and SYN. A single gate 3state buffer could be omitted by an emulation of SPI just to send some command. On a
microcontroller this would be done by the following steps:
1.disable the SPI module;
2. set SDI pin which is connected to SDATD to be output;
3. activate SYN first and then SCS;
4. apply new bit value to SDI and activate SCL;
5. deactivate SCL;
6. repeat the last two steps seven times to complete one byte transfer;
7. repeat the last three steps for any remaining byte transfer;
8. set SDI pin to be input;
9. deactivate SCS and the SYN;
10. enable the SPI module;
In case of precharge command (0xFF), emulation above is not necessary. Due to the pull up
device on the SDATD pin of the STPM01 the processor needs to perform the following
steps:
Doc ID 10853 Rev 843/60
Theory of operationSTPM01
1.activate SYN first in order to latch the results;
2. after at least 1µs activate SCS;
3. write one byte to the transmitter of SPI (this will produce 8 pulses on SCL with SDI=1);
4. deactivate SYN;
5. optionally read the data records (the sequence of reading will be altered;
6. deactivate SCS;
Permanent writing of the CFG bits
In order to make a permanent set of some CFG bits, the following procedure should be
conducted:
1.collect all addresses of CFG bits to be permanently set into some list;
2. clear all OTP shadow latches;
3. set the system signal RD;
4. connect a current source of at least +14 V, 1 mA to 3 mA to VOTP;
5. wait for VOTP voltage is stable;
6. set one OTP shadow latch from the list;
7. set the system signal WE;
8. wait for 300 µs;
9. clear the system signal WE;
10. clear the OTP shadow latch which was set in step 6;
11. until all wanted CFG bits are permanently set, repeat steps 5 to 11;
12. disconnect the current source;
13. wait for VOTP voltage is less than 3 V;
14. clear the system signal RD;
15. read all data records, in the last two of them there is read back of CFG bits;
16. if verification of CFG bits fails and there is still chance to pass, repeat steps 1 to 16.
For steps of set or clear apply the timing shown in Figure 27 with proper signal on the
SDATD. For step 15 apply the timing shown in Figure 26.
For permanent set of the TSTD bit, which will cause no more writing to the Configuration
bits, the procedure above must be conducted in such way that steps 6 to 13 are performed
in series during single period of active SCS because the idle state of SCS would make the
signal TSTD immediately effective which in turn, would abort the procedure and possibly
destroy the device due to clearing of system signal RD and so, connecting all gates of 3V
NMOS sense amplifiers of already permanently set CFG bits to the V
8.24 Energy calculation algorithm
Inside the STPM01 the computing section of the measured active power uses a completely
new signal patented process approach. This approach allows the device to reach high
performances in terms of accuracy.
The signals, coming from the sensors, for the instantaneous voltage:
Equation 2
v(t) = V•sin
and the instantaneous current:
44/60Doc ID 10853 Rev 8
ωt; where V is the peak voltage and ω is related to the line frequency
OTP
source.
STPM01Theory of operation
Equation 3
i(t) = I • sin (
where I is the peak current,
between voltage and current.
ωt + ϕ);
ω is related to the line frequency and ϕ is the phase difference
8.24.1 Active power
Figure 28. Active energy computation diagram
In the STPM01, after the pre-conditioning and the A/D conversion, the digital voltage signal
(which is dynamically more stable with respect to the current signal) is processed by a
differentiated stage which transforms:
Equation 4
v(t) → v’(t) = dv/dt = V
The resulted signal, together with the pre-processed and digitalized current signal:
Equation 5
i(t) = I
⋅ sin(ωt + ϕ); [see Figure 28 - 6]
are then available for the calculation process. These digital signals are also provided into
two additional stages which perform the integration of themselves, obtaining:
⋅ ω⋅ cos ωt − [see Figure 28 - 5]
Doc ID 10853 Rev 845/60
Theory of operationSTPM01
Equation 6
dv/dt → v(t) = V
i(t) →
∫
[see Figure 28 - 8]
Now four signals are available. Combining (pairing) them by means of two multiplying stages
two results are obtained:
Equation 7
dv
)t(p
/
1
dt
[see Figure 28 - 9]
Equation 8
/
2
⋅sin ωt; [see Figure 28 - 7]
dt)t(i)t(Iϕ+ω⋅
∫
I
−=⋅=
ω
dt)t(i
−=⋅⋅=
cosIV
2
cosIV
)t(i)t(v)t(p
=⋅=
ϕ⋅⋅
−
2
)tcos(
)t2cos(IV
ϕ⋅⋅
−
ϕ+ω⋅⋅
2
)t2cos(IV
ϕ+ω⋅⋅
2
[see Figure 28 - 10]
After these two operations, another stage performs the subtraction between the results p2
and p1 and a division by 2, obtaining the active power:
Equation 9
))t(p)t(p(
−
/
)t(p
=
/
12
=
2
[see Figure 28 - 11]
In this way, the AC part V•I•cos(2
power.
In the case of current sensors like “Rogowski coils”, which provide the rate of the
instantaneous current signal (di/dt), the initial voltage signal differentiated stage will be
switched off. In this case the signals coming from the A/D conversion and their consequent
integrations will be:
Equation 10
v(t) = V•sin
′
)t(iϕ+ω⋅ω⋅−==
ωt
)t(di
cosIV
ϕ⋅⋅
2
ωt + ϕ)/2 has been then removed from the instantaneous
)tcos(I
dt
46/60Doc ID 10853 Rev 8
STPM01Theory of operation
Equation 11
dt)t(v)t(Vω⋅
∫
Equation 12
[
′
=
∫
The signals process flow will be the same as shown in the previous case, and even with the
formulas above, the result will be the same.
The absence of any AC component allows a very fast calibration procedure: it requires just
to set (using the internal device programming registers) the voltage and current sensor
conversion constants, using the effective voltage and current (V
provided by the device built-in communication port, avoiding the time-averaged readings of
the active power or need for line synchronization.
8.24.2 Reactive power
The reactive power is produced using the already computed signals. In case of shunt sensor
the voltage signal is derived while the current signal is not. A first computation is to multiply
DS value of integrated voltage channel with the value of integrated current channel, which
yields:
V
−=⋅=
tcos
ω
)tsin(I)t(idt)t(i)t
ϕ+ω⋅−==⋅
, I
RMS
) readings
RMS
Equation 13
I
′
=
1
∫
The second is to multiply filtered DS value of voltage channel with the value of filtered
current channel,
Equation 14
′
=
2
From the above results, Q1(t) is proportional to 1/
correct reactive power would result from the following formula:
Equation 15
Q
1
2
)t(Q)t(Q
21
VI1
⋅+ω⋅⋅=sin
ω
2
⎛
)tsinV()t(I)t(v)t(Idt)t(v)t(Q
−⋅ω=⋅=⋅
⎜
ω
⎝
VI
)tsin(ItcosV)t(i)t(v)t(Q
tcos(
()
2
ω while Q2(t) is proportional to ω. The
ϕ=
VI
⎞
=
ϕ+ω
⎟
⎠
()
2
ω
)t2sin(sin
ϕ+ω+ϕ⋅ω⋅=ϕ+ω⋅ωω=⋅
)t2sin(sin
ϕ+ω−ϕ⋅
Since the above computation would need significant additional circuitry, the Reactive Power
in the STPM01 is calculated using only the Q1(t) multiplied by
Doc ID 10853 Rev 847/60
ω, it means:
Theory of operationSTPM01
Equation 16
1
)t(Q
2
The reactive power will present then a ripple at twice the line frequency. Since the average
value of a sinusoid is 0, this ripple does not contribute to the reactive energy calculation over
time, moreover, in the STPM01 the reactive power is not used for meter calibration or to
generate the stepper pulses, then this ripple will not affect the overall system performances.
In case of Rogowsky coil, the same procedure is applied, but the current channel will be
proportional to the derived of the current and the differentiated is bypassed in the voltage
channel, so we have:
Equation 17
1
∫∫
Equation 18
1
)t(Q
13
⋅=
′
⋅=
VI
()
)t2sin(sin
ϕ+ω−ϕ⋅=ω⋅⋅=
2
V
′
⎛
−=⋅=
)t(i)t(Vdt)t(idt)t(v)t(Q
⎜
ω
⎝
()()
⎞
()()
ω
⎟
⎠
VI
)tcos(I)t(tsinV)t(i)t(v)t(Q
VI
=ϕ+ω−⋅
)tsin(I)tcos(
2
ω
ϕ+ω−ϕ⋅ω⋅−=ϕ+ωω−⋅ω=
)t2sin(sin
ϕ+ω+ϕ
)t2sin(sin
2
The reactive power is then calculated:
Equation 19
1
)t(Q
2
)t(Q
13
VI
()
2
8.24.3 Apparent power and RMS values
The RMS values are calculated starting from the following formulas.
Shunt or current transformer
Equation 20
T
1
2
dt)t(I
∫
T
0
multiplying Equation 20 by
I
=
2
⋅ω
ω, the I
value is obtained:
RMS
)t2sin(sin
ϕ+ω+ϕ⋅=ω⋅⋅=
48/60Doc ID 10853 Rev 8
STPM01Theory of operation
Equation 21
I
=
I
RMS
The RMS voltage value is obtained as:
Equation 22
2
T
1
V
RMS
For the apparent power another value is produced:
Equation 23
T
1
2
′
∫
T
0
Multiplying Equation 20: and Equation 23: , the apparent power is produced:
Equation 24
S=
Rogowsky coil
In this case we have:
I
=
2
⋅ω
2
∫
T
0
V
dt)t(v
=
V
ω⋅
⋅
2
V
dt)t(v
==
2
ω⋅
2
VI
2
Equation 25
T
1
2
=
I
RMS
while V
The apparent power is simple calculated multiplying Equation 25: and Equation 22: .
The DSP then performs the integration of the computed powers into energies. These
integrators are implemented as up/down counters and they can rollover. 20-bit output buses
of the counters are assigned as most significant part of energy data records. It is a
responsibility of an application to read the counters at least every second not to miss any
rollover.
RMS
′′
∫
T
0
is calculated as in Equation 22: .
I
dt)t(i
=
2
Doc ID 10853 Rev 849/60
STPM01 calibrationSTPM01
9 STPM01 calibration
Energy meters based on STPM01 device are calibrated in a fast and easy way. The
calibration is essentially based on the single calibration of the voltage and current channel
considering their RMS values rather than on the frequency of output pulse signal. When the
two channel are calibrated all the other measurement are calibrated too. This allows the
calibration to be performed in only one point shortening the production time of the meter.
This procedure is possible due to the below key points:
– Device is compound of two independent meter channels for line voltage and current
respectively. Each channel includes its own digital calibrator, to adjust the RMS in the
range of ±12.5 % in 256 steps, and digital filter, to remove any signal DC component.
All final results are not subject to calibration procedure because they are achieved
from such corrected signals by mathematical modules implemented by hardwired
DSP.
– Device computes different kind of energies: active, reactive and apparent. The active
energy is produced without 2nd harmonic of line frequency. It also computes RMS
values of measured voltage and current.
– Device produces an energy output pulse signal but information can also be read
through serial port interface, SPI, and communication channel.
– Device has an embedded memory, 56 bits, used for configuration and calibration
purposes. The value of these bits can be read or they can be changed temporarily or
permanently through SPI communication channel.
Let’s consider the basic information needed to start the calibration procedure:
Table 18.Working point settings
Line RMS voltageVn(230V)
Line RMS currentI
Power sensitivityP(LED: P=128000 pulses/kWh, stepper motor: PM=P/64= 2000 pulses/kWh)
Shunt sensorKS0,42 mv/A
(5A)
n
The following typical STPM01 parameters and constants are also known:
Table 19.Device constants
Internal reference voltageV
Internal calculation frequencyf
Amplification of voltage ADCA
Amplification of current ADCA
Gain of differentiatorG
Gain of integratorG
Gain of decimation filterG
RMS voltage register lengthB
RMS current register lengthB
ConstantD
ParameterValueTolerance
BG
M
V
I
DIF
INT
DF
V
I
UD
1.23 V± 2%
223 Hz± 50 ppm
4± 1%
8, 16, 24, 32± 2%
0,6135
0,815
1.004
11
2
16
2
17
2
50/60Doc ID 10853 Rev 8
STPM01STPM01 calibration
As shown in Ta bl e 1 8 , only analog parameter are object of calibration because introduce a
certain error. Voltage ADC amplification Av is constant, while Ai is chosen according to used
sensors.
The calibration algorithm will firstly calculate the voltage divider ratio and, as final result, the
correction parameters, called Kv and Ki, which applied to STPM01 voltage and current
measures compensate small tolerances of analog components that affect energy
calculation.
Since Kv and Ki calibration parameters are the decimal representation of the corresponding
configuration bytes CHV and CHP or CHS (respectively voltage channel, primary current
channel and secondary current channel calibration bytes), at the end of calibration CHV and
CHP or CHS (according to the current channel under calibration, primary or secondary
respectively) bits' values are obtained.
In the following procedure CHV, CHP and CHS will be indicated as Cv and Ci.
Through hardwired formulas Kv and Ki tune measured values varying from 0,75 to 1 in 256
steps, according to the value of Cv and Ci (from 0 to 255).
To obtain the greatest correction dynamic initially calibrators are set in the middle of the
range, thus obtaining a calibration range of 12.5 % per voltage or current channel:
Calibrator’s value
Kv = Ki = 0.875
Ci = Cv = 128
In this way it is possible to tune Kv and Ki having a precise measured: for example Cv = 0
generates a correction factor of -12.5 % (Kv = 0.75) and Cv = 255 determines a correction
factor of +12.5 % (Kv = 1), and so on.
According to what pointed out above, the following formulas, which relate Kv, i and Cv, i are
obtained:
Kv,i = (Cv,i/128) * 0.125 + 0.75
Cv,i = 1024 * Kv,i - 768.
The calibration procedure will output Cv and Ci values that will allow the above power
sensitivity of the meter.
This sensitivity is used to calculate target frequency at LED pin for nominal voltage and
current values:
X
= f * 64;
F
with:
f = PM * In * Vn / 3600000;
From values above and for both chosen amplification factor A
=32 and initial calibration data,
I
the following target values can be calculated:
Target RMS reading for given In:
X
= In * KS * AI * Ki * G
I
* GDF * G
INT
* BI / (VBG * 1000) = 1573
DIF
Target RMS reading for given Vn:
X
= f * BV * BI * DUD / (fM * XI) = 852
V
The output of the voltage divider is then:
Doc ID 10853 Rev 851/60
STPM01 calibrationSTPM01
V
= (XV * VBG)/ (2 * G
DIV
Choosing R2 = 500 Ω (connected between V
V
and VIP) value is obtained:
LINE
R1 = R2 * (Vn - V
Indicating with I
current, and with X
and VA the real readings on the STPM01 RMS registers of voltage and
A
and XV ideal values of RMS current and voltage readings already
I
* AV * Kv * GDF * G
DIF
and VSS), the R1 resistor (connected between
I
) / V
DIV
DIV
* BV)= 145,6 mV
INT
= 789,3 Ω
calculated, the final values for calibrators can be calculated as:
X
= (Kv * VA) / 0.875
V
X
= (Ki * IA) / 0.875
I
If the computed final calibration data would fall out of calibration data range, the energy
meter should be recognized as bad or the given presumptions and calculations above
should be checked. Otherwise, if the final data of calibrators would be written into energy
meter, the RMS readings should be very close to target values I and V and the frequency of
LED output should be very close to target value f.
52/60Doc ID 10853 Rev 8
STPM01Application design
10 Application design
The choice of the external components in the transduction section of the application is a
crucial point in the application design, affecting the precision and the resolution of the whole
system.
Among the several considerations, a compromise has to be found between the following
needs:
1.Maximize the signal to noise ratio in the voltage channel,
2. Choose the current to voltage conversion ratio Ks and the voltage divider ratio in a way
that calibration can be achieved (please refer to AN2299)
3. Choose Ks to take advantage of the whole current dynamic range according to desired
maximum current and resolution.
To maximize the signal to noise ratio of the current channel the voltage divider resistors ratio
should be as close as possible to those shown in Tab l e 2 0 .
Table 20.Resistor divider ratio
FunctionComponentParameterValueUnit
Line voltage interfaceResistor divider
R to R ratio V
R to R ratio V
=230V1650
RMS
=110V830
RMS
V/V
The Figure 29 below shows a reference schematic for an application with the following
properties:
●P = 64000 imp/KWh
●I
●I
NOM
MAX
= 5 A
= 60 A.
Typical values for the current sensors sensitivity, also used in the reference schematic
below, are shown in Ta bl e 2 1 .
Table 21.Current channel typical components
FunctionComponentParameterValueUnit
Line current interface
Current shunt
Current to voltage conversion ratio Ks
Rogowsky coil0.13
0.425
mV/ACurrent transformer1.7
Note:If the device is used in configuration PST = 7 (primary channel with CT, secondary channel
with Shunt), the shunt Ks must always be equal to one fourth of the current transformer Ks.
Additional considerations on the application design, suggestions for noise and crosstalk
reduction can be found in the AN2317.
Doc ID 10853 Rev 853/60
Application designSTPM01
Figure 29. STPM01 reference schematic with one current transformer and one shunt
54/60Doc ID 10853 Rev 8
STPM01Application design
Figure 30. STPM01 with 3X charge pump DC-DC converter
Doc ID 10853 Rev 855/60
Package mechanical dataSTPM01
11 Package mechanical data
In order to meet environmental requirements, ST offers these devices in different grades of
ECOPACK
specifications, grade definitions and product status are available at: www.st.com.
ECOPACK
®
packages, depending on their level of environmental compliance. ECOPACK®
®
is an ST trademark.
56/60Doc ID 10853 Rev 8
STPM01Package mechanical data
TSSOP20 mechanical data
mm.inch.
Dim.
Min.Typ.Max.Min.Typ.Max.
A1.20.047
A10.050.150.0020.0040.006
A20.811.050.0310.0390.041
b0.190.300.0070.012
c0.090.200.0040.0079
D6.46.56.60.2520.2560.260
E6.26.46.60.2440.2520.260
E14.34.44.480.1690.1730.176
e0.65 BSC0.0256 BSC
K0°8°0°8°
L0.450.600.750.0180.0240.030
A2
A
A1
b
e
K
c
L
E
D
E1
PIN 1 IDENTIFICATION
1
0087225C
Doc ID 10853 Rev 857/60
Package mechanical dataSTPM01
Tape & reel TSSOP20 mechanical data
mm.inch.
Dim.
Min.Typ.Max.Min.Typ.Max.
A33012.992
C12.813.20.5040.519
D20.20.795
N602.362
T22.40.882
Ao6.870.2680.276
Bo6.97.10.2720.280
Ko1.71.90.0670.075
Po3.94.10.1530.161
P11.912.10.4680.476
58/60Doc ID 10853 Rev 8
STPM01Revision history
12 Revision history
Table 22.Document revision history
DateRevisionChanges
28-Sep-20041Preliminary data.
22-Dec-20052Document updated.
24-Oct-20063The chapter 9 updated.
06-Feb-20064Modified Figure 11.
12-Jan-20095Modified address 11 Table 16 on page 34.
Application design on page 53, modified Chapter 8.10: Tamper detection
module on page 24, Chapter 8.5: Period and line voltage measurement on
page 20.
Doc ID 10853 Rev 859/60
STPM01
Please Read Carefully:
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the
right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any
time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no
liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this
document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products
or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such
third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED
WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS
OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT
RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING
APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY,
DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE
GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void
any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any
liability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.