Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC 18F series and SD storage

Status
Not open for further replies.
SD card write speed improvement

Hello everyone,

I have made a system, that collects data from several microphones and sends it to PC. I am using PIC33fj128GP802 microcontroller and FT232rl serial to usb converter chip. So far, the system is capable of recording signals from 4 microphones, with a sampling rate of 15KHz for each and sending the data to PC in real-time. However, I want to back-up all the data on the SD card, so that in case of the transmission errors, I could still retrieve the data. To do that, I connected an SD card to the system via SPI. I use the driver developed by Lucio di Jasio, which is explained in detail in his book "Learning to fly the PIC24". However, when I record the data to the card, I can see discontinuities in the signal now and then. At first I used a standard low speed SD card, and assumed that the card was causing the problems, so I replaced it with SanDisk express 3. There was no improvement in the write speed. On some forums, I have seen posts stating that some guys have achieved write speed as high as 1MByte/s. So could anyone please give me any ideas on how I can improve the write speed to the SD card?

And some more questions:

1) Are there any specific requirements to formatting the SD card, like setting the specific block size? When I format the card in Windows, it doesn't allow me to set any block size except 16 kilobytes.
2) In the driver that I am using now, single block write and read commands are used for data transfers. So I am wondering if the multiple block writes would increase the write speed significantly? Has anyone got any experimental data, comparing write speeds using single and multiple block writes?
3) Could it be the mocrocontroller that is limiting the write speed? (SPI clock set to 10MHz), system clock 40MHz. For data transfers between ADC and RAM DMA is used, so the CPU isn't loaded too much.
4)I have also noticed that when I read data from file, the data rate is also limited to roughly 240Kbit/s. To test it, I played a wave file from the card via microcontroller and when I set DAC output frequency above 15K. I can hear distortion in the signal.

Looking forward to your replies, would be very grateful for any help.
 

Re: SD card write speed improvement

Hello!

Yes, if you want to write fast, you have to setup multiple blocks.
The speed difference is quite significant. I would say about 10 times
faster than random write. But you have to know what you are doing.
The SD card is bloody stupid, so if it is segmented like this:

File A part 1
Flie B part 1
File A part 2

Suppose that file B was less than 1 cluster. Then if you add blocks,
once you finish the cluster, you may overwrite FileA part 2. So you
have to know in advance how many block you can write in multiple mode.
If you format your card and then use a single file for your 4 signals,
then it's fine.

Dora.
 

Low power SD card

Hello everybody!

I am looking for a low power SD card. Does anybody know a device with
a power consumption (of course in active mode) around 10 mA or less?
Most of the SD cards I have tried are around 40 mA.

Dora.
 

if the microcontroller can operate in the 3.3v range, then there is no problem as sd card will work on 3.3v.. but if it is a 5v like pic18f4550..then you need to use a voltage divider circuit... use the help section in mikroc... the circuit is also given, search for mmc section in help!!....anyway, do u know how to write data into mmc using pic ? i need to know about that urgently!!...please tell if you know the procedure
 

Would a resistive voltage divider on each line be sufficient? Or is there an IC that would accomplish more efficiently?
Resistive dividers can basically work, but buffers are the smarter solution. Supplying the buffers (besides the card socket)
is the main purpose of the unwanted PICtail, as I tried to explain. For the opposite data direction, standard PIC I/O pins can be
driven from 3.3V logic without level conversion, because they have a TTL level specification (2.0V min. high level on input).
 

Re: How to read data from MMC using PIC microcontroller ???

were you successful in the mmc and mc interfacing?? even i need to do the same urgently..to send data from pic to mmc... and i am still a beginner, so dont have a proper idea about pic and mmc interfacing
 

Re: Flash File System for SD Cards

kender said:
I've used Brush Electronics' SD card file system: https://www.smallridge.com.au/#SDFS. Integrating it into my code was easy. My application wasn't very demanding, so I don't know if this file system does wear leveling.

Wear leveling is handled automatically by the embedded controllers in the SD/MMC cards. It is transparent to the file system.
 
Re: How to read data from MMC using PIC microcontroller ???

adm1 said:
were you successful in the mmc and mc interfacing?? even i need to do the same urgently..to send data from pic to mmc... and i am still a beginner, so dont have a proper idea about pic and mmc interfacing

Here are several reference hardware designs showing how to interface an SD/MMC card to a PIC. https://www.brushelectronics.com/index.php?page=projects
 

FvM said:
Resistive dividers can basically work, but buffers are the smarter solution

While generally true, it just so happens that Rev 4 of the Microchip SD/MMC PICTail does not work correctly in the Microchip HPC board. The problem is due to a hardware issue with the buffers that have been used on the PICTail.
 

Re: Low power SD card

doraemon said:
Hello everybody!

I am looking for a low power SD card. Does anybody know a device with
a power consumption (of course in active mode) around 10 mA or less?
Most of the SD cards I have tried are around 40 mA.

Dora.

Use a microSD card in an SD card holder.
 

Re: SD card write speed improvement

It is a common misconception when using the SPI interface that high performance SD cards perform faster than non high performance cards. I have extensively tested a wide range of cards from a wide range of vendors have found in SPI mode that the speed rating of the card is no indication of performance in SPI mode. A cheap card can, and often does, outperform a high speed, expensive card.

The card is not the culprit for low performance, it is the fault of the file system.
 

Re: Low power SD card

Hello!

Thanks for the hint!
However, I am ALREADY using micro SD cards, and just for your information,
the holder does not change the power consumption of the micro SD card.
The consumption of the micro SD card is basically the same as an SD card,
about 40 mA. I guess the chip is the same, only the package is different.

Now to come back to my question, if you can point me to a low power
micro SD card (around 10 mA in write mode), then I would be happy to get
the info (maker or reseller URL).

Dora.
 

Re: Low power SD card

how can i copy {master}mmc to other extention mmc [at lest 20 pcs mcc ] via pic micro controller
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top