Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

AN2512 Datasheet(PDF) 31 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) 31 Page - STMicroelectronics

Back Button 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 AN2512 Datasheet HTML 34Page - STMicroelectronics AN2512 Datasheet HTML 35Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 31 / 38 page
background image
AN2512
Example of source code
31/38
if (ReadSTPM01Falg
== 0){
for (i = 0; i < 3; i ++){
NewTemp = * new;
e->old[i] = NewTemp;// save the value for the first time reading
new ++; //next data
}
e->quot[0] = 0;
e->quot[1] = 0;
e->quot[2] = 0;
}
else{
e->quant[3] = 0;
for (i = 0; i <3; i++ ){
NewTemp = *new; // Rollover high to low occurs when MSB goes from F to 0
if (NewTemp >= e->old[i]){
if ((NewTemp - e->old[i]) >= 0x80000){
//roll over, negative energy
e->quant[i] = 0x100000 + e->old[i] -NewTemp;
e->quant[3] -= e->quant[i];//total ernergy minus the negative energy
}
else{
e->quant[i] = NewTemp - e->old[i];
//positive energy
e->quant[3] += e->quant[i]; //add the positive energy to the total energy
}
}
else{
if ((e->old[i] - NewTemp) >= 0x80000) { //roll over, positive energy
e->quant[i] = 0x100000 + NewTemp - e->old[i];
e->quant[3] += e->quant[i]; //total ernergy plus the positive energy
}
else{
e->quant[i] = e->old[i] - NewTemp;
//negative energy
e->quant[3] -= e->quant[i]; //total energy minus the negative energy
}
}
e->old[i] = NewTemp;// save the value for next time
new ++; //next data
}
}



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