Ttelmah
Joined: 11 Mar 2010 Posts: 19510
|
|
Posted: Thu Dec 09, 2010 5:36 am |
|
|
Answer to second first: - will depend on what you want to do with the data. If you want it to be reasonably easy to read with a PC, then it needs a file system.
Then, if the card is 2GB or less, you can use FAT16. If over, it gets more complex, with you having wither to split the card into two smaller partitions, or use FAT32.
If 2GB, is big enough for you, then stick with FAT16. It is simpler, and faster.
SPI mode. _much_ easier to drive from a PIC. The code to control a card, and the basic file system drivers are standard items. The 'basis' comes with the compiler, _but_ there are better 'working' libraries available for small fees. Asmallri who posts quite regularly here, sells a library, including support for FAT32, and all the 'work' for talking to files done 'for you; together with example circuits for how to do the interface, on his web site. A search will find details. 'brushelectronics'.
Easiest interface, use a 3.3v PIC. Otherwise you do have to buffer the lines between the chips.
As for 'why', there are actually three modes. SPI mode - the PIC has the hardware for this, and it is a standard. Then there are two SD modes. One bit, and four bit. Two separate data channels (so extra pins needed), and the transfer format is proprietary (no hardware on the PIC) The four bit mode uses even more pins. Speed is potentially faster, but for a PIC, the limiting factor will be the speed of the chip, not the interface, and without the hardware to do the transfer for you, will end up being slower. A lot more code needed too, to handle the interface.....
Caveat, keep card sizes under 4GB, whatever your decision about a file system. There is another change in the interface for larger cards....
Best Wishes |
|