-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The 5V Arduino SD modules might work with a simple trick #83
Comments
Ah, so you're bypassing the LDO to avoid the dropout? I'm working on developing my own Pico oriented SD card board; something that could go right on the Pico, perhaps in a "hat"-like stackable design like this RTC module: There are so many possible configurations. Since these could be pretty small (no need to be a full-size "hat"), and JLCPCB's lowest prices go up to 100mm x 100mm, I'm thinking of designing a "panelized" board containing a few different configurations. That would help keep costs down since one board from JLCPCB would contain multiple units of the SD card board. One module I'm considering would be arranged like this:
which would be useable on SPI0 or with SDIO. If mounted directly on the Pico, it should be capable of very high speeds. |
Nice idea! So one ordered PCB will actually contain multiple SD modules (in order to cut costs), and you're going to split them yourself, right? And yes, I tried the bypass trick (basically directly supplying 3.3v from the Pico) since I had one of those modules around :) |
Yes, like this:
I'm also thinking of some minimal small boards for, say, SPI only, or even 1-bit SDIO (which no-OS-FatFS-SD-SPI-RPi-Pico does not yet support, but there is the old pico_sd_card implementation). For short boards, getting to the 3V3 pin is a problem unless you're up at the USB end of the Pico. But, that could be solved with a jumper. SDIO can be moved around more easily than SPI. I need to look at how the Pico-W is laid out.
Maybe you could take a photo? |
Thanks. That might be worth adding to the README.
At the low level, there is EDIT: Also, take heed of ChaN's Cosideration on Multi-slave Configuration. |
Yes, sure.
Alright, thanks! I've noticed that |
I've noticed that spi_t also has a mutex attribute. Maybe I could use
this one instead.
Right, the library supports multiple SD cards per SPI as well as multiple
SPIs. An SD card can only do one thing at a time, and an SPI bus can only
do one thing at a time. But, where possible (e.g., two cards are on
separate buses [whether SPI or SDIO], multiple SD cards should be able to
work in parallel.
…On Thu, Aug 31, 2023 at 1:28 PM CMD ***@***.***> wrote:
Maybe you could take a photo?
Yes, it's just a simple jumper soldered to the LDO's 3.3v, which is then
connected to the Pico: ... The other pins are connected as usual, and the
Vcc pin is unused.
Thanks. That might be worth adding to the README.
Yes, sure.
By the way (maybe I should open another issue for this?), is there any
easy way to check whether the SPI bus is in use by the SD card? For
example, when you want to use an SD card and another SPI device on the same
bus, you would want to check whether the DMA transfer has finished before
switching the CS pin and sending data to the other device (to avoid race
conditions). I took a quick at your library's internals, and perhaps I
could use the SD object's mutex attribute and the mutex_try_enter() SDK
function like this: mutex_try_enter(&sd_init_driver(0)->mutex)?
At the low level, there is dma_channel_is_busy(spi_p->rx_dma). But, the
mutex protects whole transactions against interruption, so that is probably
a better approach. Maybe you could add another higher-level mutex to
control access to the SPI bus itself. The library's mutex was designed to
keep multiple threads using the library from interfering with one another.
EDIT: Also, take heed of ChaN's Cosideration on Multi-slave Configuration
<http://elm-chan.org/docs/mmc/mmc_e.html#spibus>.
Alright, thanks! I've noticed that spi_t also has a mutex attribute.
Maybe I could use this one instead.
—
Reply to this email directly, view it on GitHub
<#83 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL6MY4JHXH4IQG3DQBNLAMDXYDQVLANCNFSM6AAAAAA4EIWAWA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hi,
I believe blue 5V Arduino SD modules work with 3v3 devices with a simple trick. These feature a 74LVC125A and an AMS1117 3v3 LDO. If you bypass the LDO (connect the 3v3 supply to the ldo's 3v3 pin), the module seems to work fine.
Though, of course, modules designed for 3v3 could be better suited, especially those from known brands.
If the resistors are used as dividers, everything should work fine as long as the 74LVC125A's inputs are above 2V when high.
The text was updated successfully, but these errors were encountered: