STM32L151 and uSD card

Discussion in 'Embedded Systems and Microcontrollers' started by Mikrogut, Sep 23, 2015.

  1. Mikrogut

    Thread Starter New Member

    Aug 30, 2013
    20
    0
    Hi,

    I want to connect a microSD card to my STM32L151CBU6 MCU and read/write data to this uSD card. I have made the schematics, but I am unsure if I have connected the uSD card holder correctly to the MCU (see attachment).

    Wire run list to the MCU:
    SPI1_MISO <-> pin 16/PA6/SPI1_MISO
    SPI1_CS <-> pin 14/PA4
    SPI1_SCK <-> pin 15/PA5/SPI1_SCK
    SPI1_MOSI <-> pin 17/PA7/SPI1_MOSI

    The NMOS is added to make me able to reset/disconnect the power to the uSD card.

    Can anyone verify the MCU uSD card connection please?
     
    • uSD.jpg
      uSD.jpg
      File size:
      151.6 KB
      Views:
      7
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    Your device will work much better if you connect the MSU output to the SD input, and the SD output to the MSU input.
     
  3. Mikrogut

    Thread Starter New Member

    Aug 30, 2013
    20
    0
    I don't understand.

    I want to run the uSD card in SPI mode. Then the pinning is as in the attached picture.
     
  4. dannyf

    Well-Known Member

    Sep 13, 2015
    1,820
    363
    It is specific to your code. If you use hardware spi1, that's the right connection.
     
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    Irregardless of your diagram you need to connect an output to an input for anything digital to work.
     
  6. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,801
    1,105
    Will the card be happy if Vss is left floating (FET switched off)?
     
  7. Mikrogut

    Thread Starter New Member

    Aug 30, 2013
    20
    0
    That is a good question. Maybe a PMOS on the 3.3V supply is better to use.
     
Loading...