Confused with SDFileSystem.bas

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Re: RAM extension??? Anyone?

Post by liak » Fri Jul 18, 2008 8:19 am

Dear all,
Steven, hmmm. Bad news. SDCard is good for storage but too slow, much slower than I expected (I suspect you 'suspected' the same earlier). Tested it on board. TOO slow for my application. :cry:

What I need now is a RAM extension. I am using 18F2525, already with full 4Kbytes. Normnet and rubapena, the chips you guys mentioned looked like ROM. Can confirm?

I also went through Microchip website. They did mentioned of RAM extension in application notes but not refering to any specific RAM chip. Does anyone have any experience of adding this? Anywhere to refer to? How does it work? I don't think anyone has posted any modules regarding this as well. :?

Apart from EEPROM (which I already have), does anyone have any idea what may suite the following requirements? 'just in case I missed out any options and I am already confused with what I want': :?:

1. Massive data storage - lots of it (at least in Mbytes) :shock:
2. Non-volatile :lol:
3. Fast --> like RAM 8)
4. Reasonably priced :)
4. Not too difficult to program (least required)

Help anyone? Thanks.
Regards.

normnet
Posts: 55
Joined: Mon Jan 01, 2007 6:32 pm

Post by normnet » Fri Jul 18, 2008 9:58 pm

Normnet and rubapena, the chips you guys mentioned looked like ROM. Can confirm?

M25P32: 32 Mbit, Low Voltage, Serial
Flash Memory With 50MHz SPI Bus Interface.

Can read a byte from M25P32 chip and set portB at 303k per sec.
See GLCD's (to wards end) post at M25P32 PIC Audio.

M25P32 is smaller capacity than an SD
card but does not suffer with brand
incompatibilities and requires much less
in the way of error checking routines
than an SD card does.

Norm

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Fri Jul 18, 2008 10:47 pm

What kinds of speed are you after?

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Post by liak » Sat Jul 19, 2008 3:09 am

Dear Steven and Normnet,
Thank you both for the replies.
I was trying to read about 8 sectors (4,000bytes) from the SD card. Hoping to get it done under 0.1 seconds == transfer rate of 40KBytes/sec (within the range of speed you estimated). I am using software SPI and PIC18F2525 at 20Mhz w/o PLL. Surprisingly, it took more longer than that. It's about 500ms. I guess, I can improve on the speed by adapting to PLL 40Mhz and changing to hardward SPI, right?
Now, I am trying to overcome this slower transfer rate by compressing the data on SD card. Trying to mark up the lost of transfer rate. Instead of reading 8 sectors, I am trying to read 3 sectors. But this consume PIC resources. And I am not sure if this is still fast enough. Hope I can make it. Will let you know if I can make it very soon.
Another problem that I want to ask is about the funny behaviour of mySDCard setup. I am using a prototype board now. The schematics is adapted from (thanks again, I borrowed a lot from you!) your wavplayer project. Sorry, can't post you any drawings, cause I haven't tiddied them yet.
The thing is that, the SDCard won't initialize (giving ErrNoResponse), until I sort of have to touch / fiddle around the pins 7 and 8 connections to make it initialize. It seems like the 2 pins need to be discharged or what? Otherwise the card is not recognized. Any possible explanation for this?

Regards. :)

Doj
Posts: 362
Joined: Wed Apr 11, 2007 10:18 pm
Location: East Sussex

Post by Doj » Sat Jul 19, 2008 12:52 pm

Hello liak, Before you do any compression you must change to hardware SPI, its not difficult at all.
I have just gone through this myself as my comms was too slow, the hardware SPI was MORE THAN 10 TIMES faster in my application(not SD card, Zigbee chip).
I know you will not achieve that gain as the card will have a limit, but you will know the speed is not limited by the PIC.

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Sat Jul 19, 2008 9:43 pm

At 20MHz with software SPI, from my previous tests, I would expect an average write speed of around 15KB/sec. Swapping to hardware SPI and 40MHz will give you an approx speed increase of 4x. Even if you use a RAM chip, unless you go parallel you will not get much faster than you can with SD cards as their write speeds work up to a SPI bus speed of 20MHz and most cards don't seem to make the PIC wait too long when starting a write sequence.

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Sat Jul 19, 2008 9:52 pm

As for the card not initialising properly, have you got pull-ups on SDI and SDO - I have found that they fix the problem (something around 50K to 100K should do). I think the problem comes from the PIC misinterpreting floating inputs before the card is inserted.

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

MSSP testing

Post by liak » Mon Jul 21, 2008 2:25 pm

Dear Doj and Steven,

I switched to MSSP. The result is very impressive. I think, at least the transfer rate is increased by 2x, maybe even faster. I have not added PLL yet. But still thanks a lot. :lol:
And Steven, yeah it helps. I pulled up the two pins. It's working properly now.
(Sorry, I edited this reply, after I finally figured out what you meant by pulling the pins up.)

Thanks. :wink:
Regards

Post Reply