MCF51QE/JM interfacing a microSD Card

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MCF51QE/JM interfacing a microSD Card

跳至解决方案
10,697 次查看
sebasira
Senior Contributor I

Hello everybody!!

 

I'm developping an application and I need to write/read some data in a microSD Card.... I have Freescale's Flexis JM  SD Card Reader, hardware and software... If I'm not wrong, documentation DRM104 refers to it.

 

This Freescale's hardware comes with 2 demo softwares:

1- SD Card Datalogger

2- SD Card Reader (USB-SD Reader)

 

Both softwares work fine... The datalogge logs the lumens or lux sensed (I don't remember wich one). Then, with the other soft. I can see the file content...

 

Now, for my application I want to use a microSD instead of a SD Card [Note: for the communication I use a SPI, not the SD Card Protocol]... So, to test if it's working I log the data wiht my own application and read the content wth Fresscale's Card Reader (I put the microSD in a SD adapter)...

Well nothing happens... I can read the microSD Card, but it's empty...

 

So then I use the microSD with Freescale's Datalogger (again, the microSD inside a SD adapter)... For my sourprise, nothing happens, one more time....

 

 

Once, I remember being in a Freescale Seminaire... And if I recall correctly, someone told me that NOT every microSD can be access by SPI.... So my question is... is that true? Does the microSD Card have other interfacing needs?

 

 

Thanks all of you!!!!

标签 (1)
1 解答
6,730 次查看
sebasira
Senior Contributor I

Well... I've finally solved it... It wasn't a timing problem, I just re-format the 2 microSD cards and they  worked fine

在原帖中查看解决方案

0 项奖励
回复
24 回复数
913 次查看
gustavod
Contributor III

 

The FAT File System of freescale with some bug fixes was posted on:

http://code.google.com/p/brtos/downloads/list

 

Now supports up to 512 MB and the list function is working correctly.

The corruption of files was also fixed.

 

Best Regards,

Gustavo

0 项奖励
回复
913 次查看
HummingbirdElec
Contributor I

Hi Gustavo

 

I've downloaded and had a really good look at your FAT implementation.  You mention that it now supports up to 512 MB.  I can't see any difference between the 2 versions that would make this difference.  From what I see, the array that stores the FAT entries (INT8U  u8buffer[512]:smileywink: is 512 bytes in size and can therefore store 256 entries.  With a max cluster size of 64k, that equals 64k x 256 = 16 384k.  What am I missing?

 

Best regards, Norman

0 项奖励
回复
913 次查看
gustavod
Contributor III

Hi Hummingbird Electronics,

 

The calculation is not so simple. For a 512MB SD card there are 32 sectors per cluster.

  512 MB - 1023 MB    16-bit        32        16K

Therefore:

32 * 512 = 16K (Cluster size)

And,

16K clusters * (64k/2) = 512MB

 

Right now i'm using other FAT file system implemention. This new file system supports FAT32 and directory structures. You can download the code in this links:

 

Coldfire JM128 Demo:

http://brtos.googlecode.com/files/TWR-LCD-FatFS.rar

 

Coldfire QE128 Demo:

http://brtos.googlecode.com/files/BRTOS%20CFV1%20SD%20Card%20%2B%20FatFS.rar

 

Best Regards,

Gustavo

0 项奖励
回复
913 次查看
HummingbirdElec
Contributor I

I downloaded the bug fix, but the fat.c and sd.c files seem to be missing - they show in the project window, but when you click on them, the file is not found.  I searched the downloaded projects and can't find the files.  Can you please re-post the entire project.

0 项奖励
回复