EVK1104 --- SD card with FAT?

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One AVR example uses SD card with the MMC with sector read writes. Another example uses FAT with a SPI memory.

Does anybody have either a solution or an example of FAT with the SD card in either MMC or SPI mode? Preferably MMC

I want to load a .wav file from the SD card and store the samples in RAM.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does anyone have any idea?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

http://elm-chan.org/fsw/ff/00ind... use the FATFS sample pjts. --> AVR and port it for the AVR32. See the 2 tutorials in the 'Freaks tut. forum.

1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

The Software Framework already has FAT support with SD card on both MCI and SPI interfaces. It is very complete and works like a charm...

Have you taken a look at the software examples for the AVR32 in the framework?

Daniel Campora http://www.wipy.io

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello ,

how i can write float variable on sd card becuase fprintf does not souport

thank you 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

imora76 wrote:
how i can write float variable on sd card becuase fprintf does not souport
There are two ways I can think of (well more but two of the more obvious):

 

1) Just convert the float to ASCII and write that:

char buff[20];

sprintf(buff, "%f", fp_var);
f_puts(buff, fil);

If fp_var contains 3.141592 then the file will have "3.141592"

 

2) just write the float in binary. float vars are usually just 4 bytes. So:

 

UINT written;
float fp_var = 3.141592;

f_write(fil, &fp_var, 4, &written);

This will actually write something like 0xD8, 0x0F, 0x49, 0x40 to the file which is 3.141592 in little endian IEEE754 format. The reader of the file would then put those 4 bytes back into a float. As log as it also uses little endian and IEEE754 formats then the same value will be recovered.