Post Go back to editing

ADE7978/ADE7933 Measurements always return the same value

Hello,

My circuitry consists of 3 x ADE7933 managed by one ADE7978. 

The analog frontend is set to only take measurements on the first voltage channel. 

I can communicate perfectly fine with the ADE7978, setting up the config registers and sending the run command, verifying it by reading it back.

But when it comes to read out that data-registers, I always get seemingly random numbers. 

If they only would be random, I would have thought that my circuitry is faulty, but the weird thing is, that the numbers never change. Once the PCB is powered, the data-values always stay the same, no matter what I do. 

I also read-out the Temperature-registers and they also have seemingly random numbers, which only change after rebooting everything.

I debugged the circuit with a logic analyzer, to see if the ADE7933s send out data, and they do (cant debug the bitstream though). 

TEMP: 2204099, 721760, 409376
VRMS: 254774461, -4600796, 50690243
ANGLE: 0, 0, 0

TEMP: 2204099, 721760, 409376
VRMS: 254774461, -4600796, 50690243
ANGLE: 0, 0, 0

TEMP: 2204099, 721760, 409376
VRMS: 254774461, -4600796, 50690243
ANGLE: 0, 0, 0

TEMP: 2204099, 721760, 409376
VRMS: 254774461, -4600796, 50690243
ANGLE: 0, 0, 0

1. First I initiate a hardware reset

2. Then I enable SPI communication by toggeling the CS pin 3 times

3. I read out the RSTDONE bit from STATUS1 register and wait for it to be =1

4. I write some data to PHNOLOAD register and read back LAST16 register, to verify that communication is working. I reset PHNOLOAD afterwards obviously

5. ANGLESEL bits in COMPMODE are set to 1 (getting angle from voltage channels)

6. Setting DREADY in MASK0 to generate interrupts

7. Flush the DSP register pipe by ANGLESEL two more times

8. Clearing STATUS0 and STATUS1 registers by setting all to 1

9. Writing 0x0001 to the RUN register and reading it back

10. reading data from AVRMS, BVRMS, CVRMS, ATEMP, BTEMP, CTEMP, ANGLE0, ANGLE1, ANGLE2

Thank you already!!!

Edit Notes

added content from question
[edited by: cedric.knez@ioxlab.de at 6:56 PM (GMT -5) on 12 Nov 2020]
  • Hi Can you tell me your inputs to the voltage channel? 

    Registers you are writing to on and values  power up?

    Can you read the power pins,ref,LDOs on the ade7933 and ade7978. 

    can you share your code ? 

    Dave

  • 1. First I initiate a hardware reset

    2. Then I enable SPI communication by toggeling the CS pin 3 times

    3. I read out the RSTDONE bit from STATUS1 register and wait for it to be =1

    4. I write some data to PHNOLOAD register and read back LAST16 register, to verify that communication is working. I reset PHNOLOAD afterwards obviously

    5. ANGLESEL bits in COMPMODE are set to 1 (getting angle from voltage channels)

    6. Setting DREADY in MASK0 to generate interrupts

    7. Flush the DSP register pipe by ANGLESEL two more times

    8. Clearing STATUS0 and STATUS1 registers by setting all to 1

    9. Writing 0x0001 to the RUN register and reading it back

    10. reading data from AVRMS, BVRMS, CVRMS, ATEMP, BTEMP, CTEMP, ANGLE0, ANGLE1, ANGLE2

    I also added the schematic

  • 7. Flush the DSP register pipe by ANGLESEL two more times this is the wrong register to write 

    The registers used as inputs by the DSP are located in the data memory RAM at addresses from 0x4380 to 0x43BF.

    You need to write a register in this adress range 3 times.

    Please try this. 

    What is your spi speed? 

    Here is some Arduino code I use for my testing also verify you r address you are reading and writing to. 

    digitalWrite(SSB_A, HIGH);
    digitalWrite(RESET_B, HIGH);

    //reset part
    digitalWrite(RESET_B, LOW);
    delay(10);
    digitalWrite(RESET_B, HIGH);

    while( digitalRead(IRQ1) == 1); //wait for reset done
    ADE7978_SPI_WRITE(STATUS1,0xffffffff,0x4);

    //set spi port TOGGLE SSB 3 TIMES
    digitalWrite(SSB_A, LOW);
    delay(1);
    digitalWrite(SSB_A, HIGH);
    delay(1);
    digitalWrite(SSB_A, LOW);
    delay(1);
    digitalWrite(SSB_A, HIGH);
    delay(1);
    digitalWrite(SSB_A, LOW);
    delay(1);
    digitalWrite(SSB_A, HIGH);

    delay(2000);

    ADE7978_reg_config();

    void ADE7978_reg_config()
    {


    ADE7978_SPI_WRITE(AIGAIN, 0x0, 4);
    Serial.print("AIGAIN = ");
    Serial.println(ADE7978_SPI_READ(AIGAIN,4), HEX);


    ADE7978_SPI_WRITE(BIGAIN, 0x0, 4);
    Serial.print("BIGAIN = ");
    Serial.println(ADE7978_SPI_READ(BIGAIN,4), HEX);


    ADE7978_SPI_WRITE(CIGAIN, 0x0, 4);
    Serial.print("CIGAIN = ");
    Serial.println(ADE7978_SPI_READ(CIGAIN,4), HEX);

    ADE7978_SPI_WRITE(AVGAIN, 0x0 , 4);
    Serial.print("AVGAIN = ");
    Serial.println(ADE7978_SPI_READ(AVGAIN,4), HEX);

    ADE7978_SPI_WRITE(BVGAIN, 0x0 , 4);
    Serial.print("BVGAIN = ");
    Serial.println(ADE7978_SPI_READ(BVGAIN,4), HEX);

    ADE7978_SPI_WRITE(CVGAIN, 0x0 , 4);
    Serial.print("CVGAIN = ");
    Serial.println(ADE7978_SPI_READ(CVGAIN,4), HEX);

    ADE7978_SPI_WRITE(CFMODE, 0x0088 , 2);
    Serial.print("CFMODE = ");
    Serial.println(ADE7978_SPI_READ(CFMODE,2), HEX);

    ADE7978_SPI_WRITE(CF1DEN, 0x283d , 2);
    Serial.print("CF1DEN = ");
    Serial.println(ADE7978_SPI_READ(CF1DEN,2), HEX);

    ADE7978_SPI_WRITE(CF2DEN, 0x283d , 2);
    Serial.print("CF2DEN = ");
    Serial.println(ADE7978_SPI_READ(CF2DEN,2), HEX);

    ADE7978_SPI_WRITE(CF3DEN, 0x283d , 2);
    Serial.print("CF3DEN = ");
    Serial.println(ADE7978_SPI_READ(CF3DEN,2), HEX);


    ADE7978_SPI_WRITE(RUN, 0x0001, 2); //write run bit
    Serial.print("RUN = ");
    Serial.println(ADE7978_SPI_READ(RUN,2), HEX);

  • double and triple checked my registers with a logic analyzer, they are correct.

    Flushing the right registers did also not solve my problem.

    I then put your code as my startup procedure, without any success

    I swept SPI frequencies from 750kbits to 2.5Mbits

    Maybe also interesting: The CFX diodes in my circuit are always on. even if I disable the output

  • As I use this part on a regular basis it should work. 

    Can you share your code and spi routine. I did not send you my spi code and mine works. You might be doing something wrong. If you don't want to share it publicly you can send to mail email

  • here is my run of the test you are trying to do 

    3phase 120 deg between phases    3 different  voltage levels to see the difference in vrms

    ADE7978_SPI_WRITE(COMPMODE, 0x02ff , 2);   //I had to do this twice to write reg
    Serial.print("COMPMODE = ");
    Serial.println(ADE7978_SPI_READ(COMPMODE,2), HEX);

    ADE7978_SPI_WRITE(COMPMODE, 0x02ff , 2);
    Serial.print("COMPMODE = ");
    Serial.println(ADE7978_SPI_READ(COMPMODE,2), HEX);

    ADE7978_SPI_WRITE(CONFIG3, 0x0000 , 1);
    Serial.print("CONFIG3 = ");
    Serial.println(ADE7978_SPI_READ(CONFIG3,1), HEX);



    ADE7978_SPI_WRITE(RUN, 0x0001, 2); //write run bit
    Serial.print("RUN = ");
    Serial.println(ADE7978_SPI_READ(RUN,2), HEX);

    COMPMODE = 2FF
    CONFIG3 = 0
    RUN = 1
    AVRMS = 2220438 BVRMS = 2021194 CVRMS = 1509800

    ANGLE0 = D67 ANGLE1 = 6B3 ANGLE2 = 6B5

    ATEMP = 3A BTEMP = 3A CTEMP = 3A
    AVRMS = 2220379 BVRMS = 2021132 CVRMS = 1509694

    ANGLE0 = D68 ANGLE1 = 6B3 ANGLE2 = 6B5

    ATEMP = 3A BTEMP = 3A CTEMP = 3A
    AVRMS = 2220449 BVRMS = 2021190 CVRMS = 1509775

    ANGLE0 = D68 ANGLE1 = 6B3 ANGLE2 = 6B4

    ATEMP = 3A BTEMP = 3A CTEMP = 3A

  • Did you manage to get it work? Is your schematic correct? I'm currently designing my own, documentation is unclear, but it seems to me that GNDiso pin is not a neutral cable. It should probably be connected to the shunt's ground.