Help - An SD card in SPI mode respect chip select?

  vivitern 07:31 24 Nov 2017

I have an application where I have a microcontroller (NXP LPC1343 atasheet:[click here which is connected to an FPGA via 16-bit SPI. There is also an SD card using the same SPI port (MISO/MOSI) but with a different CS/SS pin (both are active low, as per the SPI specification). One of the things I need to do is write data from the FPGA onto a file on the SD Card using FAT32, and this is the job of the microcontroller. The microcontroller is running FatFS, which I have gotten to work reliably by itself.

Because the microcontroller only has a small amount of RAM, only a small amount of data can be buffered at once. Hence, the micro has to read a buffer from the FPGA, change the SPI mode to 8-bit, and then write that data to the FATFS. Recall that in order to configure the SD card for SPI mode, a command must be sent while the SPI bus is running at 400 kHz, and a certain amount of waiting has to happen. Therefore, I would like to have to only perform the initialization once.

However, performing transactions on the FPGA even while holding CS high on the SD card seems to put the SD card into a weird state such that it needs to go through initialization again. This of course is undesirable, since the initialization may take several milliseconds, in order to write just 4 kB or so of data (again limited by the small RAM capability of my micro). As I need to write several megabytes as quickly as possible, this reduces performance from about 500 kB/s to less than 100 kB/s.

I'm aware that SD cards aren't technically fully SPI compliant, but how can this problem be fixed?

What is Markdown?

Markdown lets you add more formatting to your post. Simply type in your post and it will display as written.

If you wish to add bold or italic characters, add a hyperlink to another website, a heading or a horizontal line, simply use the relevent icons above the text input field.

A preview of your post will appear in the grey box below. If you make a change and you're not happy, simply press the back arrow icon to undo.

Post a Reply


Elsewhere on IDG sites

Microsoft Surface Book 2 review

How To Use Color Range Masking

How to fix macOS High Sierra root bug - stop hackers accessing your Mac

Football : comment regarder la Coupe du monde de football 2018 ?

  • 580621909 2018-02-20
  • 222481908 2018-02-20
  • 2313651907 2018-02-20
  • 9139021906 2018-02-20
  • 6141041905 2018-02-20
  • 4479101904 2018-02-20
  • 8026731903 2018-02-20
  • 8808431902 2018-02-20
  • 6885331901 2018-02-20
  • 451661900 2018-02-20
  • 8958581899 2018-02-20
  • 5685691898 2018-02-20
  • 3084341897 2018-02-19
  • 9294311896 2018-02-19
  • 8539861895 2018-02-19
  • 7147931894 2018-02-19
  • 1919101893 2018-02-19
  • 1478441892 2018-02-19
  • 6531881891 2018-02-19
  • 2391101890 2018-02-19
  • cheap jerseys | wholesale jerseys |