ADE7758 No Data Out From SPI

Discussion in 'Analog & Mixed-Signal Design' started by Dragonoid, Sep 7, 2018.

  1. Dragonoid

    Thread Starter New Member

    Nov 27, 2017
    7
    0
    Hello All,
    I placed the following setup for reading Ac Current / Voltage using ADE7758 with PIC18F4520 Setup as follow.

    Screenshot (44).png

    This is the placement for ADE7758, I had setup the following Codes for PIC 18F4520

    Code (Text):
    1. unsigned char SPI_Read(unsigned char REG_ADDR)
    2. {
    3.     unsigned char recv_data=0;
    4.     ADE_CS_EN=0;
    5.     ADE_CS = 0;//CS ENABLE
    6.     Delay1TCY(1);   //SOME DELAY TO STABALIZE CHIP SELECT
    7.     WriteSPI(REG_ADDR);
    8.     _delay(100);
    9.     WriteSPI(0x00);
    10.     recv_data=SSPBUF;
    11.     Delay1TCY(1);   //SOME DELAY TO STABALIZE CHIP SELECT
    12.     ADE_CS = 1;//CS_DISABLE
    13.    
    14.     return ( recv_data );      // RETURN READ DATA
    15. }
    Code (Text):
    1. void main(void)
    2. {    
    3.       init();//INITIALIZE THE SYSTEM
    4.       unsigned char a=0;
    5. //******************************WRITE CODE HERE********************************
    6.          while(1)
    7.             {
    8.                a=SPI_Read(OPMODE);
    9.                Nop();
    10.             }        
    11. }
    Code (Text):
    1. INTI_SPI()
    2.  
    3.    {
    4.       CloseSPI(); //TURN OFF SPI MODULE IF IT WAS OPEN
    5.       OpenSPI(SPI_FOSC_4,MODE_10,SMPMID);
    6.       TRISCbits.TRISC5 = 0;   // /SDO - Output (Serial Data Out)
    7.       TRISCbits.TRISC4 = 1;   // /SDI - Input (Serial Data In)
    8.       TRISCbits.TRISC3 = 0;   // /SCK - Output (Clock)
    9.    }
    The Wave Form that I am getting is clean and up to the mark from PIC18F4520 (CRYSTAL @10Mhz) But there is no Data from DOUT of ADE 7758(10Mhz), its Showing some minor ripples of about 100mVpp.
    Crystal of ADE7758 Shows sine-wave signals so that confirms that ADE7758 is running correctly(Hopefully)
    But what can be the reason of No Data out from the ADE7758?
     
Loading...