--=-XOR1Da510l6QunIRwL3F Content-Type: text/plain Content-Transfer-Encoding: 7bit On Sat, 2007-12-29 at 16:03 -0500, Spehro Pefhany wrote: > Hi, Herbert:- > > I'd be interested in seeing the SD card code. I've attached the main source code. Note this was written for the Luminary micro, so you can't just drop it into a PIC directly, that said, most of it is pretty high level so adapting it to pretty much any platform would be very simple. > Will it work with the > newer cards with larger sector sizes? Is that what they are doing with those HC cards? This code assumes a sector size of 512bytes, I tested it on 512MB and 1GB cards (a 512MB card would last me around 8 months, so I never worked much on using bigger cards). There are several sections of code that assume 512byte sectors, so those would have to be modified with the data from the CSD (I assume that's where the card tells the host it's sector size?). I read several parameters from the CSD, so adding sector size would be trivial there, modifying the other portions of code should also be rather simple to do. TTYL --=-XOR1Da510l6QunIRwL3F Content-Disposition: attachment; filename=carmon.c.zip Content-Type: application/zip; name=carmon.c.zip Content-Transfer-Encoding: base64 UEsDBBQAAAAIAPmgRTbn9uJIbBMAAEteAAAIABUAY2FybW9uLmNVVAkAA+bUx0X1ynZHVXgEAPQB 9AHtHGtT20jys7aK/zBwdWBjwJLBBuKQLceGhDpeZZPb3CWUS9hjLCJLLknmsXf89+ueGUkzetgi IXfZ27jysGf6Nd093T0PaemXv1jOwJ4NKVkZ3/ctJ/C3xitLauuETibmNN0ePE5pEnxIr2c3ibab qeUmmoAR9bzZNEi0+4/+ILATjTPTS8H5VqJlOhwkWlybDvu+N/js+p452W88GA0GsfTLnWsNSa8D w7UCUsJf5aYGH9Ez9UC8MX0gpcHY9Igzm5SbcpcPHa7jB4R1r/sBNN4gCPtt+a1e+/hYIJv+wLIi dI+aIBIdBK5HSjPHt24cOiS269wQ3toHZtfUi/nNgsFYAmU0h2ZgIoSMDmKRGxr0R5bnB/0paMwK LNcRzMQYZSnavQ5Rm9nYIukyutIoyPGoddkf0sC0bD8xJJRJkiSAr4J8vvQ2FUMQgqcpdl036Fge 637sReTSgCPLCZXdD1zOP4Neimc0unvPCmhRc0kSMCN9aHUv+92PQHnkfjL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y0ZakBspJk7Um/TSB0ih TAOFJnBS29cz/zFS8nNrqgNlPv9wNQLzidCaBwdib1I1oD8bUDpUbJd52h47y8yjy6RLA+8RjLO1 tSV5jnKM/5Ra0cVvPSteiajlhoLR7veO/3mY09w//XByqfSxGqV72Or035708VloAfEtZcg+2dkv vJ7b2f/ui4c/I/KPsWAyGj/XSz/yeknM3CCm4lu/s1fyxXdGeORgl0bUdVQ5NEfjimfX7fI6XtIn lSV2PpcHvnu1vlPWIqAcqD1OdKCXq42dspzOQ4j9q1XGVCScbbK6ijSjfkNHgD1dAOzxSC8FQsIe /kBb/vrrryLEk29hoWexENclFhKvfY38Rm3vRYhnSt7YKUTb+BrBt2svQjtTbiNSeLpPb6aPrIX7 HiHJfUYvmRDDm5SRvJm44pwzA7lWANnIQ96RR5MnmfTCBmgSc3ZdTvvwK5XnNXFlQjkcT7yLtVBV Er+LVr6DlNPdF+9AC6lkvFFiTg5BDWaQAlrJhwHweRoL1v/iwIAdMZfWyJp0PhAfpSeXXQlodhud v3lXBuVX8uKBpwS7ki8U8mecoqu3C9DWttYYfKpTXNDNVYQhX5hPjIOrNoWGqk41MtVncBf3EDnl eYMQLLO4ybJ99tZUE312JBvFL6vMe4vw/9pDU+v6ny76Z3XR73cryCeb4ReT8FeCkxnu7fLbTIvf Hy49MIYvZA2r+hLeXA1hWHlfFq+hFUMd4DjxJ4dhliXsHbJi1LlvJReXkkIfwOcb9IeajtfCeMNr +L07kq+DRVlWahOvVP4PUEsBAhcDFAAAAAgA+aBFNuf24khsEwAAS14AAAgADQAAAAAAAQAAAKSB AAAAAGNhcm1vbi5jVVQFAAPm1MdFVXgAAFBLBQYAAAAAAQABAEMAAACnEwAAAAA= --=-XOR1Da510l6QunIRwL3F Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --=-XOR1Da510l6QunIRwL3F--