dear all,
In my project i wants to communicate with ade7763 energy meter ic through SPI by using TMS320f28027 .
for example if i send mode register address (8 bit) 0x09 means it will return (16 bit) 0x000C from that register.now i checked the MISO signal by CRO it gives the same output 0x000C .but the value read by my spi code is data1= 255 and data2= 0
i tried with separate GPIO for cs .but the same problem is continuing .please help me to solve this problem
my code
while(1)
{
SPI_write(mySpi, 0x09<<8);
DELAY_US(6);
SPI_write(mySpi, 0x00); // dummy data 1
DELAY_US(4);
while(SPI_getRxFifoStatus(mySpi) == SPI_FifoStatus_Empty){
}
data1=SPI_read(mySpi);
SPI_write(mySpi, 0x00); // dummy data 2
DELAY_US(4);
while(SPI_getRxFifoStatus(mySpi) == SPI_FifoStatus_Empty){
}
data2=SPI_read(mySpi);
printf("data1:%d data2:%d\r\n",data1,data2);
for(i=0;i<100;i++)
DELAY_US(10000);
}
Regards
Ramesh