Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN2512 Datasheet(PDF) 29 Page - STMicroelectronics

Part # AN2512
Description  This application note describes how to design
PDF  38 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN2512 Datasheet(HTML) 29 Page - STMicroelectronics

Back Button AN2512 Datasheet HTML 25Page - STMicroelectronics AN2512 Datasheet HTML 26Page - STMicroelectronics AN2512 Datasheet HTML 27Page - STMicroelectronics AN2512 Datasheet HTML 28Page - STMicroelectronics AN2512 Datasheet HTML 29Page - STMicroelectronics AN2512 Datasheet HTML 30Page - STMicroelectronics AN2512 Datasheet HTML 31Page - STMicroelectronics AN2512 Datasheet HTML 32Page - STMicroelectronics AN2512 Datasheet HTML 33Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 29 / 38 page
background image
AN2512
Example of source code
29/38
A.4
One-Wattmeter method
This method is suitable only in three-phase four-wire balanced loads. The connection of the
wattmeter is similar to the drawing given in Figure 18. The total power is equal to three times
the reading of only one wattmeter that is connected between one phase and the neutral.
Appendix B
Example of source code
The C code below shows an example of handling energy value (either active type 0, type1,
reactive or apparent) after it has been read, unpacked and stored into register new. For
signed wide-band Active energy as an example, a pointer named e should be loaded with
&ActWB then, EnergyQuant() should be called. This function checks for rollover and
computes a quant of energy. Later, EnergyUpdate() is called. This function updates the
fractional part of integrator first (frac). If the fractional part reaches a certain limit, it is
subtracted from the fractional part and the integer part (integ) of integrator increments. The
value of the limit and the direction of subtraction and increment depends on the sign of
quant.
Some applications may have positive and negative energy integrators or quadrant
integrators for Apparent energy. All this influences an implementation of both functions. With
a proper limit value for the fractional part, one can prescribe a suitable bit weight of the
integer part of the integrator.
For example if the limit is set to 0x00140000 (with a device calibrated to provide 128000
pulses/kWh) then the lsb of the integer part represents exactly 0.01 kWh.
Below is an example of source code.
/* definition of STPM01 registers structure */
typedef struct STPM {
long int DAP[3];
long int DRP[3];
long int DSP[3];
long int DFP[3];
long int DEV[3];
long int DMV[3];
long int CFL[3];
long int CFH[3];
} STPM_Struct;
/* definition of energy integrator structure */
typedef struct energ {
long int old[4];
/* previous energy value */
int quot[4];
/* quant/16 */
int quant[4];
/* new - old, measure of power */



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com