Reg Power and Power factor for ADE9078

Hi All,

       I have been using ADE9078 for my project. Currently we are trying to read power factor and active power, actually we connected the bulb (resistive load) to ADE9078. While reading for power factor we always getting negative value( 0xF825EB8 ), but an another energy meter equipment showing positive power factor value.

In power also we are getting wrong value after conversion but we are getting voltage and current value correctly,we following procedure given in datasheet (Page no 56) so, current and voltage we getting,power only we are facing problem. 

following code we done for initial configuration:

#define VOLTAGE_GAIN        0x00000000
#define CURRENT_GAIN       0x00000000
#define POWER_GAIN           0x00000000

#define VOLTAGE_CONVERSION_CONSTANT       75000
#define POWER_CONVERSION_CONSTANT          416667
#define CURRENT_CONVERSION_CONSTANT      74776.28

#define PF_CONSTANT                                              0.00000000745

void ADE9078_Regs_init(uint8_t slave_select)
{
uint32_t rst_done = 0;
uint8_t debug_buffer[50] = {0};
const uint32_t vLevelData = 0x117514;
const uint16_t run_data = 0x1;
const uint16_t ep_cfg_data = 0x0021;
const uint32_t config_0_data = 0x0;
const uint16_t egy_time_data = 0x0001;

spi_read_32(STATUS1_32,&rst_done,slave_select);
while(!(check_bit(rst_done,16))); //wait until 16th bit (rst_done) to set
sprintf(debug_buffer,"slave select : %x status:%x\r\n",slave_select,rst_done);
DEBUG_PRINT(debug_buffer);

spi_read_32(VLEVEL_32,&rst_done,slave_select);
sprintf(debug_buffer,"slave select : %x VLEVEL:%x\r\n",slave_select,rst_done);
DEBUG_PRINT(debug_buffer);


spi_write_32(AVGAIN_32, VOLTAGE_GAIN, slave_select);
spi_write_32(BVGAIN_32, VOLTAGE_GAIN, slave_select);
spi_write_32(CVGAIN_32, VOLTAGE_GAIN, slave_select);

spi_write_32(AIGAIN_32, CURRENT_GAIN, slave_select);
spi_write_32(BIGAIN_32, CURRENT_GAIN, slave_select);
spi_write_32(CIGAIN_32, CURRENT_GAIN, slave_select);

spi_write_32(APGAIN_32, POWER_GAIN, slave_select);
spi_write_32(BPGAIN_32, POWER_GAIN, slave_select);
spi_write_32(CPGAIN_32, POWER_GAIN, slave_select);
spi_write_16(PGA_GAIN_16, 0x0000, slave_select); // VA,VB,VC,IN,IA,IB,IC gain set to 1
spi_write_32(VLEVEL_32, vLevelData, slave_select); // select frequency as 50Hz
spi_write_32(CONFIG0_32, config_0_data, slave_select); // If current transformers are used, INTEN and ININTEN in the CONFIG0 register must = 0
spi_write_16(RUN_16, run_data, slave_select); //Write 1 to Run register
spi_write_16(EP_CFG_16, ep_cfg_data, slave_select); //Write 1 to EP_CFG register
spi_write_16(EGY_TIME_16, egy_time_data, slave_select);
DEBUG_PRINT("ADE9078_Regs_init \r\n");

}

void power_conversion(ENE_Value *temp_value,uint8_t energy_meter_sel)
{
uint32_t temp_reg_A = 0 ,temp_reg_B = 0,temp_reg_C = 0;

spi_read_32(AWATT_32,&temp_reg_A,energy_meter_sel);
spi_read_32(BWATT_32,&temp_reg_B,energy_meter_sel);
spi_read_32(CWATT_32,&temp_reg_C,energy_meter_sel);

temp_value->Phase_A_active_power = temp_reg_A / POWER_CONVERSION_CONSTANT;
temp_value->Phase_B_active_power = temp_reg_B / POWER_CONVERSION_CONSTANT;
temp_value->Phase_C_active_power = temp_reg_C / POWER_CONVERSION_CONSTANT;

}

void power_factor_conversion(ENE_Value *temp_value,uint8_t energy_meter_sel)
{
uint32_t temp_reg_A = 0 ,temp_reg_B = 0,temp_reg_C = 0;

spi_read_32(APF_32,&temp_reg_A,energy_meter_sel);
spi_read_32(BPF_32,&temp_reg_B,energy_meter_sel);
spi_read_32(CPF_32,&temp_reg_C,energy_meter_sel);

temp_value->Phase_A_power_factor = temp_reg_A * PF_CONSTANT;
temp_value->Phase_B_power_factor = temp_reg_B * PF_CONSTANT;
temp_value->Phase_C_power_factor = temp_reg_C * PF_CONSTANT;

Kindly give suggestions.

Regards,

Karthikeyan.S.