Skip to content
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

Add LDO Voltage Regulator module (LDOPWR?) #9651

Open
RetiredWizard opened this issue Sep 23, 2024 · 6 comments
Open

Add LDO Voltage Regulator module (LDOPWR?) #9651

RetiredWizard opened this issue Sep 23, 2024 · 6 comments

Comments

@RetiredWizard
Copy link

RetiredWizard commented Sep 23, 2024

Espressif is playing around on the ESP32-P4 with support for UHS-1 SD cards that use 1.8v signal voltages. Currently they have a couple of recommendations on how to deal with the new voltage. One option is to just design the hardware with your intended voltage feeding the SD_VSS pin. A second option is to utilize some LDO power supply features of the SOC itself. It turns out that on the Function-EV dev board, Espressif connected one of the ESP32-P4 LDO lines to the SD Card which means you should be able to control the voltage via software. As it stands, when you run the current version of CircuitPython, the dev board appears to be supplying about 1v to SD card pins which means that neither the standard SDIOIO or SPI modules will successfully work with the boards SD card slot.I have been able to build a version of the SDIOIO module that turns on the LDO power channel connected to the SD card which brings the voltage up to 3.3 volts and allows the SDIOIO module to properly mount an SD card.

While the SDIOIO module could be modified to work on the Function-EV board using either compile time board parameters or settings.toml runtime parameters (ths SPI or SDCARDIO module would also need updates in order for the Function-EV board to fully support the SD card slot as designed), I'm thinking the correct way to deal with multiple SDMMC interface voltages would be to provide a CircuitPython core LDOPWR library for controlling the LDO channels. That way the Python developer could decide how best to power the connected device based on their requirements.

@tannewt
Copy link
Member

tannewt commented Sep 23, 2024

You could write a Python level driver that uses memorymap: https://docs.circuitpython.org/en/latest/shared-bindings/memorymap/index.html

@bill88t
Copy link

bill88t commented Sep 23, 2024

I think a python driver would be better, since we could have it frozen and the user could override the version if needed.
I'll look into it once I get a P4 if it's not done till then.

@RetiredWizard
Copy link
Author

I'll take a look at memorymap but at first glance, figuring out how to interface the LDO via memory manipulations would take me deeper into the IDF than I ever expected to go 😁

The issue is sort of board related as it depends on how the chip is wired up to an SD card slot (or other SDIO peripheral) so maybe before deep diving the IDF, I'll see if I can create an object in board/board.c, maybe board.LDOn, similar to how board.DISPLAY is created.

@RetiredWizard
Copy link
Author

Well after a quick look at the board/board.c thought I had, I realized that's not really any different than my original suggestion to create a core device/library. I'll spend a bit of time poking at the memorymap option but may come back around to a core module eventually, unless @bill88t get's to it first.

@tannewt
Copy link
Member

tannewt commented Sep 24, 2024

I'll take a look at memorymap but at first glance, figuring out how to interface the LDO via memory manipulations would take me deeper into the IDF than I ever expected to go 😁

Ya true! If you want to wrap the IDF then you can add another ESP-specific module (like espulp). I don't think we want to abstract it for all ports yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants