Hello All,
I am using Cortex M4 along with ADE7758.
I am not able to read any data from ADE7758. I can see CSn pin goes low when I initiate read operation from LM4F232, even i can see data and clock when I send address of the register to be read from ADE7758.
I have modified the code given in Stellarisware.
Below is the code I am using
void ade7758_receive(unsigned char add,unsigned char nobytes)
{
// volatile unsigned char i = 24,c2,c3;
// volatile unsigned long buf=0;
// volatile unsigned int k=1,c1;
volatile unsigned char c3;
unsigned long ulDataRx[NUM_SSI_DATA];
unsigned long ulindex;
c3=add;
//------------------------transmit address-------------
SSIDataPut(SSI0_BASE,c3);
while(SSIBusy(SSI0_BASE))
{
}
//-------------------------------------------------------
delay(10);
//------------------------------------------------------------------------------------
for(ulindex = 0; ulindex < NUM_SSI_DATA; ulindex++)
{
//
// Receive the data using the "blocking" Get function. This function
// will wait until there is data in the receive FIFO before returning.
//
SSIDataGet(SSI0_BASE, &ulDataRx[ulindex]);
//
// Since we are using 8-bit data, mask off the MSB.
//
ulDataRx[ulindex] &= 0x00FF;
}
delay(10);
}
One more doubt i have. ADE7758 has 5VDC supply and Stellaris runs on 3.3V(I am using EVM of Cortex M4). Is that problem? But Cortex M4 datasheet mentiones about 5V tolerant GPIO. Is it rue for SPI interface?
With Regards,
Harshal