|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
general description the max71020 is a single-chip analog front-end (afe) for use in high-performance revenue meters. it contains the compute engine (ce) found in maxim integrateds fourth-generation meter system-on-chip (soc) and an improved analog-to-digital converter (adc), and inter - faces to the host controller of choice over a spi interface. the max71020 comes in a 28-pin tssop package. features s 0.1% accuracy over 2000:1 current range s exceeds iec 62053/ansi c12.20 standards s two differential current sensor inputs s two voltage sensor inputs s selectable gain of 1 or 8.9 for one current input to support a shunt s high-speed wh/varh pulse outputs with programmable width s up to four pulse outputs with pulse count s four-quadrant metering s digital temperature compensation s independent 32-bit compute engine s 45hz to 65hz line frequency range with same calibration s phase compensation (10) s four multifunction dio pins s spi interface s -40c to +85c industrial temperature range s 28-pin tssop lead(pb)-free package typical operating circuit 19-6400; rev 1; 1/13 ordering information appears at end of data sheet. for related parts and recommended products to use with this part, refer to www.maximintegrated.com/max71020.related . iap va ibp xin oscillator/p ll xout 9.8304mhz gnda gndd line neutral load mux and adc compute engine power-fault comparator regulator ct power supply temperature sensor v ref neutral ian ibn dio, pulses spi interface host shunt line vb v 3p3a v 3p3sys max71020 resistor- divider line note: this system is referenced to line voltage max71020 single-chip electricity meter afe for pricing, delivery, and ordering information, please contact maxim direct at 1-888-629-4642, or visit maxim integrateds website at www.maximintegrated.com.
2 (all voltages with respect to gnda.) voltage and current supplies and ground pins v 3p3sys , v 3p3a .................................................. -0.5v to +4.6v gndd ................................................................... -0.1v to +0.1v analog input pins iap, ian, ibp, ibn, va, vb ............................ (-10ma to +10ma), (-0.5v to +0.5v) xin, xout ......................... (-10ma to +10ma), (-0.5v to +3.0v) digital pins inputs .................................... (-10ma to +10ma), (-0.5v to +6v) outputs ............ (-10ma to +10ma), (-0.5v to (v 3p3sys + 0.5v)) temperature and esd stress operating junction temperature (peak, 100ms) .............. 140c operating junction temperature (continuous) ................. 125c storage temperature range ............................ -45c to +165c esd stress on all pins .............................................. 4kv, hbm lead temperature (soldering, 10s) .................................. 300c soldering temperature (reflow) ...................................... +250c tssop junction-to-ambient thermal resistance ( q ja ) .......... 78c/w junction-to-case thermal resistance ( q jc ) ............... 13 n c/w absolute maximum ratings note 1: package thermal resistances were obtained using the method described in jedec specification jesd51-7, using a four-layer board. for detailed information on package thermal considerations, refer to www.maximintegrated.com/thermal-tutorial . stresses beyond those listed under absolute maximum ratings may cause permanent damage to the device. these are stress ratings only, and functional opera - tion of the device at these or any other conditions beyond those indicated in the operational sections of the specifications is not implied. exposure to absolute maximum rating conditions for extended periods may affect device reliability. package thermal characteristics (note 1) electrical characteristics parameter conditions min typ max units recommended operating conditions v 3p3sys and v 3p3a supply voltage precision metering operation 3.0 3.6 v digital operation (notes 2, 3) 2.8 3.6 operating temperature -40 +85 c input logic levels digital high-level input voltage (v ih ) 2 v digital low-level input voltage (v il ) 0.8 v input pullup current (i il ) resetz v v3p3sys = 3.6v, v in = 0v 41 78 115 a input pullup current (i il ) other digital inputs v v3p3sys = 3.6v, v in = 0v -1 0 +1 a input pulldown current (i ih ) all pins v in = v v3p3sys -1 0 +1 a output logic levels digital high-level output voltage (v oh ) i load = 1ma v v3p3sys - 0.4 v i load = 15ma (note 3) v v3p3sys - 1.1 digital low-level output voltage (v ol ) i load = 1ma 0 0.4 v i load = 15ma (note 3) 0 0.96 max71020 single-chip electricity meter afe maxim integrated 3 electrical characteristics (continued) parameter conditions min typ max units temperature monitor tnom (nominal value at 22c) v v3p3a = 3.3v 956 lsb temperature measurement equation temp = 0.33 x stemp + 21.77 c temperature error (note 4) t a = -40c to +85c -6 +6 c t a = -20c to +60c -4.8 +4.8 duration of temperature measurement after setting temp_start temp_per = 0 15 60 ms supply current performance specifications v 3p3a + v 3p3sys current (note 4) v v3p3a = v v3p3sys = 3.3v, ce_e = 1, adc_e = 1 3 4.3 ma internal power-fault comparator specifications overall response time 100mv overdrive, falling 20 200 f s 100mv overdrive, rising 8 200 falling threshold 3.0v comparator 2.83 2.93 3.03 v 2.8v comparator 2.75 2.81 2.89 v difference 3.0v and 2.8v comparators 50 136 220 mv hysteresis (rising threshold - falling threshold) 3.0v comparator, t a = +22c 17 45 74 mv 2.8v comparator, t a = +22c 15 42 70 pll performance specifications pll power-up settling time v v3p3a = 0 to 3.3v step, measured from first edge of mck 75 f s pll_fast settling time v v3p3a = 3.3v, pll_fast rise 10 f s v v3p3a = 3.3v, pll_fast fall 10 pll lock frequency at xout v v3p3a = 3.3v, mck frequency error < 1% 7 9.8 13 mhz vref performance specifications vref output voltage, vref (22) t a = +22c 1.200 1.205 1.210 v vref power-supply sensitivity (dv ref /dv v3p3a ) v v3p3a = 3.0v to 3.6v -1.5 +1.5 mv/v vnom definition vnom(t) = vref(22) + tc1(t - 22) + tc2(t - 22) 2 v vnom temperature coefficient tc1 29.32 - 1.05 x trimt f v/c vnom temperature coefficient tc2 -0.56 - 0.004 x trimt f v/c 2 vref(t) deviation from vnom(t): - 6 vref(t) vnom(t)10 vnom(t) 62 (note 4) -40 +40 ppm/c max71020 single-chip electricity meter afe maxim integrated 4 electrical characteristics (continued) parameter conditions min typ max units adc converter performance specifications recommended input range (with respect to gnda) va, vb, ibp, ibn -250 +250 mvpk recommended input range (with respect to gnda) iap, ian: preamplifier enabled -27.78 +27.78 mvpk iap, ian: preamplifier disabled -250 +250 input impedance, no preamplifier f in = 65hz 50 100 k adc gain error vs percentage power-supply variation ? ? 6 pk in 10 nout 357nv v 100 v3p3a 3.3 v in = 200mv peak, 65hz; v v3p3a = 3.0v, 3.6v 81 ppm/% input offset iap = ian = gnda -10 +10 mv total harmonic distortion at 250mvpk v in = 55hz, 250mvpk, 64kpts fft, blackman harris window -85 db total harmonic distortion at 20mvpk v in = 55hz, 20mvpk, 64kpts fft, blackman harris window -90 db lsb size (lsb values do not include the 9-bit left shift at the ce input) v in = 55hz, 20mvpk, 64kpts fft, blackman- harris window, 10mhz adc clock firlen = 15 120.46 nv firlen = 14 146.20 firlen = 13 179.82 firlen = 12 224.59 firlen = 11 285.54 firlen = 10 370.71 digital full scale v in = 55hz, 400mvpk, 10mhz adc clock firlen = 15 q 2621440 lsb firlen = 14 q 2160000 firlen = 13 q 1756160 firlen = 12 q 1406080 firlen = 11 q 1105920 firlen = 10 q 851840 preamplifier performance specifications differential gain, (v in = 28mv differential) t a = +25c, v v3p3a = 3.3v, preamplifier enabled 8.9 v/v differential gain (v in = 15mv differential) gain variation vs. v 3p3a (v in = 28mv differential) v v3p3a = 3.0v, 3.6v -72 ppm/% gain variation vs. temperature (v in = 28mv differential) t a = -40 c to +85 c -45 ppm/c phase shift (v in = 28mv differential) t a = +25 c , v v3p3a = 3.3v (note 4) 0 8 milli- degree preamplifier input current (i iap ) preamplifier enabled, iadc0 = iadc1 = gnda 9 15 20 a preamplifier input current (i ian ) max71020 single-chip electricity meter afe maxim integrated 5 electrical characteristics (continued) note 2: v 3p3sys and v 3p3a must be connected together. note 3: gnda and gndd must be connected together. note 4: guaranteed by design, not production tested. parameter conditions min typ max units preamplifier and adc total harmonic (v in = 28mv differential) t a = +25c; v v3p3a = 3.3v, pre_e = 1 -80 db preamplifier and adc total harmonic distortion (v in = 15mv differential) t a = +25c; v v3p3a = 3.3v, pre_e = 1 -85 db spi slave timing specifications spi setup time spi_di to spi_ck rise 10 ns spi hold time spi_clk rise to spi_di 10 ns spi output delay spi_clk fall to spi_d0 40 ns spi recovery time spi_csz fall to spi_clk 10 ns spi removal time spi_clk to spi_csz rise 15 ns spi clock high 40 ns spi clock low 40 ns spi clock frequency 10 mhz spi transaction space (spi_csz rise to spi_csz fall) 1 s resetz timing reset pulse width following power-on 1 ms at all other times 5 s reset pulse rise time (note 4) 1 s voltage monitor nominal value at +22c (vnom) v v3p3a = 3.3v 130 lsb voltage measurement equation v v3p3sys (calc) = 3.29v + (vsense C 130) x 0.025v + stemp x 242 f v voltage error - ?? ?? ?? 100 1 v -4 +4 % max71020 single-chip electricity meter afe maxim integrated 6 recommended external components pin configuration name from to function value units c1 v 3p3a gnda bypass capacitor for 3.3v supply r 0.1 20% f csys v 3p3sys gndd bypass capacitor for v 3p3sys r 1.0 30% f c1p8 v dd gndd bypass capacitor for v1p8 regulator 0.1 20% f xtal xin xout at cut crystal specified for 18pf load 9.8304 mhz cxs xin gnda load capacitor values for crystal depend on crystal specifications and board parasitics. nominal values are based on 4pf board capacitance and include an allowance for chip capacitance. 32 10% pf cxl xout gnda 32 10% pf top view max71020 25 4x in ibn 26 3x ou t v 3p3a 27 2 te st 0 gnda 28 1 + vb va 22 7 di o0 /w pu ls e iap 23 6 v dd ian 21 8 di o1 /v pu ls e test 20 9 di o2 /x pu ls e resetz 19 10 in tz v pp 18 11 n .c. dio3/ypulse 17 12 n .c. gndd 16 13 sp i_c lk spi_csz 24 5 v 3p3s ys ibp 15 14 sp i_d i spi_do tssop max71020 single-chip electricity meter afe maxim integrated 7 pin description (pin types: p = power, o = output, i = input, i/o = input/output. the circuit number denotes the equivalent circuit, as specified under figure 1 ). pin name type circuit description power and ground pins 2 gnda p analog ground. gnda should be connected directly to the ground plane. 3 v 3p3a p analog power supply. a 3.3v power supply should be connected to v 3p3a . v 3p3a must be the same voltage as v 3p3sys . 12 gndd p digital ground. gndd should be connected directly to the ground plane. 23 v dd o output of the 1.8v regulator. a 0.1f bypass capacitor to ground should be connected to this pin. 24 v 3p3sys p system 3.3v supply. v 3p3sys should be connected to a 3.3v power supply. analog pins 7, 6 iap, ian i 6 differential or single-ended line current-sense inputs. these pins are voltage inputs to the internal adc. typically, these pins are connected to the outputs of current sensors. unused pins must be tied to gnda . 5, 4 ibp, ibn 1, 28 va, vb i 6 line voltage sense inputs. va/vb are voltage inputs to the internal adc. typically, the pins are connected to the outputs of resistor- dividers. unused pins must be tied to gnda . 25 xin i 8 crystal inputs. a 9.8304mhz crystal should be connected to xin and xout. 26 xout o digital pins 22 dio0/wpulse i/o 3, 4 multiple-use pins. configurable as dio. alternative functions with proper selection of associated registers are: dio0 = wpulse dio1 = vpulse 21 dio1/vpulse 20 dio2/xpulse 11 dio3/ypulse 8, 27 test, test0 i 3 connect to gndd 9 resetz i 3 active-low reset 13 spi_csz i 3 spi interface 14 spi_do o 4 15 spi_di i 3 16 spi_clk i 3 19 intz o 4 active-low interrupt request other pin 10 v pp i connect to gndd max71020 single-chip electricity meter afe maxim integrated 8 figure 1. i/o equivalent circuits di gi ta l i nput pi n an al og in put pi n di gi ta l ouput pi n cm os i npu t gndd v 3p3sys di gi ta l in pu t eq ui vale nt ci rc ui t ty pe 3 analog in pu t eq ui vale nt ci rc ui t ty pe 6: ad c in put cm os outp ut di gi ta l outpu t eq ui vale nt ci rc ui t ty pe 4 gndd gndd v 3p3sys v 3p3sys v 3p3sys to mux gnda v 3p3sys osc illator pi n os c illa to r eq ui vale nt ci rc ui t ty pe 8: os c illat or i/o to oscilla to r gnda gnda max71020 single-chip electricity meter afe maxim integrated 9 functional diagram max71020 dc modulator fi r de ci ma to r preamplifier input multiplexer start iap gnda v 3p3a ian voltage regulator v dd ibp ibn vb va ckce 20mhz, 5mhz mux_sync xin xout mck mu lt ip le xer co nt ro l vref crystal oscillator 9.83mhz master clock pll v ref clock generator temp sense vref power status ce 32 -b it co mput e en gine vstat resetz v3p3a 2 ck a dc (2.5mh z) gn dd v 3p3sys spi intz spi _c sz parity err spi _d i spi _d o spi _clk wpulse d10_wpulse intz d11_vpulse d12_xpulse d13_ypulse xfer_busy vstat 2 vpulse xpulse ypulse 1.8v to logic pulse control io_ctrl max71020 single-chip electricity meter afe maxim integrated 10 hardware description hardware overview the max71020 energy meter analog front-end (afe) integrates all primary functional blocks required to imple - ment a solid-state residential electricity meter. included on the chip are: an analog front-end (afe) featuring a 22-bit second- order sigma-delta adc an independent 32-bit digital computation engine (ce) to implement dsp functions a precision voltage reference (vref) a temperature sensor for digital temperature sensing and compensation four i/o pins a zero-crossing detector with interrupt output resistive shunt and current transformers are supported a spi slave for connection to a host controller in a typical application, the 32-bit compute engine (ce) of the max71020 sequentially processes the samples from the voltage inputs on analog input pins and per - forms calculations to measure active energy (wh) and reactive energy (varh), as well as a 2 h, and v 2 h for four-quadrant metering. these measurements are then accessed by the host controller. in addition to the temperature-trimmed ultra-precision voltage reference, the on-chip digital temperature com - pensation mechanism includes a temperature sensor and associated controls for correction of unwanted temperature effects on measurement, e.g., to meet the requirements of ansi and iec standards. temperature-dependent external components such as crystal oscillator, resistive shunts, current transformers (cts) and their corresponding signal conditioning circuits can be characterized and their correction factors can be programmed to produce electricity meters with excep - tional accuracy over the industrial temperature range. communications with the host is conducted over a spi interface. the communications protocol between the host and the max71020 provides a redundant information transfer ensuring the correctness of commands trans - ferred from the host to the afe, and of data transferred from the afe to the host. in addition, the max71020 has one pin dedicated as an interrupt output to the host. this pin notifies the host of asynchronous events. analog section signal input pins the max71020 has four analog inputs: two single-ended inputs for voltage measurement, and two differential inputs for current measurement. the iap, ian, ibp, and ibn pins are current sensor inputs. the differential inputs feature preamplifiers with a selectable gain of 1 or 9, and are intended for direct connection to a shunt resistor sensor or a current trans - former (ct). the voltage inputs in the max71020 are single-ended, and are intended for sensing the line voltage via resistive dividers. these single-ended inputs are referenced to the gnda pin. all analog signal input pins measure voltage. in the case of shunt current sensors, currents are sensed as a voltage drop in the shunt resistor sensor. in the case of current transformers (ct), the current is measured as a voltage across a burden resistor that is connected to the secondary winding of the ct. meanwhile, line voltages are sensed through resistive voltage-dividers. some versions of the device implement a preamplifier with a fixed gain of 8.9 to enhance performance when using sensors with a low-amplitude output (for example, current shunts). when using a device with the preamplifi - er enabled, the input signal amplitude cannot be greater than 27.78mv peak. input multiplexer the input multiplexer sequentially applies the input signals from the analog input pins to the input of the adc. one complete sampling sequence is called a multiplexer frame. the ibp-ibn differential input may be used to sense the neutral current, and vb may be optionally used to sense a second voltage channel.this configuration implies that the multiplexer applies a total of four inputs to the adc. for this configuration, the multiplexer sequence is as shown in figure 2 . in this configuration iap-ian, ibp-ibn, va and vb are sampled. the physical current sensor for the neutral current measurement and the voltage sensor for vb may be omitted if not required. max71020 single-chip electricity meter afe maxim integrated 11 table 1. adc input configuration figure 2. states in a multiplexer frame for a standard single-phase application with tamper sen - sor in the neutral path, two current inputs are configured for differential mode, using the pin pairs iap-ian and ibp- ibn. the max71020 uses two locally connected current sensors via iap-ian and ibp-ibn for this configuration. the va pin is typically connected to the phase voltage via resistor-dividers. the max71020 adds the ability to sample a second phase voltage (applied at the vb pin), which makes it suitable for meters with two voltage and two current sen - sors, such as meters implementing equation 2 for dual- phase operation (p = va x ia + vb x ib). table 1 summarizes the afe input configuration. delay compensation when measuring the energy of a phase (i.e., wh and varh) in a service, the voltage and current for that phase must be sampled at the same instant. otherwise, the phase difference, , introduces errors. delay delay t 360 t f 360 t = = ?? where f is the frequency of the input signal, t = 1/f and t delay is the sampling delay between current and voltage. traditionally, sampling is accomplished by using two adcs per phase (one for voltage and the other one for current) controlled to sample simultaneously. maxim integrateds single converter technology?, however, exploits the 32-bit signal processing capability of its ce to implement constant delay allpass filters. the allpass filter corrects for the conversion time difference between the voltage and the corresponding current samples that are obtained with a single multiplexed adc. the constant delay allpass filter provides a broadband delay 360 n - , which is precisely matched to the differ - ence in sample time between the voltage and the current of a given phase. this digital filter does not affect the amplitude of the signal, but provides a precisely con - trolled phase response. the adc multiplexer samples the current first, immedi - ately followed by sampling of the corresponding phase voltage, thus the voltage is delayed by a phase angle relative to the current. the delay compensation imple - mented in the ce aligns the voltage samples with their corresponding current samples by first delaying the cur - rent samples by one full sample interval (i.e., 360 n ), then routing the voltage samples through the allpass filter, thus delaying the voltage samples by 360 n - , resulting in the residual phase error between the current and its corre - sponding voltage of - . the residual phase error is neg - ligible, and is typically less than 0.0015 n at 100hz, thus it does not contribute to errors in the energy measurements. adc preamplifier the adc preamplifier is a low-noise differential amplifier with a fixed gain of 8.9 available on the iap and ian cur - rent-sensor input pins. it is provided only in versions of the max71020 afe configured for use with current shunts. single converter technology is a registered trademark of maxim integrated products, inc. pin comment iap the adc results are stored in register ia . ian ibp the adc results are stored in register ib . ibn va the adc result is stored in register va . vb the adc result is stored in register vb . multiplexer frame mux div = 4 conversions settle s ck32 mux state cross mux_sync 0 ia va ib vb 12 3s 0 max71020 single-chip electricity meter afe maxim integrated 12 analog-to-digital converter (adc) a single second-order delta-sigma adc digitizes the voltage and current inputs to the device. the resolution of the adc is dependent on several factors. initiation of each adc conversion is automatically con - trolled by logic internal to the max71020. at the end of each adc conversion, the fir filter output data is stored into the register determined by the multiplexer selection. fir data is stored lsb justified, but shifted left 9 bits. fir filter the finite impulse response filter is an integral part of the adc and it is optimized for use with the multiplexer. the purpose of the fir filter is to decimate the adc output to the desired resolution. at the end of each adc conver - sion, the output data is stored into the register deter - mined by the multiplexer selection. voltage references a bandgap circuit provides the reference voltage (vref) to the adc. since the vref bandgap amplifier is chop - per stabilized, the dc offset voltage, which is the most significant long-term drift mechanism in the voltage ref - erence (vref), is automatically removed by the chopper circuit. digital computation engine (ce) the ce, a dedicated 32-bit signal processor, performs the precision computations necessary to accurately mea - sure energy. the ce calculations and processes include: multiplication of each current sample with its associ - ated voltage sample to obtain the energy per sample (when multiplied with the constant sample time) frequency-insensitive delay cancellation on all four channels (to compensate for the delay between samples caused by the multiplexing scheme) 90 phase shifter (for var calculations) pulse generation monitoring of the input signal frequency (for frequency and phase information) monitoring of the input signal amplitude (for sag detection) scaling of the processed samples based on calibra - tion coefficients scaling of samples based on temperature compensa - tion information gain and phase compensation meter equations the max71020 provides hardware assistance to the ce in order to support various meter equations. this assis - tance is controlled through registers that are controlled by the ce code image. the ce firmware implements the equations listed in table 2 or a subset thereof. pulse generators the max71020 provides up to four pulse generators, vpulse, wpulse, xpulse, and ypulse, as well as hardware support for the vpulse and wpulse pulse generators. the pulse generators are used to output ce status indicators and energy usage. see table 3 . the polarity of the pulses may be inverted with control bit pls_inv. when this bit is set, the pulses are active-high, rather than the more usual active-low. pls_inv inverts all four pulse outputs. the function of each pulse generator is determined by the ce code. standard configurations of the max71020 provide a mains zero-crossing indication on xpulse and voltage sag detection on ypulse. a common use of the zero-crossing pulses is to gener - ate interrupts in order to drive rtc software in places where the mains frequency is sufficiently accurate to do so and also to adjust for crystal aging. zero-crossing can also be used to control plc modems or cut-off relays. a common use for the sag pulse is to generate an interrupt that alerts the host controller when mains power is about to fail, so that the host controller can store accumulated energy and other data to eeprom before the board sup - ply voltage drops below safe levels. table 2. inputs selected in multiplexer cycles equ description wh and varh formula element 0 element 1 0 1 element, 2w, 1 j with neutral current sense va ? ia va ? ib 1 1 element, 3-w, 1 j va(ia-ib)/2 va ? ib/2 2 2 element, 3-w va ? ia vb ? ib max71020 single-chip electricity meter afe maxim integrated 13 xpulse and ypulse pulses generated by the ce may be exported to the xpulse and ypulse pulse output pins. pins d2 and d3 are used for these pulses, respectively. the xpulse and ypulse outputs can be updated once on each pass of the ce code. see the ce interface description section for details. vpulse and wpulse by default, wpulse and vpulse are negative pulses (i.e., low level pulses, designed to sink current through an led). pls_maxwidth[7:0] determines the maximum negative pulse width t max in units of 2.458mhz clock cycles based on the pulse interval t i according to the formula: t max = (2 x pls_maxwidth[7:0] + 1) x t i t i is based on an internal value that determines the pulse interval and the adc clock, both of which are determined by the particular characteristics of the ce code. in the max71020, the default value for t i is 65.772s, but this value may change in customized versions of this device. if pls_maxwidth = 255 no pulse-width checking is per - formed, and the pulses default to 50% duty cycle. t max is typically programmed to 10ms (t max = 76), which works well with most calibration systems. the polarity of the pulses may be inverted with the control bit pls_inv. when pls_inv is set, the pulses are active- high. the default value for pls_inv is zero, which selects active-low pulses. the wpulse and vpulse pulse generator outputs are available on pins d0/wpulse and d1/vpulse, respectively. temperature sensor the max71020 includes an on-chip temperature sen - sor for determining the temperature of its bandgap reference. the primary use of the temperature data is to determine the magnitude of compensation required to offset the thermal drift in the system for the compensation of current, voltage, and energy measurement. see the metrology temperature compensation section. the temperature sensor is awakened on command from the host controller by setting the temp_start control bit. the host controller must wait for the temp_start bit to clear before reading stemp[15:0] and before setting the temp_start bit once again. the result of the temperature measurement can be read from the stemp[15:0] register. the 16-bit value is in twos complement form and ranges from -1024 to +1023 (decimal). the sensed temperature can be computed from the 16-bit stemp[15:0] reading using the following formula: temp ( n c) = 0.33 x stemp + 21.77 an additional register, vsense[7:0], senses the level of the supply voltage. table 4 shows the registers used for temperature measurement. digital i/o on reset or power-up, all dio pins are configured as high impedance. dio pins can be configured independently by the host controller by manipulating the d0, d1, d2, and d3 bit fields. table 3. pulse output function assignments output function xpulse pulse output on each zero crossing on voltage input ypulse pulse output when voltage sag detected vpulse pulse output when programmed varh consumption has occurred wpulse pulse output when programmed wh consumption has occurred max71020 single-chip electricity meter afe maxim integrated 14 spi slave port the slave spi port communicates directly with the host controller and allows it to read and write the device control registers. the interface to the slave port consists of the spi_csz, spi_clk, spi_di, and spi_do pins. the host can also reset the max71020 through the spi port by writing a data pattern to the reset register (see table 7 ). spi transactions spi transactions are configured to provide immunity to electrical noise through redundancy in the command segment and error checking in the data field. the max71020 spi transaction is exactly 64 bits; transactions of any other length are rejected. each spi transaction has the following fields (see table 5 ): a 24-bit setting packet, consisting of ? 11-bit address, msb first ? 1-bit direction (1 means read) ? 11-bit inverted address, msb first ? 1-bit inverted direction an 8-bit status, consisting of the following bits concerning the last transaction, starting from bit 7: ? parity of the status byte (0 or 1 could be correct) ? fifo overflow status bit (1 means error) ? fifo underrun status bit (1 means error) ? read or write data parity (0 or 1 could be correct) (never both read and write; address is not included in the parity) ? address or direction mismatch error bit (1 means error) (1: error, 0 : no error) ? a bit indicating whether or not the bit count was exactly 64 (1 means error) ? out of bounds address, most likely due to spi safe bit or the memory manager (1 means error) a 32-bit packet of data, msb first if extra clocks are provided at the end during a read, all zero is output and the status continues to be updated, signaling an error. if extra clocks are provided at the end during a write, the write is aborted and the status is updated to signal an error. none of the fields above are optional. if an error is detected during the address or direction phase, no action is taken. spi_do is high-z while spi_csz is high. spi safe mode is supported, and spi is not locked out of this bit during spi safe. a typical spi transaction is as follows. while spi_csz is high, the port is held in an initialized/reset state. during this state, spi_do is held in high-z state and all transitions on spi_clk and spi_di are ignored. when spi_csz falls, the port begins the transaction on the first rising edge of spi_clk. a transaction consists of the fields shown in table 5 . table 4. temperature measurement registers name rst wk dir description temp_per[1:0] 0 r/w sets the period between temperature measurements. temp_per time 0 manual updates (see temp_start description ) 1 every accumulation cycle 2 continuous 3 no updates temp_start 0 r/w temp_per[1:0] must be zero in order for temp_start to function. if temp_ per[1:0] = 0, then setting temp_start starts a temperature measurement. hardware clears temp_start when the temperature measurement is complete. the host controller must wait for temp_start to clear before reading stemp[10:0] and before setting temp_start again. stemp[15:0] r the result of the temperature measurement. vsense[7:0] r the result of the temperature measurement (see the formula listed in the electrical characteristics table). max71020 single-chip electricity meter afe maxim integrated 15 note that the status byte indicates the status of the previ - ous spi transaction except for the status byte parity. spi safe mode sometimes it is desirable to prevent the spi interface from writing to arbitrary registers and possibly disturbing the ce operation. for this reason, the spi_safe mode was created. in this mode, all spi writes are disabled except to the word containing the spi_safe bit. this affords the host one more layer of protection from inadvertent writes. functional description theory of operation the energy delivered by a power source into a load can be expressed as: t 0 e v(t)i(t)dt = assuming phase angles are constant, the following for - mulae apply: p = real energy [wh] = v x a x cos x t q = reactive energy [varh] = v x a x sin x t s = apparent energy [vah] = 22 pq + for a practical meter, not only voltage and current ampli - tudes, but also phase angles and harmonic content may constantly change. thus, simple rms measurements are inherently inaccurate. a modern solid-state electricity meter ic such as the max71020 functions by emulating the integral operation above, i.e., it processes current and voltage samples through an adc at a constant fre - quency. as long as the adc resolution is high enough and the sample frequency is beyond the harmonic range of interest, the current and voltage samples, multiplied with the time period of sampling yield an accurate quan - tity for the momentary energy. summing the instanta - neous energy quantities over time provides very accurate results for accumulated energy. table 5. spi transaction (64 bits) figure 3. spi slave porttypical read and write operations 24-bit setting field 8-bit status 32-bit data address dir inv address inv dir status from previous transaction: status[7:0] data addr[10:0] rd addr_b[10:0] rd_b status parity fifo overrun fifo underrun data parity setting mismatch reserved bad ck cnt bad address data[31:0] serial read 11-bit address 0 a10 a9 a1 a0 a10 rd 10 11 22 23 24 31 32 47 48 63 01 01 12 22 32 43 13 24 74 86 3 d0 d1 d13 d14 d15 d16 d30 d31 st0 st6 st7 x 11-bit inverted address status byted ata [addr] rd (from host) spi_csz (from host) spi_clk (from host) spi_di (from am48) spi_do (from am48) spi_do (from host) spi_csz (from host) spi_clk (from host) spi_di serial write rd 11-bit address 11-bit inverted address status byted ata [addr] rd rd a9 a0 rd a10 a9 a1 a0 hi-z hi-z a10 rd d31 st7s t6 st0 d30 d16 d15 d14 d13 d1 d0 x x a9 a0 rd max71020 single-chip electricity meter afe maxim integrated 16 figure 4 shows the shapes of v(t), i(t), the instantaneous power and the accumulated energy resulting from 50 samples of the voltage and current signals over a period of 20ms. the application of 240v ac and 100a results in an accumulation of 480ws (= 0.133wh) over the 20ms period, as indicated by the accumulated power curve. the described sampling method works reliably, even in the presence of dynamic phase shift and harmonic distortion. after a sufficient number (typically 2520) of multiplexer frames have been collected, the max71020 issues an interrupt to the host using the intz pin, signalling that new energy values are available. fault and reset behavior events at power-down power fault detection is performed by internal com - parators that monitor the voltage at the v 3p3a pin and also monitor the internally generated v dd pin voltage (1.8v dc). v 3p3sys and v 3p3a must be connected together at the pcb level so that the comparators, which are internally connected only to the v 3p3a pin, are able to simultaneously monitor the common v 3p3sys and v 3p3a voltage. the following discussion assumes that v 3p3a and v 3p3sys are connected together at the pcb level. during a power failure, as v 3p3a falls, two thresholds are detected. the first threshold, at 3.0v, warns the host con - troller that the analog modules are no longer accurate. the second threshold, at 2.8v, warns the host controller that a serious reduction in supply voltage has occurred and that the reliability of otp reads may be affected. reset sequence the max71020 does not provide automatic reset genera - tion. the reset needs to be generated by the host con - troller or by external circuitry connected to the resetz pin. when the max71020 receives a reset signal, either from the resetz pin or from the spi (using a write to the reset register at address 0x322), it asynchronously halts what it was doing. it then clears the ram and invokes the load engine (le). the le initializes ram and hardware control registers from the ce code image that is stored in otp memory. only ram cells and hardware registers that need not change dynamically are loaded. all other ram cells and registers have to be loaded by the host controller. the le automatically refreshes the values of the registers it is tasked with loading during the operation of the max71020. this refresh happens in increments of one register at a time and at a rate of one register per second. an errant reset can occur during emi events. if this hap - pens, the host controller is notified. this is accomplished by the holding the intz pin low until the host clears the event (the f_reset bit in the m_stat register is set to indicate that a reset has occurred). applications information sensor connection figure 5 to figure 8 show voltage-sensing resistive dividers, current-sensing current transformers (cts) and current-sensing resistive shunts and their proper connec - tion to the voltage and current inputs of the max71020. all input signals to the max71020 sensor inputs are volt - age signals providing a scaled representation of either a sensed voltage or current. figure 4. voltage, current, momentary and accumulated energy table 6. vstat[1:0] vstat[1:0] description 00 system power-ok. v v3p3a > 3.0v. analog modules are functional and accurate. 01 system power is low. 2.8v < v v3p3a < 3.0v. analog modules not accurate. 11 system power below 2.8v. ability to monitor power is about to fail. 15 10 5 -400 -300 -200 -100 0 100 200 300 400 500 -500 02 0 current [a] voltage [v] energy per interval [ws] accumulated energy [ws] max71020 single-chip electricity meter afe maxim integrated 17 figure 5. resistive voltage-divider (voltage sensing) figure 7. ct with differential input connection (current sensing) figure 6. ct with single-ended input connection (current sensing) figure 8. differential resistive shunt connections (current sensing) r in v in r out va gnda i in r burden v out iap gnda ct 1:n i out i in r burden v out iap ian ct 1:n bias network and noise filter gnda i out r shunt v out iap ian bias network and noise filter gnda max71020 single-chip electricity meter afe maxim integrated 18 figure 9. connecting the max71020 the analog input pins of the max71020 are designed for sensors with low source imped - ance. rc filters with resistance or capacitance values higher than those implemented in the demo boards must not be used. refer to the demo board schematics for complete sensor input circuits and cor - responding component values. maxim integrated does not recommend the use of ferrites directly at the analog signal input. connecting the max71020 figure 9 shows a typical max71020 configuration. the iap-ian current channel may be directly connected to either a shunt resistor or a ct, while the ibp-ibn chan - nel is connected to a ct and is therefore isolated. this configuration implements a single-phase measurement with tamper-detection using one current sensor to mea - sure the neutral current. this configuration can also be used to create a split phase meter (e.g., ansi form 2s). iap va ibp xin oscillator/p ll xout 9.8304mhz gnda gndd line neutral load mux and adc compute engine power-fault comparator regulator ct power supply temperature sensor v ref ram neutral ian ibn ypulse spi interface host shunt ct or line vb resetz intz v 3p3a v 3p3sys max71020 resistor- divider line note: this system is referenced to line voltage max71020 single-chip electricity meter afe maxim integrated 19 host connections include the intz pin, the resetz pin, and an optional ypulse pin. in the host controller, the dio pin connected to intz should generate an interrupt. this interrupt signals to the host that an accumulation cycle has been completed. metrology temperature compensation voltage reference precision since the vref bandgap amplifier is chopper-stabilized the dc offset voltage, which is the most significant long- term drift mechanism in the voltage references, is automati - cally removed by the chopper circuit. maxim integrated trims the vref voltage reference during the device manu - facturing process to ensure the best possible accuracy. the reference voltage (vref) is trimmed to a target value of 1.205v nominal. during this trimming process, the trimt[7:0] value is stored in nonvolatile fuses. trimt[7:0] is trimmed to a value that results in minimum vref variation with temperature. the trimt[7:0] value can be read by the host controller during initialization to calculate parabolic temperature compensation coefficients suitable for each individual device. the achievable temperature coefficient for vref is 40ppm/c. considering the factory calibration temperature of vref to be +22c and the industrial temperature range (-40c to +85c), the vref error at temperature extremes can be calculated as: (85c - 22c) x 40ppm/c = +2520ppm = 0.252% and (-40c - 22c) x 40ppm/c = +2480ppm = -0.248% the above calculation implies that both the voltage and the current measurements are individually subject to a theoretical maximum error of approximately 0.25%. when the voltage sample and current sample are multi - plied together to obtain the energy per multiplexer frame, the voltage error and current error combine resulting in approximately 0.5% maximum energy measurement error. however, this theoretical 0.5% error considers only the voltage reference (vref) as an error source. in practice, other error sources exist in the system. the principal remaining error sources are the current sensors (shunts or cts) and their corresponding signal condition - ing circuits, and the resistor voltage-divider used to mea - sure the voltage. the max71020 0.5% grade devices should be used in class 1% designs, allowing sufficient margin for the other error sources in the system. mechanism the max71020s ce code performs temperature com - pensation for the metrology when the ext_temp bit in the ceconfig register is 0 (default setting). in the inter - nal temperature compensation mode, the ce controls the gain_adj0, gain_adj1, and gain_adj2 registers based on the temperature t found in the stemp reg - ister and on the coefficients describing the expected behavior of vref over temperature (in registers ppmc and ppmc2, and available from the ppmcate and ppmc2ate locations loaded from the otp memory after reset). the formula applied for the gain adjust settings is: ?? =++ 2 14 23 ppmc t ppmc2 t gain_adj 16385 22 this operation mode compensates for the expected variations of vref over temperature. in this operation mode, system factors still influence the meters accu - racy over temperature. these factors include the current sensors, their signal conditioning circuits, and the resis - tive dividers for voltage. if these system factors can be characterized, the resulting behavior of the system over temperature can be compensated with new values for ppm and ppmc2 that are a combination of the vref characteristics (as stored in ppmcate and ppmcate2) and the sensor temperature characteristics. if a linear and quadratic compensation is sufficient, the host can load the new compensation values into the ppmc and ppmc2 registers and have the ce code operate in inter - nal temperature compensation mode. note: if the host does not set up ppmc and ppmc2, it can void the accuracy of the max71020. the minimum setup is to copy ppmcate to ppmc and ppmc2ate to ppmc2. this sets up the standard digital tempera - ture compensation for vref. if compensation with cubic and higher coefficients is required, the calculation of the necessary gain_adj values should be implemented in the host. in this case, the host should set the ext_temp bit in the ceconfig register to 1 and control the gain_adj registers directly. it is possible to apply individual compensation schemes for the voltage (gain_adj0) and current (gain_adj1, gainadj2) channels. max71020 single-chip electricity meter afe maxim integrated 20 host controller interface register map table 7. register map crystal oscillator the oscillator drives an at cut microprocessor crystal at a frequency of 9.8304mhz. board layouts with minimum capacitance from xin to xout require less current. good layouts have xin and xout shielded from each other and from digital signals. since the oscillator is self-biasing, an external resistor must not be connected across the crystal. meter calibration once the max71020 energy meter device has been installed in a meter system, it must be calibrated. a com - plete calibration includes the following: establishment of the reference temperature (e.g., typi - cally 22 n c). calibration of the metrology section, i.e., calibration for tolerances of the current sensors, voltage-dividers, and signal conditioning components as well as of the internal reference voltage (vref) at the reference temperature (e.g., typically 22 n c). the metrology section can be calibrated using the gain and phase adjustment factors accessible to the ce. the gain adjust ment is used to compensate for tolerances of components used for signal conditioning, especially the resistive components. phase adjustment is provided to compensate for phase shifts introduced by the current sensors or by the effects of reactive power supplies. the max71020 supports common industry-standard cali - bration techniques, such as single-point (energy-only) and multipoint (energy, v rms , i rms ). the load engine seeds some ce and hardware control registers with default values required for proper opera - tion of the ce code, but not the calibration registers (cal_ia, cal_va, etc., and phadj_a and phadj_b) and a variety of other registers that need to change dynamically. the default values shown in table 7 apply to ideal sensors and an ideal trim value of vref. calibration yields non-default values for the calibration registers. storage of the calibration registers should be implemented in the host, and on power-up or after reset, the host must write the stored values into the calibra - tion registers of the max71020. if the meter constant or any other of the parameters listed in table 7 had been changed from default, the host must also update these values on power-up and after reset. table 7 lists in the column loaded by the source that is used to seed the value. host means that the host controller is responsible for loading the value into the ce ram upon reset or power-up. the host must ensure that the registers labeled host are maintained, preserved, and checked whenever the max71020 reports a reset or supply power event in its m_stat register. le means that the load engine provides the data for the register. the registers labeled r in the r/w column need not be seeded with values ( in loaded by column). name byte address r/w default value description loaded by cal_i0 0x010 r/w 0x0000 4000 calibration coefficient for current channel a. default = unity gain host cal_v0 0x011 r/w 0x0000 4000 calibration coefficient for voltage channel a. host phadj_0 0x012 r/w 0x0000 0000 phase adjust coefficient for channel a. default = no phase adjust. host cal_i1 0x013 r/w 0x0000 4000 calibration coefficient for current channel b. host cal_v1 0x014 r/w 0x0000 4000 calibration coefficient for voltage channel b. host phadj_1 0x015 r/w 0x0000 0000 phase adjust coefficient for channel b. host degscale 0x01a r/w 0x0000 6a8f internal constant le max71020 single-chip electricity meter afe maxim integrated 21 table 7. register map (continued) name byte address r/w default value description loaded by ppmc 0x01b r/w 0x0000 0000 linear coefficient for temperature compensation. a default coefficient can be established by copying ppmcate into ppmc. host ppmc2 0x01c r/w 0x0000 0000 quadratic coefficient for temperature compensation. a default coefficient can be obtained by copying ppmc2ate into ppmc2. host ppmcate 0x01d r/w varies linear coefficient for temperature compensation from ate le ppmc2ate 0x01e r/w varies quadratic coefficient for temperature compensation from ate le ceconfig 0x020 r/w 0x0030 3301 configuration register for ce operation host bit name description 0 pulse_slow reduces pulse output rate by a factor of 64. must not be used with pulse_fast. 1 pulse_fast increases pulse output rate by a factor of 16. must not be used with pulse_slow. 7:2 reserved 19:8 sag_cnt number of consecutive samples below sag_thr before sag event is declared. 20 sag_int enables sag detect output on ypulse 21 edge_int enables zero-crossing output on xpulse 22 ext_temp external control of gain_ adjn if set 23 pulse_select selector for wh and varh pulse generators (0 = phase a, 1 = phase b) 24 creep 1 if meter is in creep mode wrate 0x021 r/w 0x0000 441e sets the meter constant for pulse outputs. see the pulse generation section. host kvar 0x022 r/w 0x0000 192c internal scaling factor for varh measurements. le sum_pre 0x023 r/w 0x0000 09d8 = 2520. for information only. this location is not used by the code. host sag_thr 0x024 r/w 0x016d 2490 voltage threshold for sag warnings. see the ce status and control section host quant_v0 0x025 r/w 0x0000 0000 truncation/noise compensation for voltage in phase a host max71020 single-chip electricity meter afe maxim integrated 22 table 7. register map (continued) name byte address r/w default value description loaded by quant_i0 0x026 r/w 0x0000 0000 truncation/noise compensation for current in phase a host quant_0 0x027 r/w 0x0000 0000 truncation/noise compensation for real power in phase a host quant_var0 0x028 r/w 0x0000 0000 truncation/noise compensation for reactive power in phase a host quant_v0 0x029 r/w 0x0000 0000 truncation/noise compensation for voltage in phase b host quant_i0 0x02a r/w 0x0000 0000 truncation/noise compensation for current in phase b host quant_0 0x02b r/w 0x0000 0000 truncation/noise compensation for real power in phase b host quant_var0 0x02c r/w 0x0000 0000 truncation/noise compensation for reactive power in phase b host temp22 0x03c r/w 0x0000 024d temperature reading at 22 n c. used to calculate temperature deviation from 22 n c host gainadj_0 0x040 r/w 0x0000 4000 adjusts the amplitude for voltage inputs va and vb for temperature compensation. default = unity gain. host gainadj_1 0x041 r/w 0x0000 4000 adjusts the amplitude for current input ia. default = unity gain. host gainadj_2 0x042 r/w 0x0000 4000 adjusts the amplitude for current input ib. default = unity gain. host apulsew 0x044 r wpulse_ctr 0x045 r pulse counter for wh (real power) wpulse_frac 0x046 r pulse generator numerator for wh (real power) wsum_accum 0x047 r pulse generator rollover accumulator for wh (real power) avpulser 0x048 r vpulse_ctr 0x049 r pulse counter for wh (real power) vpulse_frac 0x04a r pulse generator numerator for wh (real power) vsum_accum 0x04b r pulse generator rollover accumulator for wh (real power) 0x04c0x07f used by ce for internal variables cestatus 0x080 r status of the compute engine bit description 0 sag status for voltage phase a. automatically clears when the voltage rises above sag_thr. 1 sag status for voltage phase b. automatically clears when the voltage rises above sag_thr. 2 3 square wave at exact line frequency 31:4 temp_x 0x081 r temperature deviation from temp22 freq_x 0x082 r fundamental line frequency in units of (2520.6 x 2 -32 ) hz mainedge_x 0x083 r number of voltage zero crossings of either direction during the previous accumulation interval max71020 single-chip electricity meter afe maxim integrated 23 table 7. register map (continued) table 8. hardware control register map * default values given for standard ce code (2520 sample frequency, gain = 9). name byte address r/w default value description loaded by wsum_x 0x084 r signed sum of real energy (wh) from both wattmeter elements for the previous accumulation interval w0sum_x 0x085 r signed sum of real energy (wh) from wattmeter element a w1sum_x 0x086 r signed sum of real energy (wh) from wattmeter element b varsum_x 0x088 r signed sum of reactive energy (varh) from both wattmeter elements for the previous accumulation interval var0sum_x 0x089 r signed sum of reactive energy (varh) from wattmeter element a var1sum_x 0x08a r signed sum of reactive energy (varh) from wattmeter element b i0sqsum_x 0x08c r sum of squared samples from current sensor in phase a i1sqsum_x 0x08d r sum of squared samples from current sensor in phase b v0sqsum_x 0x090 r sum of squared samples from voltage sensor in phase a v1sqsum_x 0x091 r sum of squared samples from voltage sensor in phase b i0sqres_x 0x096 r residual current from current sensor in phase a i1sqres_x 0x097 r residual current from current sensor in phase a i0_raw 0x100 r most recent result of adc conversion for current phase a v0_raw 0x101 r most recent result of adc conversion for voltage phase a i1_raw 0x102 r most recent result of adc conversion for current phase b v1_raw 0x103 r most recent result of adc conversion for voltage phase a name byte address r/w default value* description deviceid 0x301 r 0x0000 1100 contains identifying information for the device. loaded by the le. bit name description 7:0 reserved 15:8 version version index. currently, 0x12 is defined as die type a0b. 31:16 chip_id family tag and feature tag of the device, currently 0x1001. family/feature tag ce code 1000 blank otp 1001 2520 code 1002 5k code stemp 0x30a r result of the temperature measurement. only bits 26:16 are significant; all other bits return zero. vsense 0x30b r result of the device v v3p3sys measurement. only bits 23:16 are significant; all other bits return zero. max71020 single-chip electricity meter afe maxim integrated 24 table 8. hardware control register map (continued) * default values given for standard ce code (2520 sample frequency, gain = 9). name byte address r/w default value* description iocfg 0x30c r/w 0x0000 0f00 contains the characteristics of the four digital i/o pins. bit name description 0 di0 reflects logic state on dio0 1 di1 reflects logic state on dio1 2 di2 reflects logic state on dio2 3 di3 reflects logic state on dio3 7:4 reserved 8 d_od0 configures dio0 as open drain if configured as output 9 d_od1 configures dio1 as open drain if configured as output 10 d_od2 configures dio2 as open drain if configured as output 11 d_od3 configures dio3 as open drain if configured as output 15:12 reserved 17:16 do configures dio0. 00: high-z 01: wpulse 10: logic 1 11: logic 0 19:18 d1 configures dio1. 00: high-z 01: vpulse 10: logic 1 11: logic 0 21:20 d2 configures dio2. 00: high-z 01: xpulse 10: xfer_busy 11: logic 0 23:22 d3 configures dio3. 00: high-z 01: ypulse 10: ce_busy 11: logic 31:24 reserved meter_cfg 0x30d r/w 0xff00 0080 configures hardware aspects of the afe. bit name description 14:0 reserved 15 pls_inv force meter pulses to be positive-going rather than negative-going 23:16 reserved 31:24 pls_maxwid determines the maximum width of a meter pulse max71020 single-chip electricity meter afe maxim integrated 25 table 8. hardware control register map (continued) * default values given for standard ce code (2520 sample frequency, gain = 9). name byte address r/w default value* description int_cfg 0x30f r/w 0x0000 8000 interrupt configuration register: configure the behavior of the intz pin. bit name description 0 ie_wpulse enables an interrupt to occur on the leading edge of wpulse 1 ie_vpulse enables an interrupt to occur on the leading edge of vpulse 2 ie_ypulse enables an interrupt to occur on the leading edge of ypulse 3 ie_xpulse enables an interrupt to occur on the leading edge of xpulse 4 ie_xdata enables an interrupt to occur at the conclusion of the accumulation interval, indicating that fresh data is available 5 ie_cebusy enables an interrupt to occur when the ce cycles is complete 6 reserved 7 ie_vstat enables an interrupt to occur when the vsys status changes 11:8 int_pol interrupt polarity for the pulse edges. the default polarity is falling edge. int_pol[3]=1: interrupt on rising edge of ypulse int_pol[2]=1: interrupt on rising edge of xpulse int_pol[1]=1: interrupt on rising edge of vpulse int_pol[0]=1: interrupt on rising edge of wpulse 14:12 reserved 15 d_odintz enable open-drain on the intz output. by default, the pin is configured as a cmos totem-pole output. 31:16 reserved max71020 single-chip electricity meter afe maxim integrated 26 table 8. hardware control register map (continued) * default values given for standard ce code (2520 sample frequency, gain = 9). name byte address r/w default value* description m_stat 0x310 r 0x0100 0100 reflects the status of several asynchronous events in the afe. bits are automatically cleared after the host controller reads m_stat. bit name description 0 f_wpulse set on start of wpulse 1 f_vpulse set on start of vpulse 2 f_xpulse set on start of xpulse 3 f_ypulse set on start of ypulse 4 f_xdata set when data available 5 f_cebusy set at end of ce code pass 6 reserved 7 f_vstat set when vsys status changes 8 f_reset set following afe reset 15:9 reserved 16 f_wpulse copy of bit 0 17 f_vpulse copy of bit 1 18 f_xpulse copy of bit 2 19 f_ypulse copy of bit 3 20 f_xdata copy of bit 4 21 f_cebusy copy of bit 5 23:22 reserved 24 f_reset copy of bit 8 31:25 reserved m_stat_b 0x311 r 0x0000 0000 backup of m_stat C updated when m_stat is read. if m_stat_b is different from m_stat, it signals to the host that something has changed (status change detect). bit name description 0 fb_wpulse set on start of wpulse 1 fb_vpulse set on start of vpulse 2 fb_xpulse set on start of xpulse 3 fb_ypulse set on start of ypulse 4 fb_xdata set when data available 5 fb_cebusy set at end of ce code pass 7:6 reserved 8 fb_reset set following afe reset 15:9 reserved 16 fb_wpulse copy of bit 0 17 fb_vpulse copy of bit 1 18 fb_xpulse copy of bit 2 19 fb_ypulse copy of bit 3 20 fb_xdata copy of bit 4 21 fb_cebusy copy of bit 5 23:22 reserved 24 fb_reset copy of bit 8 31:25 reserved max71020 single-chip electricity meter afe maxim integrated 27 table 8. hardware control register map (continued) * default values given for standard ce code (2520 sample frequency, gain = 9). ce interface description the ce reads the adc and stores its results in the 1kb block at 0x000. since all ce operations are 32 bits wide, the ce data memory occupies the first 256 32-bit loca - tions, from 0x000 to 0x0ff. note: the ce interface described in the data sheet is a description of the released ce code. contact your rep - resentative or maxim integrated technical support for the latest information on alternate ce codes. ce data format all ce words are 4 bytes. unless specified otherwise, they are in 32-bit twos complement format (-1 = 0xffffffff). calibration para meters are copied to ce data memory by the host controller before enabling the ce. internal vari - ables are used in internal ce calculations. input variables allow the mpu to control the behavior of the ce code. name byte address r/w default value* description vstat 0x312 r afe supply voltage status. bits 1:0 reflect system power status: 00: system power-ok: v v3p3a > 3.0v 01: system power-low: 2.8v < v v3p3a < 3.0v 11: system power-fail: v v3p3a < 2.8v reset 0x322 wo write 0x8100 0000 to this register to reset the afe. temp_cnf 0x323 r/w 0x0000 0000 configures aspects of the temperature measurement subsystem. loaded by the le. bit name description 1:0 reserved 3:2 temp_per sets the period between temperature measurements. 01: measure every accumulation cycle 10: continuous measurement other values disable automatic updates. 4 temp_sys when set, v v3p3sys is measured at every temperature measurement cycle 31:5 reserved temp_start 0x324 r/w 0x0000 0000 write 0x8000 0000 to start a temperature conversion cycle. when conversion is complete, the afe clears bit 31 and returns the register to zero. spi_safe 0x325 r/w 0x0000 0000 write 0x8000 0000 to this word to lock the spi port. when the spi port is locked, no read or write operations are possible except to the spi_safe register. clearing this register to zero disables the spi lock and restores normal operation. meter_en 0x326 r/w 0x0000 0000 enables aspects of the afe. bit name description 0 adc_e enable adc and vref buffer. must be set by host following initialization. 1 ce_e enable ce. must be set by host following initialization. 31:2 reserved max71020 single-chip electricity meter afe maxim integrated 28 table 9. ce equ equations and element input mapping * not supported by standard ce codes. table 10. ce raw data access locations constants constants used in the ce data memory tables are: u f 0 is the fundamental frequency of the mains phases. u i max is the external rms current corresponding to the maximum allowed voltage on the current inputs. for the ib input, this is 250mv peak (176.8mv rms ). in the max71020, ia normally has a preamplifier enabled on the ia inputs, so i max needs to be adjusted to 27.78mv peak (19.64mv rms ) for the iap-ian inputs. for a 250? shunt resistor, i max becomes 78a (19.64mv rms /250? = 78.57a) for ia, and 707a (176.8mv rms /250? = 707.2a rms ) for ib. u v max is the external rms voltage corresponding to 250mv peak at the va and vb inputs. u n acc , the accumulation count for energy measure - ments (typically 2520). u the duration of the accumulation interval for energy measurements is n acc /f s = 2520/2,520.6 1s. u x is a gain constant of the pulse generators. its value is determined by pulse_fast and pulse_slow. u voltage lsb (for sag threshold) = v max x 7.879810 - 9v. the system constants i max and v max are used by the host controller to convert internal digital quantities (as used by the ce) to external, real-world metering quantities. their values are determined by the scaling of the voltage and current sensors used in an actual meter. the lsb values used in this document relate digital quantities at the ce or mpu interface to external meter input quantities. for example, if a sag threshold of 80v rms is desired at the meter input, the digital value that should be programmed into sag_thr (register 0x024) would be 80v rms x sqrt(2)/sag_thr lsb , where sag_thr lsb is the lsb value in the description of sag_thr (see table 12 ). environment default settings are assumed to be v max = 600v, i max = 707a, and kh = 1. ce calculations in table 9 , the load engine selects the desired equation by writing to the meter_cfg register. ce front-end data (raw data) access to the raw data provided by the afe is possible by reading registers 0x100C0x003 as shown in table 10 . ce status and control the ce status word, cestatus, is useful for generating early warnings to the host controller ( table 7 ). it con - tains sag warnings for phase a and b, as well as f0, the derived clock operating at the line fre quency. the host controller can read the ce status word at every ce_busy interrupt. cestatus provides information about the status of volt - age and input ac signal frequency, which are useful for generating an early power-fail warning to initiate neces - sary data storage. cestatus represents the status flags for the preceding ce code pass (ce_busy interrupt). the significance of the bits in cestatus is shown in table 7 . the ce is initialized by the host controller using ceconfig ( table 7 ). this register contains the sag_cnt, pulse_slow, and pulse_fast fields. the ceconfig bit definitions are given in table 7 . when the sag_int bit (register 0x020[20]) is set to 1, a sag event generates equ watt and var formula (wsum/varsum) inputs used for energy/current calculation w0sum/ var0sum w1sum/ var1sum i0sq sum i1sq sum 0 va ia C 1 element, 2w 1 va x ia va x ib ia 1* va x (ia-ib)/2 C 1 element, 3w 1 va x (ia-ib)/2 ia-ib ib 2* va x ia + vb x ibC 2 element, 3w 1 va x ia vb x ib ia ib pin register ia 0x100 va 0x101 ib 0x102 vb 0x103 max71020 single-chip electricity meter afe maxim integrated 29 table 11. cestatus register table 12. sag threshold and gain adjust control a transition on the ypulse output. the ce controls the pulse rate based on wsum_x (register 0x084) and varsum_x (register 0x088). ce transfer variables when the host controller receives the intz interrupt, it knows that fresh data is available in the transfer vari - ables. they remain constant throughout each accumula - tion interval. in this data sheet, the names of ce transfer variables always end with _x. the transfer variables can be categorized as: u fundamental energy measurement variables u instantaneous (rms) values u other measurement parameters fundamental energy measurement variables table 13 describes each transfer variable for fundamen - tal energy measurement. all variables are signed 32-bit integers. accumulated variables such as wsum are internally scaled so that internal values are no more than 50% of the full-scale range when the integration time is table 13. ce transfer variables ce address name description 0x80 cestatus see the description of cestatus bits in table 7 ce address name default description 0x24 sag_thr 2.39 x 10 7 the voltage threshold for sag warnings. the default value is equivalent to 113vpk or 80v rms if v max = 600v rms . ? = rms 9 max v2 v 7.8798 10 0x40 gain_adj0 16384 this register scales the voltage measurement channels va and vb. the default value of 16384 is equivalent to unity gain (1.000). 0x41 gain_adj1 16384 this register scales the ia current channel for phase a. the default value of 16384 is equivalent to unity gain (1.000). 0x42 gain_adj2 16384 this register scales the ib current channel for phase b. the default value of 16384 is equivalent to unity gain (1.000). ce address name description 0x84 wsum_x the signed sum: w0sum_x + w1sum_x. not used for equ[2:0] = 0 (register 0x30d[14:12]) and equ[2:0] = 1. 0x85 w0sum_x the sum of wh samples from each wattmeter element. lsb w = 6.08040 x 10 -13 x v max x i max wh 0x86 w1sum_x 0x88 varsum_x the signed sum: var0sum_x + var1sum_x. not used for equ[2:0] = 0 and equ[2:0] = 1. 0x89 var0sum_x the sum of varh samples from each wattmeter element. lsb w = 6.08040 x 10 -13 x v max x i max varh 0x8a var1sum_x max71020 single-chip electricity meter afe maxim integrated 30 one second. additionally, the hardware does not permit output values to fold back upon overflow. wsum_x (register 0x084) and varsum_x (register 0x088) are the signed sum of phase-a and phase-b wh or varh values according to the metering equation implemented by the ce code. wxsum_x (x = 0 or 1, registers 0x085 and 0x086) is the watt-hour value accu - mulated for phase x in the last accumulation interval and can be computed based on the specified lsb value. instantaneous energy measurement variables i_sqsum_x and v_sqsum (see table 14 ) are the sum of the squared current and voltage samples acquired during the last accumulation interval. the rms values can be computed by the host controller from the squared current and voltage samples as follows: i rms acc i n = other v rms acc v n = other transfer variables include those available for frequency and those reflecting the count of the zero- crossings of the mains voltage. these transfer variables are listed in table 15 . mainedge_x (register 0x083) reflects the number of half-cycles accounted for in the last accumulated interval for the voltage signal. mainedge_x is useful for imple - menting a real-time clock based on the input ac signal. pulse generation table 16 describes the ce pulse generation parameters. the combination of the ceconfig:pulse_slow and ceconfig:pulse_fast bits (register 0x020[0:1]) con - trols the speed of the pulse generator. the default zero values of these configuration bits maintain the original pulse rate given by the kh equation, described below. wrate (register 0x021) controls the number of pulses that are generated per measured wh and varh. the lower wrate is, the slower the pulse rate for the mea - sured energy quantity; or conversely, the greater the measured energy per pulse. by default, the pulse gener - ators take their input from the w0sum_x (register 0x085) and var0sum_x (register 0x089) result registers. table 15. other transfer variables table 14. ce energy measurement variables ce address name description configuration 0x8c i0sqsum_x the sum of squared current samples from each element. lsb i = 6.08040 x 10 -13 imax 2 a 2 h when equ = 1, i0sqsum_x is based on ia and ib. figure 8 0x8d i1sqsum_x 0x90 v0sqsum_x the sum of squared voltage samples from each element. lsb v = 6.08040 x 10 -13 vmax 2 v 2 h 0x91 ? v1sqsum_x ce address name description 0x82 freq_x fundamental frequency: 0x83 mainedge_x the number of edge crossings of the selected voltage in the previous accumulation interval. edge crossings are either direction and are debounced. -6 32 2520.6hz lsb 0.509 10 2 ? max71020 single-chip electricity meter afe maxim integrated 31 the meter constant kh is derived from wrate and rep - resents the amount of energy measured for each pulse. if kh = 1wh/pulse and 120v and 30a is applied in-phase to the meter, the meter will produce one pulse per second (120v and 30a results in a load of 3600w, or put another way, energy consumption of one watt-hour per second). if the load is 240v at 150a, 10 pulses per second are generated. to compute the wrate value, see table 16 . the maximum pulse rate is 7.56khz. see the vpulse and wpulse section for details on how to adjust the timing of the output pulses. the maximum time jitter is 1/6 of the multiplexer cycle period (nomi - nally 67s) and is independent of the number of pulses measured. thus, if the pulse generator is monitored for one second, the peak jitter is 67ppm. after 10s, the peak jitter is 6.7ppm. the average jitter is always zero. if it is attempted to drive either pulse generator faster than its maximum rate, it simply outputs at its maximum rate without exhibiting any rollover characteristics. the actual pulse rate, using wsum as an example, is: s 46 wrate wsum f x rate hz 2 = where f s = sampling frequency (2520.6hz), x = pulse speed factor derived from the ce variables pulse_slow (register 0x020[0]) and pulse_fast (register 0x020[1]). other ce parameters table 17 shows the ce parameters used for suppression of noise due to scaling and truncation effects. ce calibration parameters table 18 lists the parameters that are typically entered to effect calibration of meter accuracy. ce flow diagrams figure 10 to figure 12 show the data flow through the ce in simplified form. functions not shown include delay compensation, sag detection, scaling, and the process - ing of meter equations. table 16. ce pulse generation parameters ce address name default description 0x21 wrate 547 where: k = 42.7868 the default value yields 1.0 wh/pulse for v max = 600v and i max = 208a. the maximum value for wrate is 32,768 (2 15 ). 0x22 kvar 6444 scale factor for var measurement 0x45 wpulse_ctr 0 wpulse counter 0x46 wpulse_frac 0 unsigned numerator, containing a fraction of a pulse. the value in this register always counts up towards the next pulse. 0x47 wsum_accum 0 rollover accumulator for wpulse 0x49 vpulse_ctr 0 vpulse counter 0x4a vpulse_frac 0 unsigned numerator, containing a fraction of a pulse. the value in this register always counts up towards the next pulse. 0x4b vsum_accum 0 rollover accumulator for vpulse max max kv i kh wh pulse = max71020 single-chip electricity meter afe maxim integrated 32 table 17. ce parameters for noise suppression and code version table 18. ce calibration parameters ce address name default description 0x25 quant_va 0 compensation factors for truncation and noise in voltage, current, real energy, and reactive energy for phase a. 0x26 quant_ia 0 0x27 quant_a 0 0x28 quant_vara 0 0x29 quant_vb 0 compensation factors for truncation and noise in voltage, current, real energy, and reactive energy for phase b. 0x2a quant_ib 0 0x2b quant_b 0 0x2c quant_varb 0 -13 2 2 max quant_ix_lsb 3.28866 10 i (amps ) = -10 max max quant_wx_lsb 6.73518 10 v i (watts) = -10 max max quant_varx_lsb 6.73518 10 v i (vars) = ce address name default description 0x10 cal_ia 16384 these constants control the gain of their respective channels. the nominal value for each parameter is 2 14 = 16384. the gain of each channel is directly proportional to its cal parameter. thus, if the gain of a channel is 1% slow, cal should be increased by 1%. 0x11 cal_va 16384 0x13 cal_ib 16384 0x14 cal_vb 16384 0x12 phadj_a 0 these constants control the ct phase compensation. compensation does not occur when phadj_x = 0. as phadj_x is increased, more compensation (lag) is introduced. the range is 215 C 1. if it is desired to delay the current by the angle f , the equations are: 20 0.02229 tan phadj_x 2 0.1487 - 0.0131 tan f = f at 60hz 20 0.0155 tan phadj_x 2 0.1241- 0.009695 tan f = f at 50hz 0x15 phadj_b 0 max71020 single-chip electricity meter afe maxim integrated 33 figure 10. ce data flow (multiplexer and adc) figure 11. ce data flow (scaling, gain control, intermediate variables) multiplexer demultiplexer v ref i0 v0 i1 i0_raw v0_raw i1_raw dc mod decimator f clk = 2.458mhz f s = 2520hz (on each channel) offset null offset null offset null f0 generator phase comp phase comp 90 lpf lpf w0 var0 i0 v0 i0_raw v0_raw f0 f0 cal_i0 phadj_0 i1_raw f0 cal_v0 cal_i1 gain_adj lpf w1 i1 f0 lpf var1 phadj_1 max71020 single-chip electricity meter afe maxim integrated 34 package information for the latest package outline information and land patterns (foot - prints), go to www.maximintegrated.com/packages . note that a +, #, or - in the package code indicates rohs status only. package drawings may show a different suffix character, but the drawing pertains to the package regardless of rohs status. ordering information figure 12. ce data flow (squaring and summation stages) note: all devices are specified over the -40c to +105c oper - ating temperature range. + denotes a lead(pb)-free/rohs-compliant package. r = tape and reel. part accuracy (%) pin-package max71020aeui+ 0.5 28 tssop max71020aeui+r 0.5 28 tssop package type package code outline no. land pattern no. 28 tssop u28+1 21-0066 90-0171 i1 f0 i 2 square v0 v 2 i0 i 2 c sum c c iisq vosq iosq iisqsum_x vosqsum_x iosqsum_x sum_samps = 2520 w1 w0 sum c w1sum_x w0sum_x var0 c c vas0sum_x var1 c var1sum_x host registers max71020 single-chip electricity meter afe maxim integrated maxim integrated cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a maxim integrated product. no circuit patent licenses are implied. maxim integrated reserves the right to change the circuitry and specifications without notice at any time. the parametric values (min and max limits) shown in the electrical characteristics table are guaranteed. other parametric values quoted in this data sheet are provided for guidance. maxim integrated 160 rio robles, san jose, ca 95134 usa 1-408-601-1000 35 ? 2013 maxim integrated maxim integrated and the maxim integrated logo are trademarks of maxim integrated products, inc. revision history revision number revision date description pages changed 0 7/12 initial release 1 1/13 updated the electrical characteristics table, functional diagram , and table 7; replaced the reset sequence section; added a mechanism description to the metrology temperature compensation section; added new table 8; removed original tables 11, 12, and 13; updated figures 3, 5 ? 12 all max71020 single-chip electricity meter afe |
Price & Availability of MAX7102013 |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |