(08.07.2019, 14:50)frank Wrote: Additionally i changed CurrentResistor to 7.5 (real value of the burden resistor on the board) and OffsetCurrent to 1.032 to get more accurate current readings.
Why 1.032? Have you measured with some calibrated meter? I think it should be 1.0, you have also xIGAIN registers for calibration, however I don't understand if these xIGAIN registers are needed at all, because you can multiply the result like it's already made, this facilatates the calibration. Perhaps they are used to maximize the accuracy of the calculated power.
But there is more, the sequence of initializing the ADE7878 is very different as manufacturer decribes it:
- Initialize the AIGAIN, BIGAIN, CIGAIN, and NIGAIN registers.
- Start the DSP by setting run = 1.
- Initialize all the other data memory RAM registers. Write the last register in the queue three times to ensure its value was written into the RAM. Initialize all of the other ADE7854/ADE7858/ADE7868/ADE7878 registers with the exception of the CFMODE register.
- Read the energy registers xWATTHR, xFWATTHR, xVARHR, xFVARHR, and xVAHR to erase their content and start energy accumulation from a known state.
- Clear Bit 9 (CF1DIS), Bit 10 (CF2DIS), and Bit 11 (CF3DIS) in the CFMODE register to enable pulses at the CF1, CF2, and CF3 pins. Do this initialization last, so no spurious pulses are generated while the ADE7854/ ADE7858/ADE7868/ADE7878 are initialized.
- Enable the write protection by writing 0xAD to an internal 8-bit register located at Address 0xE7FE, followed by a write of 0x80 to an internal 8-bit register located at Address 0xE7E3.
- Read back all data memory RAM registers to ensure they were initialized with the desired values.
- In the remote case that one or more registers are not initialized correctly, disable the protection by writing 0xAD to an internal 8-bit register located at Address 0xE7FE, followed by a write of 0x00 to an internal 8-bit register located at Address 0xE7E3. Reinitialize the registers. Write the last register in the queue three times. Enable the write protection by writing 0xAD to an internal 8-bit register located at Address 0xE7FE, followed by a write of 0x80 to an internal 8-bit register located at Address 0xE7E3
Indeed, I can confirm that xIRMSOS registers are not always writen.