Hi
I am working with a Maxim-IC DS3234 SPI based RTC to learn about SPI on the mbed. The comments in my code indicate what I believe I am doing which is based on the example in the Handbook. I am getting 0xFF returned when I really expect I should be seeing 0x01.
I suspect that I am missing something.
Any clarification appreciated.
Thanks
Tim
int main()
{
// Setup the spi for 8 bit data, high steady state clock,
// second edge capture, with a 1MHz clock rate
spi.format(8,3);
spi.frequency(1000000);
// Select the device by seting chip select low
cs = 0;
// Send the commands to write to test the seconds register
int value;
value = 0x00;
spi.write(0x80); // set write register to seconds
spi.write(0x00); // dummy read
spi.write(0x01); // send value of one
spi.write(0x00); // dummy read
spi.write(0x00); // set read register to seconds
// Send a dummy byte to receive the contents of the seconds register
value = spi.write(0x00);
pc.printf("Seconds register = 0x%X\n\r", value);
// Deselect the chip
cs = 1;
}
Hi
I am working with a Maxim-IC DS3234 SPI based RTC to learn about SPI on the mbed. The comments in my code indicate what I believe I am doing which is based on the example in the Handbook. I am getting 0xFF returned when I really expect I should be seeing 0x01.
I suspect that I am missing something.
Any clarification appreciated.
Thanks
Tim