Thanks fat16lib for the reply.
OK I understand that I need to be careful when writing to CSD as PERM_WRITE_PROTECT will make my SD unusable (unless I have anything useful for reading). My query is how do I use CMD27.
I can use SD2Card cardCommand(27, 0) and get the response. How do I write the data that goes into the register?
if (ret = cardCommand(27, 0))
{
Serial.print("CMD27 failed :");
Serial.println(ret, HEX);
return false;
}
else
Serial.println("CMD27 worked");
spiSend(data1); // send 1st byte
spiSend(data2); // send 2nd byte
spiSend(data3);
...
spiSend(datan);
Will this work ? Doesn't want to try this and ruin the card.
Thanks again
Harshana