Hi, can someone explain for me the 2048 number in the library code. Thank you.

```void ADE9153AClass:: ReadAcalRegs(struct AcalRegs *Data)
{
uint32_t tempReg;
float tempValue;

Data->AcalAICCReg = tempReg;
tempValue = (float)tempReg / (float)2048; //Calculate Conversion Constant (CC)
Data->AICC = tempValue;
Data->AcalAICERTReg = tempReg;

Data->AcalAVCCReg = tempReg;
tempValue = (float)tempReg / (float)2048; //Calculate Conversion Constant (CC)
Data->AVCC = tempValue;
Data->AcalAVCERTReg = tempReg;
}```

## Top Replies

• MS_ACAL_AICC and MS_ACAL_AVCC register values are 32-bit and the values are in nA/code and nV/code respectively.
The division by 2048 comes from the format of those registers which are 21.11 fixed…

Parents
• Hello

MS_ACAL_AICC and MS_ACAL_AVCC register values are 32-bit and the values are in nA/code and nV/code respectively.
The division by 2048 comes from the format of those registers which are 21.11 fixed point format (see AN-1571), 2^11 = 2048. You need to take the register value and divide by 2048 to move the decimal over.

Furthermore, in the .ApplyAcal() function you can see that the AICC and AVCC values are then divided by CAL_xRMS_CC (originally in mikro-ampere and mikro-volt) that is multiplied by 1000 to bring to nA or nV to match the AICC and AVCC. The result of this calculation is the scale factor for the AIGAIN and AVGAIN. The 134217728 is the decimal number of 2(pow)27 which is the scaling of the xIGAIN and AVGAIN registers.

I hope this helps.