Question
I try to connect a ADE7753 over SPI with an ATmega 168. Then I have try to read
the register for VRMS and IRMS.
When I read VRMS only, then I get stable values but when I try read also IRMS
then I get completely other values for VRMS.
The IRMS values are also very unstable. So I try only read IRMS. So I now get
completely other values then on the reading ago.
Also I have change the order of reading. One time I read first VRMS then IRMS
second time I change the order. Both times I get other values.
When I only read IRMS so I get stable values but some times I have jumps in my
values. So I get some time the value 9 and then a jump up to 17 and back to 9.
So I think I have a failure in my programme. But I have read the documentation
of the ADE7753 very carefully but I can not find my failure.
I program the ATmega over Arduino. Do you know this problems? What must I do
now. What must be note on SPI communication?
Answer
First, you should look with an oscilloscope to verify the command byte is sent
out correctly by the uC and then verify that ADE7753 truly sends out the values
your uC is receiving.
You should look at the figures 92 and 93, page 50 in rev C data sheet and make
sure the Atmel is programmed to send out data on the low to high SCLK
transition and receives data on the high to low transitions. Look at the SPI
settings that may or may not introduce half cycle delay between SCLK and MOSI
signals.
If the communication is good, reading single digit values out of IRMS register
shows that there is no voltage seen at the ADC inputs. You should apply some
voltage, then, to reduce the noise in reading the rms values, you should use
the ZX interrupt.