Xinyuan-LilyGO / LilyGo-T-Display-S2

47 stars 16 forks source link

SD card IO14 #9

Closed cs-devansh-mahajan closed 2 years ago

cs-devansh-mahajan commented 2 years ago

Hi I am new to the ESP32-S2 chip. Today I tried making the SD card ogging feature work but it didn write anything into he card so I checked and I found the issue: Where is IO14? I didnt find it here: image And the circuitpython board library also doesnt have it registered.

todbot commented 2 years ago

The CircuitPython port for this board does list IO14 as board.PE_POWER: https://github.com/adafruit/circuitpython/blob/main/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/pins.c#L57 as it's the pin you need to set high to enable the peripherals if not being powered by USB.

If you're using the board via USB, you can ignore IO14. If you are on battery power, you need to set IO14 HIGH.

If you're looking for an example of using the built-in SD card of this board, here's a little image slideshow example I did a while back in CircuitPython https://gist.github.com/todbot/ee3aefa3c0ef75ce8bf815e8d5e6cbc5

cs-devansh-mahajan commented 2 years ago

Thank you very much for clearing the confusion regarding the IO14

cs-devansh-mahajan commented 2 years ago

The CircuitPython port for this board does list IO14 as board.PE_POWER:

https://github.com/adafruit/circuitpython/blob/main/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/pins.c#L57

as it's the pin you need to set high to enable the peripherals if not being powered by USB.

If you're using the board via USB, you can ignore IO14. If you are on battery power, you need to set IO14 HIGH.

If you're looking for an example of using the built-in SD card of this board, here's a little image slideshow example I did a while back in CircuitPython

https://gist.github.com/todbot/ee3aefa3c0ef75ce8bf815e8d5e6cbc5

Just curious is IO14 the VBAT pin on the schematic or the 3V? Since I am powering it with the VBAT pin just curious to know

todbot commented 2 years ago

VBAT is the same as the + pin of the battery JST connector. Presumably it's so you can hook up a battery via the header instead of using the JST socket. At least that's what it looks like from the schematic (and how most similar boards work)

cs-devansh-mahajan commented 2 years ago

VBAT is the same as the + pin of the battery JST connector. Presumably it's so you can hook up a battery via the header instead of using the JST socket. At least that's what it looks like from the schematic (and how most similar boards work)

So the SD card should work even when you power it with VBAT 🤔

todbot commented 2 years ago

So the SD card should work even when you power it with VBAT 🤔

Yes, but you need to set the PE_POWER pin. Check out the schematic to see what I mean.