During the implementation, I found a missing key-feature. As proposed in the last weeks project log, I initially thought that only the calibration factors for the VRMS and IRMS calibration matter. In order to calculate the correct scaling value for the value measured by the IC, it is necessary for the user to enter the expected RMS value of either current or voltage.
To store these values, the Teensy-EEPROM will be used as well. The expected values are floating-point, so they have to be converted beforehand to an integer, that can be represented as a binary number (floating point too, but the conversion is more complicated). So I chose a fixed point format, which is used by the ACS as well. The conversion is very easy :
with the floating point number f , and the number of fractional bits bw .
This can be stored very easily in the EERPROM and provides a good accuracy of 3.9mA for an 8-bit fractional part.