• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Raspberry Pi Pico with MicroSD Card

Q&A Forum › Category: Raspberry Pi › Raspberry Pi Pico with MicroSD Card
0 Vote Up Vote Down
Ray Leiter asked 1 year ago

I’m working on 8.3 – Using a MicroSD Card for Datalogging in “Learn_Raspberry_Pi_Pico_W_with_MicroPython_V1”.
I had some difficulty, so I tried this tutorial:
“In-Depth Tutorial to Interface Micro SD Card Module with Arduino (lastminuteengineers.com)”
I was successful with it.
I’m enclosing a text file which explains the trouble I’m having with the 8.3 tutorial.
I’ve enclosed the link to front and back images of my MicroSD Card module. It doesn’t look exactly like the one in the tutorial!
https://imgur.com/a/T1FAsaO

OUTPUT of the prog.(On the Shell)
%Run -c $EDITOR_CONTENT
MPY: soft reboot
We’re going to INIT SPI
We’re going to Set CS pin
We’re going to setup SD obj
Note:
It appears to have not returned from the “sd = sdcard.SDCard(spi, cs)” statement!
AFTER a few minutes, it printed this on the Shell:
“An error occurred: timeout waiting for v2 card”
I’m wondering if I bought some older version 1 modules and this program requires version 2!!!

THE PROGRAM I RAN to GET THE PREVIOUS OUTPUT:
from machine import SPI, Pin
import sdcard, os
# Constants
SPI_BUS = 0
SCK_PIN = 2
MOSI_PIN = 3
MISO_PIN = 4
CS_PIN = 5
SD_MOUNT_PATH = ‘/sd’
try:

# Init SPI communication
print(“We’re going to INIT SPI”)
spi = SPI(SPI_BUS,sck=Pin(SCK_PIN), mosi=Pin(MOSI_PIN), miso=Pin(MISO_PIN))
print(“We’re going to Set CS pin”)
cs = Pin(CS_PIN)
print(“We’re going to setup SD obj”)
sd = sdcard.SDCard(spi, cs)
print(“We’re going to Mount SD card”)
# Mount microSD card
os.mount(sd, SD_MOUNT_PATH)
# List files on the microSD card
print(“We’re going to List files”)
print(os.listdir(SD_MOUNT_PATH))
except Exception as e:
print(‘An error occurred:’, e)

 

Question Tags: Pico MicroSD-Card
3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi.
How are you powering your microSD card?
I think those models require 5V to operate.
Connect the VCC pin to the Pin VBUS pin.
 
Let me know the results.
Regards,
Sara

0 Vote Up Vote Down
Ray Leiter answered 1 year ago

Sara,
As usual, you provided the help I needed.
If only I would have thought of that!
Someday I’m gonna get smarter! (I really doubt it though, since I’ll be 80 in July)
It worked just as it is supposed to work.
Thanks again for your help.
Ray

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Great!
I’m glad it’s working as expected now.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
 
I hope you’re enjoying the Raspberry Pi Pico eBook
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.