title: SDHC SPI write issues
body: <p>I've been trying to do an SD card interface with the <a href="http://www.keil.com/dd/chip/4629.htm" rel="nofollow">LPC1766</a> <a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus" rel="nofollow">SPI</a> peripheral for a while and right now I'm stuck in a problem that I couldn't find the answer anywhere.</p>
  
  <p>The problem is: SDHC cards are not responding to write and read commands as expected.</p>
  
  <p>Everything works fine on the initialization that was based on Chan's flowchart and on an NXP application note. I can differentiate the cards versions, read the OCR, CID, CSD and determine their sizes.</p>
  
  <p>After that step I start writing single blocks every one second and reading it back to check the data integrity. On a Kingston SDHC 4&nbsp;GB Class&nbsp;4 card I can send a first write command but on the second one the card does not even answer (0x00 or 0x01) to the CMD24. With a SanDisk 4&nbsp;GB Class&nbsp;4 card the results are different, every command is answered by the card, but I get only zeroes when reading the data back (I'm sure I'm not writing zeroes). If I use SDSC cards, everything works fine.</p>
  
  <p>I'm aware that SDHC are block addressed and not byte addressed and that I need to send ACMD41 with the CCS on for SDHC. I also know that the clock frequency is not an issue (using 400&nbsp;KHz to start and then 20&nbsp;MHz to write/read), because I just turned on the CRC checking and all cards are accepting the commands and data. If I stop calculating the CRC all cards reject commands and data.</p>