Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 26, 2024, 07:24:14 07:24


Login with username, password and session length


Pages: 1 2 [All]
Print
Author Topic: SD MMC Card Fat16 Demo in CCS C and Proteus Design File  (Read 59361 times)
0 Members and 1 Guest are viewing this topic.
fagari
Junior Member
**
Offline Offline

Posts: 35

Thank You
-Given: 4
-Receive: 41


« on: November 20, 2007, 10:24:43 22:24 »

Here is my SD MMC Card Fat16 Example project.

It is very good Example for SD MMC Card.
 
Demo Read CONTURY.TXT in SD CARD and Send RS232 port.

Sorce code and Proteus file  Link:

http://rapidshare.com/files/71131573/SD_MMC.rar
Logged
ysy
Guest
« Reply #1 on: November 21, 2007, 03:58:47 03:58 »

I dont like ccs, its buggy. microchip produce pic12 pic16 pic18 pic24 pic33, their  c
 compilers are different, features in c18 and c30 and c32 are also different. i think  developers using them are hard to learning these products and tools.
Logged
bxac
Newbie
*
 Muted
Offline Offline

Posts: 18

Thank You
-Given: 4
-Receive: 2


« Reply #2 on: November 21, 2007, 02:51:10 14:51 »

Proteus has model for MMC. Is this going to work if I want the final design with SD?
Logged
aj49m
Active Member
***
Offline Offline

Posts: 102

Thank You
-Given: 36
-Receive: 41


« Reply #3 on: November 22, 2007, 02:32:14 14:32 »

in theory, mmc and sd are same

Logged
endSly
Guest
« Reply #4 on: November 25, 2007, 02:04:46 14:04 »

MMC and SD are no identical. SD is a little more fat
Logged
incubus22
Newbie
*
Offline Offline

Posts: 25

Thank You
-Given: 23
-Receive: 4


« Reply #5 on: November 27, 2007, 04:42:54 04:42 »

Here is my SD MMC Card Fat16 Example project.

It is very good Example for SD MMC Card.
 
Demo Read CONTURY.TXT in SD CARD and Send RS232 port.

Sorce code and Proteus file  Link:

http://rapidshare.com/files/71131573/SD_MMC.rar


Hello fagari!  Smiley

How did you make the image file (COUNTRY.TXT) into a Proteus MMC image (cardimage.mmc)? What program did you use? Please teach me how. Can I convert any text file into this image (cardimage.mmc)?

How about the reverse? I mean, when I want to convert the cardimage.mmc to a text file. Is this possible?
Logged
sslobodyan
Newbie
*
Offline Offline

Posts: 11

Thank You
-Given: 1
-Receive: 2


« Reply #6 on: November 27, 2007, 11:13:32 11:13 »

With WinHex you can read some sectors from your floppy or hard disk. I just save file to clean floppy and save some sectors from floppy to cardimage.mmc. Floppy has FAT16, hard disk FAT32.
Logged
incubus22
Newbie
*
Offline Offline

Posts: 25

Thank You
-Given: 23
-Receive: 4


« Reply #7 on: November 27, 2007, 01:57:33 13:57 »

With WinHex you can read some sectors from your floppy or hard disk. I just save file to clean floppy and save some sectors from floppy to cardimage.mmc. Floppy has FAT16, hard disk FAT32.

Thanks for replying!  Smiley

Can I convert a certain file in my hard disk(for example sample.txt) into cardimage.mmc? How do I do this? There are many convert options in WinHex. Which one should I choose? Please teach me how. It's my first time to use WinHex.

Also, after manipulating the cardimage.mmc in Proteus using a PIC18F(with FAT32 implementation), can I bring it back to the text file format which can be understood by Windows? I am confused with this because I can't understand the data whenever I open cardimage.mmc with Wordpad or Winhex.










Logged
fagari
Junior Member
**
Offline Offline

Posts: 35

Thank You
-Given: 4
-Receive: 41


« Reply #8 on: November 27, 2007, 02:06:24 14:06 »

Hello incubus22

I use 32 MB SD Card and copy CONTRY.TXT in SD Card.
after make image file with WinHex.

if you don't have sd Card.

You can use 'USB Flash Disk Example' in the Protus 7.2

Logged
incubus22
Newbie
*
Offline Offline

Posts: 25

Thank You
-Given: 23
-Receive: 4


« Reply #9 on: November 27, 2007, 06:55:49 18:55 »

Hello incubus22

I use 32 MB SD Card and copy CONTRY.TXT in SD Card.
after make image file with WinHex.

if you don't have sd Card.

You can use 'USB Flash Disk Example' in the Protus 7.2



Thank you very much fagari!  Smiley I'll try it.
Logged
aj49m
Active Member
***
Offline Offline

Posts: 102

Thank You
-Given: 36
-Receive: 41


« Reply #10 on: November 27, 2007, 08:27:54 20:27 »

MMC and SD are no identical. SD is a little more fat

i refered me to protocolo, case SPI
Logged
Marineland
Active Member
***
Offline Offline

Posts: 149

Thank You
-Given: 18
-Receive: 124



« Reply #11 on: November 29, 2007, 09:09:05 09:09 »

Hi fagari,

Here's a difference between both SD Image file, I explain:
You file (cardimage.mmc) is a FAT16 and the file (disk.bin) from Proteus sample is a FAT12.
Thus, if i try to use your file (cardimage.mmc) in the simulation, windows don't create a virtual "PROTEUS USB" mass storage... (btw: there's not source to change in FAT16 in Proteus sample directory).
I've not yet find another "Virtual USB Mass Storage" on the web! Sad
If you or anybody have a answer, it's welcom... Smiley

Regards,
Marineland
Logged
fagari
Junior Member
**
Offline Offline

Posts: 35

Thank You
-Given: 4
-Receive: 41


« Reply #12 on: November 29, 2007, 06:26:57 18:26 »

Hi Marineland

1. Copy 'cardimage.mmc'(in my project) file to 'Proteus 7 Professional\SAMPLES\VSM for USB\PICDEM FS USB\MSD' directory.

2. Open picdem 'fs usb.dsn' file with Proteus.

3. Right click on the MMC and select 'Edit Properties'.

4. Change Size of Media(MB) to 32 and Card Image File to 'cardimage.mmc' and press Ok.

5. Run simulation and plug usb connector.

6. You must see new removeble drive in my computer.


File read ok. but write and format have problem.

Posted on: November 29, 2007, 07:19:54 19:19 - Automerged

Hi Marineland again

Proteus sample file imformation :

The USB firmware used in this sample is freely available from the Microchip
Technologies website (Application Note  AN1003) and has not been modified.

AN1003 application support FAT16, FAT32 or NTFS file system.






Logged
Marineland
Active Member
***
Offline Offline

Posts: 149

Thank You
-Given: 18
-Receive: 124



« Reply #13 on: November 30, 2007, 11:08:12 11:08 »

Hi Fagari,

Thanks for the response...  Smiley
I'v followed yours instructions but the simulation failed:
This's the error: "Can't ceate or open card image file: cardimage.mmc"

What i'm doing wrong?  Huh

Regards,
Marineland
Logged
fagari
Junior Member
**
Offline Offline

Posts: 35

Thank You
-Given: 4
-Receive: 41


« Reply #14 on: November 30, 2007, 10:05:56 22:05 »

Hi Marineland,

My MSD Project is here.

http://rapidshare.com/files/73423843/MSD.rar

Try this.

if your problem going on, try reinstall proteus.

Good luck.

Logged
Marineland
Active Member
***
Offline Offline

Posts: 149

Thank You
-Given: 18
-Receive: 124



« Reply #15 on: December 01, 2007, 02:27:14 14:27 »

Hi, Fagari,

I've tried your project and It's works fine... Cheesy
Thanks again...

Regards,
Marineland
Logged
mikepic
Newbie
*
Offline Offline

Posts: 23

Thank You
-Given: 18
-Receive: 8


« Reply #16 on: December 05, 2007, 03:13:04 15:13 »

Hi,

I'll try your project, because some time ago I tried to make a project with SD card and CCS libraries, but it didn't work at all

Thanks
Logged
kev
Newbie
*
Offline Offline

Posts: 8

Thank You
-Given: 12
-Receive: 0


« Reply #17 on: December 23, 2007, 11:29:54 11:29 »

Thanks for the info, I'll try your project as soon as I am allowed to se the links !
Logged
xzb
Newbie
*
Offline Offline

Posts: 27

Thank You
-Given: 16
-Receive: 5


« Reply #18 on: December 28, 2007, 02:04:13 02:04 »

Thanks fagari! I can pat use !
Logged
Trump
Guest
« Reply #19 on: December 28, 2007, 08:28:41 20:28 »

Hm.... The driver work, but I have some problem in open files in the root, only the first file open. Files in other folder are OK. And how I close a file?
Logged
sevesa
Newbie
*
Offline Offline

Posts: 8

Thank You
-Given: 0
-Receive: 0


« Reply #20 on: March 14, 2008, 11:24:49 23:24 »

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en532040

Memory Disk Drive File System Library

Logged
xzb
Newbie
*
Offline Offline

Posts: 27

Thank You
-Given: 16
-Receive: 5


« Reply #21 on: May 13, 2008, 09:13:47 09:13 »

I use this Project proteus OK,but a true  PIC18F252 failing.
why?
   SD 128M

see following data.

**** SD / MMC FAT16  Read Demo for Sonsivri ****                                               
Now Open File on SD Card                       

cmd0   

 cmd=40       
 FF 01     
 cmd=41       
 FF 01 FF FF FF FF FF FF FF FF FF FF FF FF                                         
F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF                                                                               
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F                                                       
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F                                                                               
F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF                                                               
cmd1   

 cmd=41       
 FF 00     
 cmd=50       
 FF 00     
 cmd=51       
 FF 00     
 read block address=0                     

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00        //proteus display:  sector0=EB 3C 90 4D 53 44 4F 53 35 2E 30 00 02 04 04 00 02 00 02 00 00 F8 F2 00 3F 00 FF 00 61 00 00 00                 
 cmd=51       
 FF 00     
 read block addr =32              

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 00 00 00 00 00                  
 cmd=   
 FF 00     
 read block address=64                     

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=96                     

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=128                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=160                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=192                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=224                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51     
 FF 00     
 read block address=256                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=288                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=320                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51     
 FF 00     
 read block address=352                       

**** SD / MMC FAT16  Read Demo for Sonsivri ****                                               
Now Open File on SD Card                       

cmd0   

 cmd=40       
 FF 01     
 cmd=41       
 FF 01 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F                                                                               
F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF                                                                               
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF                                                                               
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F                                                                               
F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF                                                           
cmd1   

 cmd=41       
 FF 00     
 cmd=50       
 FF 00     
 cmd=51       
 FF 00     
 read block address=0                     

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=32                     

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 0                   
 cmd=51       
 FF 00     
 read block address=64                     

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0                                                                             
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=96                     

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=128                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=160                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=192                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=224                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=256                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                             
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=288                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=320                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=352                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                             
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=384                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=416                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 00 03                       
 cmd=51       
 FF 00     
 read block address=448                       

 read block tries for FE =2                           

 sector0=02 00 06 07 E0 C9 61 00 00 00 9F C9 03 00 00 00 00 00 00 00 00 00 00 00                                                                             
 00 00 00 00 00 00 00 00                       
 cmd=51       
 FF 00     
 read block address=480                       

 read block tries for FE =2                           

 sector0=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                               
 00 00 00 00 00 00 55 AA                       
 cmd=51       
 FF 00     
 read block address=512
« Last Edit: May 13, 2008, 09:34:22 09:34 by xzb » Logged
fr5cu
Guest
« Reply #22 on: May 14, 2008, 02:24:41 14:24 »

can you read an other type of card?
Logged
MCan
Junior Member
**
Offline Offline

Posts: 72

Thank You
-Given: 15
-Receive: 119


end of file


WWW
« Reply #23 on: June 02, 2008, 04:53:07 04:53 »

when i compile your code, compiler show a message box (i/o error 103)

Logged

aquila non captat muscas.
xzb
Newbie
*
Offline Offline

Posts: 27

Thank You
-Given: 16
-Receive: 5


« Reply #24 on: June 02, 2008, 07:07:44 07:07 »

hi kireytir
you delete except source .c and .h fiile,afresh the compiler ok!
Logged
eeyrw
Guest
« Reply #25 on: July 23, 2008, 05:41:30 17:41 »

How to edit the file in the Image?Using winhex??
Logged
manish12
Active Member
***
Offline Offline

Posts: 163

Thank You
-Given: 44
-Receive: 39


« Reply #26 on: January 30, 2009, 09:20:31 09:20 »

i am getting same i/o error 103 .

what is the sol of this error ?
Logged
xzb
Newbie
*
Offline Offline

Posts: 27

Thank You
-Given: 16
-Receive: 5


« Reply #27 on: March 02, 2009, 03:05:28 03:05 »

the data saved in MMC is very important, so I want to locked MMC. That means one who dosen't have password can not to access data on the card.I just know to use CMD42, but I can not understand CMD42's command data block.I use mcc18 SPI mode. Can you help. Thanks!
Logged
vegekou
Guest
« Reply #28 on: November 30, 2011, 11:30:44 11:30 »

hello can you tell me how to use file_write(int8 fnbr int *buffer)
to write some opened file.When I use it first time it write but I could'nt read next time. Help it is hotting now.
Logged
Pages: 1 2 [All]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC