AtomSoft,
It's a great chip, but that 80 pin TQFP package is a little too much for my breadboarding skills
It seems to have the same amount of onchip RAM as a 18F4620, and an abundance of I/O pins. I recommended the 18LF4620 simply because of its 4K RAM, 32K program memory and the wide operating voltage range.
Each SD card's CSD register will specify the maximum & minimum write blocks. I haven't personally seen any SD card that will permit a partial sector write.
Command 9 (send CSD) will instruct the card to send its card specific data. The data will consist of the start block token (0xFE), 16 bytes of CSD, then 2 CRC bytes. The data is a bit tricky to extract in assembler, since some of the bitfields span multiple bytes. It should be fairly easy to set up a C structure and just read the values in.
Bits are numbered from 127 to 0 (16 bytes)
The relevant fields are :
Bit 21 WRITE_BL_PARTIAL Boolean TRUE/FALSE
Bits 25:22 WRITE_BL_LEN valid values are 9, 10, or 11
The WRITE_BL_LEN field yields 2 ^ WRITE_BL_LEN,
(or 0x1<<WRITE_BL_LEN, if you prefer C style).
512 byte blocks are always accepted. I assume that any multiple of 512 bytes (up to 2 ^ WRITE_BL_LEN) is permitted, but have only been able to verify the 2^9 and 2^10 cards.
I know that this is difficult to read ( BORING) , but it will be worth it when your project comes to life. When I finally heard crisp, clear sound coming from that amazing little card, I was blown away.
Just how Watson must have felt when Bell made that first telephone call.