SD Card Wiring with pull-up Resistors and code issue
dtiziano opened this issue · 8 comments
I'm trying to run this project.
First
When trying to write to the SD Card using the idf code, it always fails to initialize the SD card. It is as HC card though.
Did you use any pull-up resistors? If yes, can you provide your connection scheme?
Furthermore, I would like to use the internal ADC.
After commenting //#define USE_I2S_MIC_INPUT in config.h
there will be two bugs in line 97 of main.cpp
97: I2SSampler *m_input = new ADCSampler(ADC_UNIT_1, ADC1_CHANNEL_7);
- shouldn't *m_input be *input?
- ADCSampler requires an additional parameter, is this i2s_adc_config?
I would propose the solution following solution, for which I'm still not sure since I cannot test it as long as I can have the SD card working
I2SSampler *input = new ADCSampler(ADC_UNIT_1, ADC1_CHANNEL_7, i2s_adc_config);
I tried the Arduino code with I2S microphone and I also have a similar error:
E (628) SDC: Failed to initialize the card (ESP_ERR_TIMEOUT). Make sure SD card lines have pull-up resistors in place.
Can you, @cgreening, please share your wiring diagram if possible. It would be a great help.
Thank you very much!
Warm regards,
rmond
I don't use any pull-up resistors.
I'm not sure a wiring diagram will help as you define the pins in the code. So it really is up to you to decide which pins to use.
There's a good diagram for what the pins on the SD Card mean here: https://github.com/espressif/arduino-esp32/tree/master/libraries/SD
Make sure you have formatted the SD Card as FAT32.
I have one last question, can the speaker be replaced by an I2S stereo decoder such as UDA1334A for example? or not?
Thank you for replying! I'll review my pinout to see what's wrong, thank you!
Apologies for the compilations errors on the ADC - I don't use ADC very often so it doesn't get tested much.
I think you should be able to use the UDA1334A without any problems at all.
Let me know how you get on. I need to do a project using the SD Card in the next few days so I will try and help troubleshoot any problems you have.
In the meantime I've got it working. For me as well, I'm not using any pull up resistors
- Format the SD card using the Official SD Card Formatter
- Check that the SD card Pins are connected to the defined SD card GPIO pins defined in config.h (they're not the standard SPI pins)
- In main.cpp,
change according to the already fix commit 7998e3f#diff-1bf9bda525f4a5ffea55672840f8c89cbcf45ab885a7e5937b53fde9be1c332b
That's great to hear!
@cgreening I don't want to use the push button to record. what needs to be done.
Can you create a new issues for your problem.