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.

Interfacing single memory card with two Micro-Controller's??

Status
Not open for further replies.

xpress_embedo

Advanced Member level 4
Joined
Jul 5, 2011
Messages
1,154
Helped
161
Reputation
396
Reaction score
189
Trophy points
1,353
Location
India
Activity points
10,591
Hello!! Everyone

I am making project in which i have to provide mass storage device also.
I am using PIC18F8722 Micro-controller and with the help of which i am creating log into the memory card.
But as PIC18F8722 Doesn't support USB, i have to use another controller for this purpose and i am using PIC18F2550 as a mass storage device.
But can i directly connect the Memory Card pins with the two controllers.
I want to know how can i do this.
As i can implement MSD with PIC18F2550, but how to share a single card with both controllers.

Please suggest me a way of doing this.
 

why not try and use a single micro-controller say something that supports USB ?? I think 18F2550 can easily handle USB and memory card...

sharing the card might be possible if you implement a system of communication where only one mcu accesses the memory card. A signal line between the two mcu could be used to indicate which mcu gets to use the memory card.

If say mcu 1 needs to use the card, it checks the status of the line (low means card is free) and sets the line high (if low), indicating the card is busy, after the card has been used the line is set low, this will indicate the card is free. The second mcu can do a similar exercise..check status line and set busy condition..and then finally clear the busy state...

I think this kind of scheme is called a semaphore...but I may be wrong....

I have used a similar scheme where one PIC communicate with a load cell amplifier ADC, and another extracted the ADC data and another PIC stored the data in a FRAM..

thanks
a
 

Thanks for your reply.

I cant use pic18f2550 as it is having much less ram and rom

my half project is on pic18f8722
Thats why dont want to change.
Just want to add msd sort of thing into it.

And i am tring it will report if it works or not
 

Hello Everyone!!!

I had shared the memory card with PIC18F8722 and PIC18F2550.
The one thing i had done is that, PIC18F2550 is powered only through usb port, means only when someone attach the USB.

and PIC18F8722 is powered through the power supply.
The pic18f8722 and pic18f2550 are not connected with each other just gnd is connected and the memory card pins are connected.

Both are powered using separate supplies.

The problem i am facing is that, when i power on the pic18f8722 and the pic18f2550 is attached on the board, with no power to it.
It is getting some power, i don't know from where, it gets started then restart within a seconds.
And my memory card is not detected by pic18f8722, but when i remove the pic18f2550 from the board everything works fine.

Can anyone tell me how to solve this problem.
This is my pcb

EDA Board.jpg

Please help without this, i will not be able to proceed further
 

You can change the PIC18F2550 operation from bus powered to self powered.
 

Self Powered means, it is getting power from supply,
How it will solve my problem o_O,

I didn't get that.

The problem is that PIC18F2550 gets on due to some reason and voltage across the pins of Memory Card decreases and thats why i am not able to run the Memory Card.
If my pic18f2550 will run also my power consumption of circuit will increase and i have to reduce this also.
 

Apparently, you did neither analyze the SPI bus paralleling nor the power supply problem thoroughly.

1. Unless you have multiplexers combining the two bus masters, both must be powered, and one of them threestated to avoid blocking the bus.

2. PIC processors can be powered with about zero power consumption if you configure them respectively.

Finally, there are of course PIC18 types that have 128 kB flash and USB capability.
 

Apparently, you did neither analyze the SPI bus paralleling nor the power supply problem thoroughly.


I had analyzed both, it may be possible that, i missed something, but will surely find that.
I had not checked the SPI Pulses on Oscilloscope with PIC18F2550, but without PIC18F2550 they are working fine.

PIC processors can be powered with about zero power consumption if you configure them respectively.
Please tell me the configuration, Enabling Brown Out Reset and Enabling Power On Timer Will solve this problem.

Finally, there are of course PIC18 types that have 128 kB flash and USB capability.

Yes know, unfortunately i didn't pick the right controller, :-(
 

Please tell me the configuration, Enabling Brown Out Reset and Enabling Power On Timer Will solve this problem.
The details depend on your application. I'm talking about power managed modes, particularly sleep mode. There are specific requirements for IO and internal module configuration to take full advantage of it.
 

Its not working, when connecting directly.
The problem is that Voltage drop occurs and voltage comes to second controller.
But by connecting diodes three lines works properly like SCK, SDO, CLK
but what about SDI its and input pin, which gives 3.3V and will cause voltage to drop down beyond 2.5 V and my controller will not be able to detect that.
:-(
 

Apparently you didn't manage to threestate the inactive SPI master. As said before:

1. Unless you have multiplexers combining the two bus masters, both must be powered, and one of them threestated to avoid blocking the bus.
 

It may be easier to configure the 18f2550 as a usb to serial rs232 controller then feed that into the 18F8722 serial port.
This is the common way to add USB to a chip that does not have USB and you can find lots of examples on the web.
George
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top