SDFileSystem.bas ???

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Jumper
Posts: 3
Joined: Mon Jan 15, 2007 12:04 pm

SDFileSystem.bas ???

Post by Jumper » Mon Jan 15, 2007 12:17 pm

Hi,

I have downloaded the newest version of Swordfish SE to see if I want to migrate from PBP to something newer and it is supposed to be a full working version except for RAM limitations. However I can not find SDFileSystem.bas so I can't test to use the SD-card. Isn't that supposed to be together with the other .bas files in the library folder??

Is this because I have the SE version 1.2.0.8 or because of something else? Anyone? Any ideas?

/me

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

Post by Steven » Mon Jan 15, 2007 1:16 pm

The SD library file is with the full version. It may not be part of the SE version as it will exceed the RAM limitation I think, even for a simple program.

I hope this helps,

Steven

Jumper
Posts: 3
Joined: Mon Jan 15, 2007 12:04 pm

CRAP

Post by Jumper » Mon Jan 15, 2007 1:34 pm

:lol:

From their webpage:
"Probably the best way to see what Swordfish can do is to try it yourself by downloading a free, fully functional, non expiring Special Edition (SE) version of the compiler. SwordfishSE includes everything you get with the commercial version, including the full list of supported microcontrollers. The compiler is only constrained in terms of the amount of RAM available during compilation. "

I could easily accept that the the RAM limitations stopped me from testing, but this sounds more like false advertising. What else is not included in the fully functional SE version?

I find it hard to accept that a simple program reading byte by byte from a SD-card will use more than 200 bytes of RAM.

This sounds like it is time for a competition, how small can you get if you have the real version? Or will it take all the resources it can, pretending to be PICwindows? Can anyone just give it a try, open and read one byte from a file on the SD card.

As we say here: If it sounds to crazy to be true, it probably is. Either crasy or true....

Where in the IDE can I see the amount of RAM used after I have compiled a program?

Could anyone from the SF team enlighten us with the real reason?
/me

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

Post by Steven » Mon Jan 15, 2007 1:58 pm

Well, given that I wrote the SD library for Swordfish, I can tell you that it will take in excess of 512 bytes of RAM for any program, since it maintains a buffer that is the size of a sector on a SD or MMC card. This is essential when writing to a SD card with the FAT file system, and any competing compiler will do the same.

I can't comment on why it is not part of the SE download, but it will be useless with limited RAM. I can email you the library if you are interested, but you will need the full version to be able to test it.

What I can assure you of is that it is an excellent compiler. It allows you to do complex things, yet retains ease of use.

I hope this helps.

Regards,

Steven

P.S. If you want me to email a hex file of the compiled version of one of the samples, with pin assignments corrected for your circuit, let me know.
Last edited by Steven on Mon Jan 15, 2007 8:07 pm, edited 1 time in total.

Jumper
Posts: 3
Joined: Mon Jan 15, 2007 12:04 pm

Great answer

Post by Jumper » Mon Jan 15, 2007 3:02 pm

That was a nice and complete answer and I have to agree with you that I can't see a use for the SD module in the SE version either in this case.

Thanks for you offer to e-mail me a hex file but that is not needed for the moment. I will try some other things before migrating to a SD supporting compiler, it would be nice to get that extra memory space and eventually I might not have any other choice but on the other hand USB is also nice to have.

But I am sure that the Swordfish compiler is the best basic compiler currently on the market, at least for the more advanced stuff (GLCD and SD) and I really like the easy of adding mudules.

One more question, How do I move the startaddress to lets say 64? 0040 hex if I use my own bootloader?

until next time

/me

APOLLO21
Posts: 2
Joined: Sun May 25, 2008 9:07 am
Location: JAPAN

I challenge compiling it.

Post by APOLLO21 » Tue Jun 10, 2008 7:09 am

I become gills - about "Sd.init".
Because I cannot copy an error, it cannot form on here.
NONNNO

dchedufa
Posts: 3
Joined: Tue Jun 10, 2008 2:39 pm
Location: Argentina

SDFileSystem.bas again

Post by dchedufa » Tue Jun 10, 2008 2:46 pm

I have de same problem that was mentioned before. I need SDFileSystem.bas library so i could compile the sample project of the wav page. I really need the code. Is there any way to get the library? How much does it cost the full version of Swordfish where do i get it? im trying to make the SDMMCWavPlayer. Could i get from someone the Hex file to burn the pic and the pin assigments? Althougth i would really like to be able to create modify the code for my own.
Thanks!
D.

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

Post by Steven » Tue Jun 10, 2008 5:10 pm

You will find purchase information for Swordfish here: http://www.sfcompiler.co.uk/swordfish/p ... dfish.html - I can highly recommend it as a PIC Basic compiler.

The SD library is available on the Sworfish wiki here: http://www.sfcompiler.co.uk/wiki/pmwiki ... temVersion - it is a later, improved library from that which comes with the compiler (Version 4 compared to Version 1). You may need to alter the Init function slightly in the wav player example to match the new version of the SD library - ask if you need help with this.

To be fair to David (the compiler writer), I'd rather not post the full hex file for the wav player, but I'm happy to send some test code as a hex file if it helps.

APOLLO21, could you re-phrase your question please - I cannot understand what your problem is? Thanks.

Regards,

Steve

dchedufa
Posts: 3
Joined: Tue Jun 10, 2008 2:39 pm
Location: Argentina

Post by dchedufa » Tue Jun 10, 2008 5:41 pm

Yeap, I actually need some info of how to modified the code cause i have a error on the following line

Until SD.Init(spiOscDiv4) // error here

Any help?
D.

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

Post by Steven » Tue Jun 10, 2008 5:56 pm

OK, before the Include 'SDFileSystem.bas' line add:

Code: Select all

#option SD_SPI_SPEED = spiOscDiv4
Then, replace:

Code: Select all

Until SD.Init(spiOscDiv4)
with:

Code: Select all

Until SD.Init() = errOK

dchedufa
Posts: 3
Joined: Tue Jun 10, 2008 2:39 pm
Location: Argentina

Post by dchedufa » Tue Jun 10, 2008 7:53 pm

Thanks!
I guess i should buy the compiler to go foward with the text and learning!
D.

rubenpena
Registered User
Registered User
Posts: 32
Joined: Sun Mar 25, 2007 2:07 am
Location: Monterrey,Mexico

sd_init ?

Post by rubenpena » Fri Oct 03, 2008 8:51 pm

Dear Steven:
I did modify my working program:
First I added before the inc
#option SD_SPI_SPEED = spiOscDiv4
then I change the sd.open to:
'******************************
Repeat
UART.Write("INIT ?...",13 ,10 )
Until SD.Init() = errOK
UART.Write("INIT_OK...",13 ,10 )
'******************************
But when I run the programm,I only have the "INIT ?" string in the
terminal running continuosly.
I try with MMC of 128M and SD's of 64, 256, 512 Megas and 2 gigs.
This program was working OK in April,with all cards.
It compiles OK but never passes the Init. Any clue ?
Hardware: the same.
filesystem 4.01
Swordfish:2.1.0.1
Thanks in advance...
Ruben de la Pena V.

















:

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

Post by Steven » Sat Oct 04, 2008 7:37 am

Have you got pull-ups on the DI and DO lines? When I modified the library to cope with SDHC cards I had to change the card initialisation sequence and the new version often fails if the DI and DO lines are floating before the card is plugged in.

rubenpena
Registered User
Registered User
Posts: 32
Joined: Sun Mar 25, 2007 2:07 am
Location: Monterrey,Mexico

pull ups

Post by rubenpena » Sat Oct 04, 2008 9:16 pm

Hi Steven:
I add the 4k7 pullups in DI and DO and all is working OK.
Thank you ...! . I do not understand why fail without the resistors...
I am using a 18F25K20 at 3.6V and I assumed the lines are, as the Micro
pins are programmed. (And why that worked before...).
Thanks again and greetings...
Ruben de la Pena V.

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

Shematics help please

Post by liak » Thu Oct 09, 2008 6:27 am

Dear Steven and rubenpena,
I have tried very hard to implement the pull ups in the SD interface but still I am not getting any response from the SD card. I am not sure if I have done it right.
Can any of you offer me a schematic of your working SD interface? I am desperate to make my SD module to run again. I will upload my schematics for your checking once I get back to my office.
I am using PIC 18F2525 interfacing the SD card with exact schematics from Steven's wavplayer project.

Thanks.

Regards,
Liak

Post Reply