I'm fairly new with energy monitoring chips, so I'm not quite sure how to setup everything correctly. I've downloaded the example code for the arduino Uno Evaluation kit and I'm trying to adapt it for our project. Instead of SPI protocol, we use RS232, and that part seems to work fine.
I'm just not really sure about the value I should put in some registers like the PGAGAIN, AIGAIN, AVGAIN... and VLEVEL. It seems like no matter what I set in those registers, the values I read form AVRMS or AIRMS for example are wrong (I got dec values from 1884307456 to 3471326976 reading VRMS register). I read the datasheet and tried different values without success.
Also, I tried to run the mSure autocalibration, but the bit "ms_sysrdyp" in register MS_STATUS_CURRENT is never set, no matter what I do.
Last thing, following the example code and the datasheet, I tried to read the temperature but the register TEMP_RSLT always stays at 0, giving me a temperature of like -1800°C after the calculations.
This is how my registers are configured right now:
// ADC GAIN
gADE9153A_Registers.ai_pgagain.bit_ai_swap = PGA_SWAP_SIGNAL_ON_IAP;
gADE9153A_Registers.ai_pgagain.bits_ai_gain = PGA_GAIN_16X; // ADC GAIN = 16x
gADE9153A_Registers.config0 = ADE9153A_DEFAULT_CONFIG0; // Default Config0 settings
gADE9153A_Registers.config1 = ADE9153A_DEFAULT_CONFIG1; // Default Config1 settings
gADE9153A_Registers.config2 = ADE9153A_DEFAULT_CONFIG2; // Default Config2 settings
gADE9153A_Registers.config3 = ADE9153A_DEFAULT_CONFIG3; // Default Config3 Settings
// LINE SETTINGS
gADE9153A_Registers.accmode.bit_selfreq = ACC_FREQ_60Hz; // Energy Accumulation Frequency = 60Hz
gADE9153A_Registers.vlevel.bits_vlevel_val = 0x002C11E8; // NOT SURE, FOUND IN EXAMPLE CODE
gADE9153A_Registers.mask = ADE9153A_DEFAULT_MASK; // Disable all interrupts (Default)
// TEMPERATURE SENSOR
gADE9153A_Registers.temp_cfg.bit_temp_start = ENABLED;
gADE9153A_Registers.temp_cfg.bits_temp_time = TEMP_SAMPLES_1; // 1 samples. New temperature measurement every 1 ms
Also, here is the schematic:
Thank you !
I forgot to link the code of what I actually write to registers:
SerialWrite_32(ADE9153A_REGISTER_VDIV_RSMALL, ADE9153A_VDIV_RSMALL); // VALUE: 0x03E8 (1k ohm)
SerialWrite_16(ADE9153A_REGISTER_COMPMODE, ADE9153A_COMPMODE); // VALUE: 0x0005
After initializing the registers, I write 0x0001 to register "RUN".
Let's find the error step by step, we can test if your communication protocol really work. You can write some data to some registers, RUN for example. Then you read it back from ADE9153, let's see if the communication is right now. Thank you very much.
i am also getting the same problem with ade9153a. in my case spi protocol is working but the chip is not giving me the expected results. please suggest the solution as soon as possible.
I can see in your schematic, you use shunt for current sensor, can you tell me how you connect the Phase wire and Neutral wire with your board? Do you have isolation circuit between ADE9153 and MCU? Thank you very much.
Please refer to my talk with JonathanC, you can also make an new thread and post your circuit schematic picture there. Thank you very much.