Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 03, 2016, 12:37:33 12:37


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 47136 times)
0 Members and 1 Guest are viewing this topic.
fagari
Junior Member
**
Offline Offline

Posts: 35

Thank You
-Given: 3
-Receive: 41


« on: November 20, 2007, 11:24:43 23: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, 04:58:47 04: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
V.I.P
Newbie
*****
Offline Offline

Posts: 17

Thank You
-Given: 4
-Receive: 2


« Reply #2 on: November 21, 2007, 03:51:10 15: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, 03:32:14 15:32 »

in theory, mmc and sd are same

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

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

Posts: 26

Thank You
-Given: 23
-Receive: 4


« Reply #5 on: November 27, 2007, 05:42:54 05: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, 12:13:32 12: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: 26

Thank You
-Given: 23
-Receive: 4


« Reply #7 on: November 27, 2007, 02:57:33 14: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: 3
-Receive: 41


« Reply #8 on: November 27, 2007, 03:06:24 15: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: 26

Thank You
-Given: 23
-Receive: 4


« Reply #9 on: November 27, 2007, 07:55:49 19: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, 09:27:54 21:27 »

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

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

Posts: 149

Thank You
-Given: 18
-Receive: 124



« Reply #11 on: November 29, 2007, 10:09:05 10: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: 3
-Receive: 41


« Reply #12 on: November 29, 2007, 07:26:57 19: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
***
 Muted
Offline Offline

Posts: 149

Thank You
-Given: 18
-Receive: 124



« Reply #13 on: November 30, 2007, 12:08:12 12: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: 3
-Receive: 41


« Reply #14 on: November 30, 2007, 11:05:56 23: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
***
 Muted
Offline Offline

Posts: 149

Thank You
-Given: 18
-Receive: 124



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

Hi, Fagari,

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

Regards,
Marineland
Logged
mikepic
Newbie
*
Offline Offline

Posts: 19

Thank You
-Given: 13
-Receive: 8


« Reply #16 on: December 05, 2007, 04:13:04 16: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: 9

Thank You
-Given: 8
-Receive: 0


« Reply #17 on: December 23, 2007, 12:29:54 12: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, 03:04:13 03:04 »

Thanks fagari! I can pat use !
Logged
Trump
Guest
« Reply #19 on: December 28, 2007, 09:28:41 21: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
*
 Muted
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, 10:13:47 10: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, 10:34:22 10:34 by xzb » Logged
fr5cu
Guest
« Reply #22 on: May 14, 2008, 03:24:41 15:24 »

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

Posts: 72

Thank You
-Given: 15
-Receive: 119


end of file


WWW
« Reply #23 on: June 02, 2008, 05:53:07 05: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, 08:07:44 08:07 »

hi kireytir
you delete except source .c and .h fiile,afresh the compiler ok!
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