Author Topic: SD and interrupts  (Read 1275 times)

0 Members and 1 Guest are viewing this topic.

Offline YaroTopic starter

  • Contributor
  • Posts: 48
SD and interrupts
« on: March 19, 2015, 10:33:35 am »
Hi all,

I'm looking for a method do storage data from sensors. I've tryed Flash RAM but I encountered an issue in the writing becouse if my interrupts starts when I'm erasing blocks or writing on RAM it cause wrong data recording.

I want to ask if I can encounter the same problems on SD cards.

Also, I want to ask writing speed on SD and if, without SD interface, If there is a library that use GPIOs to communicate with SDs.
 

Offline 6thimage

  • Regular Contributor
  • *
  • Posts: 181
  • Country: gb
Re: SD and interrupts
« Reply #1 on: March 19, 2015, 01:09:21 pm »
That sounds like a problem with your code rather than an issue with using flash memory.

However, SD cards offer many advantages over chips. You can interface with them in two ways - using either a SPI or SDIO bus. Which one you will want to use depends on which microcontroller you are using - some have a built in SDIO interface, which makes life easier. If your microcontroller doesn't have a built in interface, SPI is the way to go. To avoid any problems with your interrupts, it is best to perform the write and reading using DMA.

The write speed depends on the operating frequency of the bus, but for the SPI interface it maxes out at around 120 kB/s. For the SDIO interface it is the write speed of the card - which maxes out at 10 MB/s.
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: SD and interrupts
« Reply #2 on: March 19, 2015, 03:27:41 pm »
I don't know about your MCU, but on the MSP430 (where most of my experience is) you have to disable interrupts when you start erasing/writing to flash to prevent corruption.  It's step one in all of the guides and examples.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf