+ Post New Thread
Results 1 to 12 of 12
  1. #1
    Advanced Member level 4
    Points: 7,116, Level: 20
    xpress_embedo's Avatar
    Join Date
    Jul 2011
    Location
    India
    Posts
    1,160
    Helped
    199 / 199
    Points
    7,116
    Level
    20
    Blog Entries
    4

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

    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.

    •   AltAdvertisment

        
       

  2. #2
    Full Member level 3
    Points: 1,665, Level: 9

    Join Date
    Apr 2012
    Posts
    166
    Helped
    10 / 10
    Points
    1,665
    Level
    9

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

    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



  3. #3
    Advanced Member level 4
    Points: 7,116, Level: 20
    xpress_embedo's Avatar
    Join Date
    Jul 2011
    Location
    India
    Posts
    1,160
    Helped
    199 / 199
    Points
    7,116
    Level
    20
    Blog Entries
    4

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

    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



    •   AltAdvertisment

        
       

  4. #4
    Advanced Member level 4
    Points: 7,116, Level: 20
    xpress_embedo's Avatar
    Join Date
    Jul 2011
    Location
    India
    Posts
    1,160
    Helped
    199 / 199
    Points
    7,116
    Level
    20
    Blog Entries
    4

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

    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

    Click image for larger version. 

Name:	EDA Board.jpg 
Views:	4 
Size:	246.1 KB 
ID:	89181

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



  5. #5
    Super Moderator
    Points: 246,450, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    42,840
    Helped
    13038 / 13038
    Points
    246,450
    Level
    100

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

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



    •   AltAdvertisment

        
       

  6. #6
    Advanced Member level 4
    Points: 7,116, Level: 20
    xpress_embedo's Avatar
    Join Date
    Jul 2011
    Location
    India
    Posts
    1,160
    Helped
    199 / 199
    Points
    7,116
    Level
    20
    Blog Entries
    4

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

    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.



  7. #7
    Super Moderator
    Points: 246,450, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    42,840
    Helped
    13038 / 13038
    Points
    246,450
    Level
    100

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

    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.



  8. #8
    Advanced Member level 4
    Points: 7,116, Level: 20
    xpress_embedo's Avatar
    Join Date
    Jul 2011
    Location
    India
    Posts
    1,160
    Helped
    199 / 199
    Points
    7,116
    Level
    20
    Blog Entries
    4

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

    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,



  9. #9
    Super Moderator
    Points: 246,450, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    42,840
    Helped
    13038 / 13038
    Points
    246,450
    Level
    100

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

    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.



  10. #10
    Advanced Member level 4
    Points: 7,116, Level: 20
    xpress_embedo's Avatar
    Join Date
    Jul 2011
    Location
    India
    Posts
    1,160
    Helped
    199 / 199
    Points
    7,116
    Level
    20
    Blog Entries
    4

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

    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.



    •   AltAdvertisment

        
       

  11. #11
    Super Moderator
    Points: 246,450, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    42,840
    Helped
    13038 / 13038
    Points
    246,450
    Level
    100

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

    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.



  12. #12
    Newbie level 6
    Points: 1,627, Level: 9
    Achievements:
    7 years registered

    Join Date
    Apr 2008
    Posts
    14
    Helped
    6 / 6
    Points
    1,627
    Level
    9

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

    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



--[[ ]]--