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.
I have problems talking with the ade7754 throught SPI, have anybody working with it. Thx.