Comments
Derek Robertson
04 Nov 2011, 05:24
Willaim,
Many thanks... had several attempt (An evening every few weeks) at getting
this implimented on an AVR with Imagecraft ICC avr, but wasn't making much
progress.
Within a few hours of finding your article I was up and running. Tip for
other ICC avr users... you'll have problems with __flash/const. I left all
the low level code alone and created wrapper functons at the top level
i.e.
// Same as f_open, but the path can be a __flash sting
FRESULT cf_open (FIL *fp,__flash XCHAR *path,BYTE mode)
{
cstrcpy(sd_string,path);
f_open(fp,sd_string,mode);
}
lamer
27 Aug 2011, 06:54
I want to use variable filename.
For examble! 1.txt, 2.txt, ... , 1000.txt
How can I do?
Zsolti
10 Apr 2011, 15:26
Hi Chris!
I have a problem.
The code doesn't work for me. :(
The SPI isn't setted up, how to programming and where? in diskio.c or
main.c
And can you give some help to setting up the pins
I use atmega32.
Help me.
Rgds
Zsolt
Chris
21 Jul 2010, 15:23
Hey Tony,
Looks like your project build setup isn't configured properly. You'd have
to give information about how files are compiled and linked.
Tony Peng
21 Jul 2010, 12:30
Why am I getting these errors?
I can't even use f_mount...
http://mibpaste.com/IUoRv9
Pim
10 Jun 2010, 09:07
Hello,
Everything went well. After completing your tutorial and adding the
get_fattime function I got these linker errors.
What should I do??
C:\projects\src\test\default/../ff.c:845: undefined reference to
`ff_wtoupper'
C:\projects\src\test\default/../ff.c:1300: undefined reference to
`ff_convert'
I really need this to work and log some information on my sd via an
Atmega
Avrith Doug
16 Apr 2010, 19:01
Hello,
I'm trying to figure out exactly how much memory space FatFS takes on a
MCU? Went on the project's website, but it's still not clear to me...
Can you clarify?
Thanks
Powerman
07 Mar 2010, 16:10
Forgot to say THANK YOU William!
Your code and explanation are greatly appreciated!
Cheers!
Trevor
Powerman
07 Mar 2010, 16:06
I have this code "modified" and working with SDHC cards. I'm using an
ATMega128 running at 16MHz.
1. replace OCR0A = 78 with OCR0A = 156
2. replace Timer = 100 with Timer = 200 in disk_initialize()
I use a transistor to control the power to the card. This is controlled by
PB7. 0=Power to Card, 1=No Power to Card.
I have tested using a 4GB SDHC, and a 16GB SDHC. Both cards work well. One
issue however is that you cannot delete the file often times while in
Windows reading the card. The only way to remove it is to format the card.
Writing over the existing file from the micro controller's perspective
seems to work fine.
uthenb
03 Oct 2009, 14:14
Thanks Chris for the reply and share current information on this page.
Chris
03 Oct 2009, 11:31
This page doesn't support SDHC (high capacity)
You can use the fatfs library to put a FAT32 filesystem on those cards, but
you'd need to rewrite the diskio code. I don't have any information on how
the SDHC io differs from the normal SD cards.
uthenb
03 Oct 2009, 10:43
Hi Chris.
Code FatFs supported SDHC or not?
Please reply thanks.
http://www.10logic.com.
William Douglas
29 Sep 2009, 22:06
Did you get the two function calls, disk_initialize() and f_mount(), in the
wrong order?
From the documentation, it appears that the disk must be initialized before
the f_mount function can be called. In fact, it states that calling the
initialize function when the drive is registered to a work area can cause
serious problems.
Graham Harris
27 Aug 2009, 15:43
Hi Chris,
Yes the switch is not locked and I can read and write to the SD via my PC.
Now your code to trap errors has shown that the return from disk_initialize
is 0x06 which is none of the failure values mentioned in the header file.
Now I'm puzzled as to the purpose of the power on code fragment and was
wondering if this maybe the issue. BTW I'm using the ATMega128.
Rgds
Graham
Chris
27 Aug 2009, 13:19
Hi Graham Harris,
>One comment : are you sure the vdd and gnd pinouts are correct? I ask
as the pinouts I've seen are as follows.
I'll double check it myself by building a circuit, then I'll take a picture
and post it. I used an image off another site and edited it a bit (shhh..)
so I guess it could be wrong.
>f_mount returns FR_OK but when I run f_open I get FR_WRITE_PROTECTED
and cannot see where I'm going wrong.
Double check to make sure that the little switch thing on the side is in
the "read/write" mode and not the "read only" mode. Mine isn't labeled so I
had to try both. I'll update the page to reflect this pitfall. The switch
is tiny and easy to miss.
Good luck.
Graham Harris
27 Aug 2009, 11:01
Hi
Excellent document well done.
One comment : are you sure the vdd and gnd pinouts are correct? I ask as
the pinouts I've seen are as follows.
pin 4 Vdd
pin 3&6 GND
The rest agree.
Also I was wondering if you came across this issue as I'm debugged out at
the moment.
Disk_initialise is sucessful
f_mount returns FR_OK but when I run f_open I get FR_WRITE_PROTECTED and
cannot see where I'm going wrong.