AnsweredAssumed Answered

ADE7754 SPI COMMUNICATION

Question asked by disha on May 10, 2017
Latest reply on May 15, 2017 by disha

I have rigged up circuit as given here: https://ez.analog.com/servlet/JiveServlet/showImage/2-142882-17904/7754.JPG

This is working circuit as per link here : https://ez.analog.com/thread/39985

I am interfacing it to arduino with spi communication(as the ic has only spi) but, I am not getting any values on MISO(dout) line whereas the clk,mosi,cs are all as expected.

Here is my code :

#include <SPI.h>
const byte READ = 0b00111111;   
const byte WRITE = 0b10000000;
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
pinMode(SS,OUTPUT);   //Chip select
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(SS,HIGH);
 SPI.begin();

readRegister(0X2C,3);    //to read voltage the address is 0X2C and should read 3 bytes of data

}
  void readRegister(byte thisRegister, int bytesToRead)
{
 byte dataToSend = thisRegister & READ;
  SPI.beginTransaction(SPISettings(2000000, MSBFIRST, SPI_MODE0));  
    digitalWrite(SS, LOW);
delay(1);
   SPI.transfer(dataToSend);    //request for the data from the required address
   delay(2);
  digitalWrite(SS, HIGH);
  delay(10);
  SPI.endTransaction();
}

So here I am not reading the bytes I am just requesting and seeing on oscilloscope if I am getting the data  or no I am checking on oscilloscope.

But, MISO (dout) line remains nill with no data is my programing correct?

Outcomes