Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

[SOLVED] How to make Mass Storage SD Card Reader Using PIC18F2550???

Status
Not open for further replies.

xpress_embedo

Advanced Member level 4
Advanced Member level 4
Joined
Jul 5, 2011
Messages
1,154
Helped
161
Reputation
396
Reaction score
189
Trophy points
1,353
Location
India
embeddedlaboratory.blogspot.in
Activity points
10,591
Hello!! Everyone.
In my project i have to make a Mass Storage Device, to show the contents of the memory card on PC when connected through PC using USB Port.

Is it possible to do this, as Microchip Application Framework doesn't support this.

Please help me how to implement this.

If this is supported on any other compiler, i will do this in that.
 

The Microchip Application Library USB Device - Mass Storage - SDCard Reader example should do exactly what you want.
 

The project has predefined configurations for existing Microchip evaluation boards, including some PIC18 based. It's not a big thing to modify it for a different USB PIC18.
 

Thanks for your replies.

I modified the PIC18F47J53 SD Card Reader Project.

Right now i am changing it for PIC18F4550, after so many errors, i am getting one last error.
And it is associated with Linker.

Code:
MPLINK 4.40, Linker
Device Database Version 1.3
Copyright (c) 1998-2011 Microchip Technology Inc.
Error - could not find definition of symbol 'GetInstructionClock' in file 'Objects\47J53_PIM\SD-SPI.o'.
Errors    : 1
I am also getting one warning while compiling
Call of function without prototype and it is associated with this function

Code:
void Delayms(BYTE milliseconds)
{
    BYTE    ms;
    DWORD   count;
    
    ms = milliseconds;
    while (ms--)
    {
        count = MILLISECDELAY;
        while (count--);
    }
    Nop();
    return;
}
I am not getting what is the problem, it is related with instruction cycle, but i am not getting how to solve this
 

I solved the last problem i am getting, My Program is compiling fine, but the problem is that i am getting this error in proteus

Error.png

:-(
Please someone help
 

Hello!! Everyone i am uploading my Project files.

The problem is that, My PC detects it as Microchip Mass Storage Device but didn't do anything, as it can be seen in the above snapshot.

I am stuck didn't know what to do next.

I had modified the PIC18F47J53 SD Card Demo for PIC18F4550.
But the PIC18F4550 Demo is Not working while PIC18F47J53 Demo is working.
Please Suggest me something to do.
View attachment microchip_solutions_v2013-02-15.zip
 

How are you operating the SD card software? Your previous post suggests a Proteus simulation. Seriously speaking, I have no idea if and how the simulation interfaces correctly to the Windows OS. I'm not using Proteus for real projects and can't support Proteus related problems, except for trivial issues like missing GND connection.

IF you are operating the design in real hardware, it's still a complex problem according to the complexity of USB MSD framework. I formerly implemented a MSD device on a Mitsubishi processor from the scratch and know what I'm talking about. The Microchip application examples are basically of good quality and MPLAB debugging tools can show you everything inside the processor and PIC18 software you need to know. Additionally the PC side communication can be traced by USB software monitors.

P.S.: You didn't show yet specific error messages besides the yellow exclamation mark. As a first step, you would want to check, what the PC is recognizing up to now and at which point the communication fails.
 
Last edited:

P.S.: You didn't show yet specific error messages besides the yellow exclamation mark. As a first step, you would want to check, what the PC is recognizing up to now and at which point the communication fails.

This error is due to slow simulation and excessive CPU load and i will run the code on real hardware and will display the usblyser report here.
 

Finally i tested my code on real hardware.
What i found is Microchip Mass Storage Device detected successfully but nothing happens means i am not able to view the Removable Disk Drive as supposed to be.

Detected Successfully.png

No Disk Drive appears, :-(

What should i do now.

I am also attaching UVC View Software Snapshot when this device is connected.

UVC Software Snapshot.png


And this is the USBlyzer Software file which i save when connected that device.
View attachment Arun.zip

Please help me
 

Please Suggest me something.
How can i solve this.

Does anyone had seen the PICDEMFS USB MSD example in proteus samples folder, i just want that type of thing.

Till now Microchip Mass Storage Device is Detected(without yellow exclamation mark in device manager) but no Drive is found in windows explorer.

Please help me

- - - Updated - - -

Have a look at this, it is showing I drive means some thing is there, but nothing appears in windows explorer

Showing I Drive.png



No I Drive Here.png
 

1. The missing string descriptors might be a problem
2. Besides correct USB device data, a valid media partition table must be read before a drive is shown in explorer, I think.
 
1. The missing string descriptors might be a problem
2. Besides correct USB device data, a valid media partition table must be read before a drive is shown in explorer, I think.




I dont know how to correct this.
Microchip framework help pdf shows that this must work.

I will add strung descriptor but i am.not getting your second point.
 
My second point guesses about the possibility that no valid partition table is read from the media and transferred to the PC. In this case it won't be an USB problem.

As a general point, Windows makes some "presumptions" about USB mass storage devices that are not exactly obvious from the MSD specification. The best way to find out why an implementation fails might be to compare each step of enumeration and initial device data transfer with a known working USB memory device.
 

As a general point, Windows makes some "presumptions" about USB mass storage devices that are not exactly obvious from the MSD specification. The best way to find out why an implementation fails might be to compare each step of enumeration and initial device data transfer with a known working USB memory device.

How to do this.

And my spi is not working, dont know why.

It is working in starting not after that. i checked the pulses on oscilloscope
 

Finally some good news.

I finally made hardware for PIC18F47J53 Micro-controller as per there SD Card Reader Demo, as per circuit diagram below.


PIC18F47J53.gif


When I didn't connect the VDDCORE/Vcap and Vusb pin with nothing, similar affect happens as i am facing with pic18f4550.

When as soon as connecting these pins with +3.3V everything is working fine, mass storage is detected and a drive is shown in windows explorer with all the files present in it.
But the speed is really very slow, it is working but very slowly, but it is okay with me.

Now can anyone tell me the significance of these pins VDDCORE/Vcap and Vusb

and in PIC18F4550 based hardware i had connected Vusb pin to ground with a capacitor of 220pF in between.
I am going to give it a +5V or +3.3V after reading sufficient details about this pins.

Please suggest me something..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top