ade7754 and mbed

I have problems talking with the ade7754 throught SPI, have anybody working with it. Thx.

22 Mar 2010 . Edited: 22 Mar 2010

Hi Carlos,

Can you post some more information about what you're trying to do, and what the symptoms are of it not working.

Better still, could you publish your program and paste the link into this thread so we can look at your code?


Thanks,
Chris

Hi Chris, this is the progrman i use :

#include "mbed.h"

SPI spi(p5, p6, p7); // mosi, miso, sclk
DigitalOut cs(p9);

Serial pc(USBTX, USBRX); // tx, rx

int main() {
while(1){
// Setup the spi for 8 bit data, high steady state clock,
// second edge capture, with a 1MHz clock rate
spi.format(8,1);  
spi.frequency(100000);
wait(3);
// Select the device by seting chip select low

wait_ms(1);



cs =0;
wait_us(0.60);
spi.write(0x3F);
wait_us(4);

// Send a dummy byte to receive the contents of the WHOAMI register
int whoami = spi.write(0x00);
wait_us(0.5);





// Deselect the device
cs = 1;

pc.printf("register = 0x%X\n", whoami);

}

}

 

 

i am trying to read the version register of the ic. But the recived data is FF or 00, but nothing readeable.

 

 

Thanks.