Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

[PIC] Proteus FAT32 MMC/SD Card Simulation

Status
Not open for further replies.

djeceymca

Junior Member level 2
Joined
Mar 17, 2017
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
196
Hello Guys,

I am new to this forum.

Need your help to simulate my in Proteus.

How can I integrate FAT32 SD card in Proteus considering Proteus support only mmc type.

I did try to create sd image using winimage, but still simulation not working.

Your help very much appreciated.

Regards,
Dev
 

Okada

Banned
Joined
Jun 16, 2016
Messages
1,159
Helped
128
Reputation
252
Reaction score
127
Trophy points
63
Activity points
0
I have tried and many others have tried but Proteus MMC Card model works with only FAT16 system. It doesn't work with mikroE FAT32 library.
 

pjmelect

Advanced Member level 2
Joined
May 13, 2012
Messages
532
Helped
122
Reputation
244
Reaction score
120
Trophy points
1,323
Activity points
4,482
The Proteus MMC/SD card simulation works fine with a FAT32 image. The initialization of the MMC card is a bit different to that of a SD card but can be incorporated into your code. It probably does not work with the mikroE library because it does not initialize a MMC card.

Code:
;Set card select and data high
;Send 80 SPI clock cycles to put in SPI mode
;Set card select low
;Send CMD0 [0x400000000095] wait one byte, read response code R1 = 0x01 (idle) R1 = 0FFH (No SD card) retry if error
;(Some cards require one byte read after response code.)
;Send CMD8 [0x48000001AA87]
;R1 = 0x05 (idle and illegal command)
;If illegal command set flag to indicate v1 or MMC card
;If legal command check R3 response bits 0-8 is 1AAH, if not incorrect voltage.
;
;Send CMD55 [0x770000000065] R1 response code
;If illegal command, card is MMC don't send ACMD41
;Send ACMD41 [0x6900000000E5] with bit 30 set high if valid CMD8 flag, and Loop to command 55 waiting for high bit on 
;response to go low
;
;If illegal command 55 Send CMD1 [0x4100000000F9] (for MMC) and Loop waiting for high bit on response to go low
;R1 = 0x05 (idle and illegal command) if illegal command exit

;Card is now active.
;Send CMD16 {0x500000020095} to set block size
;R1 response
;Send CMD58 {0x7A0000000095} to determine card type
;R3 response, check CCS bit 30 (high if high density card)skip if illegal instruction 
;
;Send read or write command, bit 9 is second 512 block on low density cards and bit 0 is second block on high density cards.
;
 

djeceymca

Junior Member level 2
Joined
Mar 17, 2017
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
196
Thanks Guys for your response.

@pjmelet: I am using MickroC compiler to build my code, is there any way I can use your code in it?
 

pjmelect

Advanced Member level 2
Joined
May 13, 2012
Messages
532
Helped
122
Reputation
244
Reaction score
120
Trophy points
1,323
Activity points
4,482
@pjmelet: I am using MickroC compiler to build my code, is there any way I can use your code in it?
I do not know C, the code i gave was simply the comments that I extracted from my PIC18F assembly language program that initializes the SD card that works on both a real SD card and in Proteus. You will have to modify your library that initializes the SD card.

Another limitation with the Proteus simulation of a MMC/SD card is that you are limited to a maximum size of card to 120MB which you have to specify in the properties of the MMC/SD card, the default size is much smaller. If you use an image file of a SD card that is larger than this then Proteus will give an error if you try to access a memory location higher than this. The image file should have the extension of .MMC
 

Okada

Banned
Joined
Jun 16, 2016
Messages
1,159
Helped
128
Reputation
252
Reaction score
127
Trophy points
63
Activity points
0
I successfully tested mikroE FAT32 Library with Proteus MMC model with a 1 GB disk image file. It works fine. Maybe mikroE updated the library so that it works with Proteus or maybe Labcenter updated the MMCU model to work with mikroE FAT32 library. I will post the example project later. My net connection is slow and can't upload files now. I will switch my net connection later and then I will post the tested project.

I created the 1 GB disk image for Proteus using WinImage 9.0.
 

Okada

Banned
Joined
Jun 16, 2016
Messages
1,159
Helped
128
Reputation
252
Reaction score
127
Trophy points
63
Activity points
0
Here is the mikroC PRO PIC FAT32 Test Project. Also Proteus Simulation file is included. It is in Proteus 8.6 SP2 format. For testing you have to create a 1 GB Disk Image file using WinImage 9.0. I can't post the 1 GB disk image file here.
 

Attachments


mincusv7

Newbie level 1
Joined
Jul 21, 2017
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
4
Here is the mikroC PRO PIC FAT32 Test Project. Also Proteus Simulation file is included. It is in Proteus 8.6 SP2 format. For testing you have to create a 1 GB Disk Image file using WinImage 9.0. I can't post the 1 GB disk image file here.
Thank you ... It was proteus version ... I could simulate my project without any error MMC CMD !!! I thank you for your contribution ...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top