SDFileSystem Version 4.0.9

Post here if you want to announce new wiki modules, projects or articles

Moderators: David Barker, Jerry Messina

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

Post by Steven » Fri Apr 04, 2008 8:10 am

It's proably not the answer, but worth a go - try adding pull-ups on PORTC. Otherwise, yes the pin connections are right. I use an EasyPIC3 board myself.

Let me know if it still doesn't work and I'll try to think of someything else.

Steve

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Fri Apr 04, 2008 3:04 pm

The pull-ups on PORTC did the trick, thanks. I tried 5 different cards from 128MB to 4GB and got WRITE times of 32-38 seconds and READ times of 21-29 seconds (except for a SimpleTech 512MB card where the WRITE time was 108 seconds). FAT16 or FAT32 did not seem to affect the timings in any significant way.

Would running at 40MHz (instead of 20MHz) pretty much halve the timings?

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

Post by Steven » Fri Apr 04, 2008 3:16 pm

That's good news (not sure about the SimpleTech card - did it still write and read without errors?). Yes, moving up to 40MHz cuts times almost exactly in half. I usually get write times of approx 15 seconds and read times of around 10 seconds.

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Fri Apr 04, 2008 3:32 pm

Yes, the SimpleTech card did WRITE/READ Ok. The library is nice, thanks for making it available.

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Fri Apr 04, 2008 4:11 pm

Another request. Would it be possible to get a HEX file of your demo program "Demo of most commands in module" ? Again, set up for a PIC18F4620, 20MHz clock and 115200 baud. Same emal address, thanks.

Bryan
Registered User
Registered User
Posts: 18
Joined: Tue Feb 19, 2008 6:50 am
Location: Nelson, B.C. Canada

SD Card Testing with SDFile System Version 4.0.9

Post by Bryan » Fri Nov 07, 2008 6:56 am

Hi Steven, I sure appreciate you sharing your hard work done on the SD File system module. I'm looking forward to including it in the application I'm working on.
I'm in a bit of a pickle and hope you have a minute to point me in the right direction. I'm trying to verify a pcb design that includes a SD card connected to a Pic 18F8722 and am having little to no luck (we're going to build 60 boards next week and I need to be sure the SD card is going to work). I've downloaded your SDFile System Version 4.0.9 and am using it along with your "Sample Code 1 - Demo of most commands in module "
The program runs and I get the menu but doing a dir command or disk size command , it returns without having done anything. I've tried INIT and the program then just hangs up. I'm not sure I'm all that clear on how to use your module yet. do I need to do an INIT to begin with?
Is there any chance that you have a simple routine that might work for me to just check that the SD hardware is working?
If you need any more info from me to help with this please let me know

thanks
Bryan
ps:
-changed the #options to use port D on the 18F8722 for SD connections
-added Memcom=$80 to make port D act as I/O (not memory bus)
-changed - #option USART_BRG16=false (not available in 18F8722)
-used voltage divider resistor arrangement on CS, SDI and SCK as 18F8722 is 5 Vdc and SD Card is 3.3Vdc

User avatar
ohararp
Posts: 194
Joined: Tue Oct 03, 2006 11:29 pm
Location: Dayton, OH USA
Contact:

Post by ohararp » Fri Nov 07, 2008 8:02 pm

Bryan,

Using portd you will only be able to use software SPI and may have trouble running the examples. You use portc and the default pins for the easiest and fastest operation of Steven's module.
Thanks Ryan
$25 SMT Stencils!!!
www.ohararp.com/Stencils.html

Bryan
Registered User
Registered User
Posts: 18
Joined: Tue Feb 19, 2008 6:50 am
Location: Nelson, B.C. Canada

SDFileSystem Version 4.0.9

Post by Bryan » Sat Nov 08, 2008 2:03 am

Hi Ryan, thanks for your interest and your input to my problem, you've got me thinking. I thought that because the 18F8722 had two hardware MSSP modules both supporting SPI that either one would work fine. Is there an issue with the software that I'm not considering?

Thanks
Bryan

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

Post by Steven » Sat Nov 08, 2008 9:29 am

Hi Bryan,

Thanks Ryan for spotting the issue with the second MSSP port. The SD module was written to use the first MSSP if two were available. However, I've just added an option to use the second MSSP - use #option SD_MSSP = 2. You will have to download the latest version from the wiki (now version 4.1.4).

This is an untested change to the module, so I'd be grateful if you let me know how it works.

Bryan
Registered User
Registered User
Posts: 18
Joined: Tue Feb 19, 2008 6:50 am
Location: Nelson, B.C. Canada

SDFileSystem Version 4.0.9

Post by Bryan » Sun Nov 09, 2008 6:24 am

Thank you Steven, I'll download the new version and give it a try first thing tomorrow morning.
I'll let you know how I make out with it.

Bryan

Bryan
Registered User
Registered User
Posts: 18
Joined: Tue Feb 19, 2008 6:50 am
Location: Nelson, B.C. Canada

SDFileSystem Version 4.0.9 to 4.1.4

Post by Bryan » Mon Nov 10, 2008 4:55 am

eureka it works !! Thank you Steven for such a quick fix to the SD File System software and Ryan also for your help. I haven't tried all the SD Card functions yet Steven but Init, dir, mkdir, new file, rename file, serial # all work so I think I can safely say that the circuitry on the prototype PCB is OK.
Thanks again
regards
Bryan

mikeedavila
Posts: 2
Joined: Fri Feb 27, 2009 5:13 pm
Location: Ecuador

version 4.1.4

Post by mikeedavila » Fri Feb 27, 2009 5:24 pm

Steven wrote:Hi Bryan,

Thanks Ryan for spotting the issue with the second MSSP port. The SD module was written to use the first MSSP if two were available. However, I've just added an option to use the second MSSP - use #option SD_MSSP = 2. You will have to download the latest version from the wiki (now version 4.1.4).

This is an untested change to the module, so I'd be grateful if you let me know how it works.
hi, i'm new in the forum,i'm from Ecuador. i'm trying to read a text from the sd memory and view it on a nokia 6100 lcd this is my code. It`s not copleted yet but it has a problem with the compiler. when i tried to compile it, an error happened with the library. it says: SDFileSystem.bas(190): Constant expression expected, and point at

#if SD_MSSP = 1 on the module

can you help me?
thanks for your help and your time

Code: Select all

Device = 18F4550
Clock = 20

#option GLCD_RESET = PORTC.6     // reset pin
#option GLCD_DATA = PORTC.7      // data pin
#option GLCD_CLK = PORTB.1       // clock pin
#option GLCD_CS = PORTC.1        // CS pin
 
#option SD_SPI= SW
#option SD_CS = PORTD.2   'SPI CS to SD CS (SD pin 1)
#option SD_DI = PORTD.5   'SPI DO to SD DI (SD Pin 2)
#option SD_CLK = PORTD.3  'SPI CLK to SD CLK (SD Pin 5)
#option SD_DO = PORTD.4 

// controlador del GLCD
#option GLCD_MODEL = S1D15G00 //controlador del nokia 6225
Include "GLCD.bas"  //módulo de lcd gráfico
Include "Graphics.bas" //módulo de estilos de gráfico
Include "Convert.bas"  // módulo para conversión de variables
Include "Verdana.bas"  //módulo para el tipo de letra
Include "SDFileSystem.bas"

'Dim response As Byte
GoTo inicio
// inicio del programa
inicio:
Cls                         // limpia la pantalla
Brush.Style = bsClear       // tipo de    claro
SetFont(Verdana)            // inicializa el tipo de letra

TextAlign = taCenter        // alineación del texto
WriteStr(64,12,"prueba texto")  //escritura
WriteStr(64,24,"memoria sd")       //escritura
WriteStr(64,36,"nokia 6225")
DelayMS(2000)
Cls
WriteStr(64, 12, "inserte sd")  //escritura

'Repeat
      'response=SD.Init()
'Until response=0
DelayMS(2000)
Cls
WriteStr(64,12,"memoria leída")
DelayMS(2000)
End

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

Post by Steven » Sat Feb 28, 2009 9:24 am

Hello mikeedavila and welcome to the forum. I've not got my usb key with me at the moment, but I'll try and look at it later in the day for you.

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

Post by Steven » Sun Mar 01, 2009 8:28 am

Hi again,

I've now tried compiling your example and it works OK for me, even with the SD code uncommented. Are you using the latest version of the SD module from the wiki (http://www.sfcompiler.co.uk/wiki/pmwiki ... temVersion)? You will need to place this in the Swordfish user library folder if not.

Steve

mikeedavila
Posts: 2
Joined: Fri Feb 27, 2009 5:13 pm
Location: Ecuador

Post by mikeedavila » Sun Mar 01, 2009 10:31 pm

hi Steven, and thank you for your reply. I'm working with the last version of your library and yes, it's on the user libraries folder, but i'm working with the 2.0.2 version of the swordfish compiler, i don't know if that could be the problem....
Thanks again
Regards

Post Reply