• AVR Freaks

Hot!On which pin the SDO and SDI needs to be configured to work with SD Card

Author
Nmaster88
Starting Member
  • Total Posts : 68
  • Reward points : 0
  • Joined: 2019/06/04 03:30:36
  • Location: 0
  • Status: offline
2019/07/05 06:40:02 (permalink)
0

On which pin the SDO and SDI needs to be configured to work with SD Card

I'm in doubt which pin needs to be configured to work with SD Card.
 
In my PCB i have configured the following,
RD10(SD_CLK) -> CLK
RF5(SD_DI)      ->CMD
RD3(SD_DO)     ->DAT0
RF12(SD_CS)    ->CD/DAT3
 
Do i need to configure RF5 as SDI and RD3 as SDO? or it's the opposite?
post edited by Nmaster88 - 2019/07/11 04:29:04

Attached Image(s)

#1

3 Replies Related Threads

    LostInSpace
    Super Member
    • Total Posts : 263
    • Reward points : 0
    • Joined: 2016/03/11 22:47:59
    • Location: 0
    • Status: offline
    Re: On which pin the SDO and SDI needs to be configured to work with SD Card 2019/07/05 17:36:28 (permalink)
    0
    Here is how I hook them up,
     
    SD Card         PIC32
    ========================
    CMD        => SDOx or MOSI
    CLK         => SCKx
    DAT0       => SDIx or MISO
    CD/DAT3  => ChipSelect
     
    Normally when I am in doubt about these things, I go look at everyone's reference designs I can find.
    Such as: Mikro Electronica, Microchip and Digilent. They all have reference designs that use a lot of chips that can be reverse engineered for proper wiring.
    #2
    Nmaster88
    Starting Member
    • Total Posts : 68
    • Reward points : 0
    • Joined: 2019/06/04 03:30:36
    • Location: 0
    • Status: offline
    Re: On which pin the SDO and SDI needs to be configured to work with SD Card 2019/07/11 04:33:37 (permalink)
    0
    SteveHageman
    Here is how I hook them up,
     
    SD Card         PIC32
    ========================
    CMD        => SDOx or MOSI
    CLK         => SCKx
    DAT0       => SDIx or MISO
    CD/DAT3  => ChipSelect
     
    Normally when I am in doubt about these things, I go look at everyone's reference designs I can find.
    Such as: Mikro Electronica, Microchip and Digilent. They all have reference designs that use a lot of chips that can be reverse engineered for proper wiring.


    @ListInSpace that means you would switch what i said right?
     
    SD Card                                  PIC32
    ================================
    CMD (data in of SDC)       =>   RD3 (SDO1 of SPI)
    CLK                                =>   RD10 
    DAT0 (data out of SDC)    =>   RF5 (SDI1 of SPI)
    CD/DAT3                         =>   RF12
     
    To be sure.
    #3
    LostInSpace
    Super Member
    • Total Posts : 263
    • Reward points : 0
    • Joined: 2016/03/11 22:47:59
    • Location: 0
    • Status: offline
    Re: On which pin the SDO and SDI needs to be configured to work with SD Card 2019/07/11 10:07:50 (permalink)
    5 (1)
    I didn't try to map the SPI pins to actual port pins, so I can't tell if RD3 is actually SDO1 for instance. But we do agree on the functionality. You should be good to go.
     
    You know.... it is so easy to make connection errors to connectors and things like a SD Cards that you have not hooked up before, that when I do a layout and there is risk in making it wrong, I will make sure that all the connection traces are on the outside layers of the board - then I can cut and 'green wire' if needed. At least I can get the prototype running with modifications. Ha, ha, ha, ha.... Yes embarrassing, but so easy to get confused and it happens even to engineers that I consider way more talented than I am!   ;-)
     
    Hope this helps.
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5