Just got WROVER dev board but unusable

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: Just got WROVER dev board but unusable

Post by OutoftheBOTS_ » Sat Apr 07, 2018 9:46 pm

My TTGO boards builtin SD adapter works in both SPI and 1_LINE mode if I use the work around. To use 4_LINE mode then I have to attach an external SD adapter because the builtin one doesn't have SD pin D1 connected to pin 4 or SD pin D2 connected to pin 12,

Here's my output using builtin in SD adapter in 1_LINE mode
MicroPython ESP32_LoBo_v3.2.4 - 2018-04-06 on Out of the BOTS with ESP32
Type "help()" for more information.
>>> from machine import Pin
>>> pin14 = Pin(14, Pin.IN, Pin.PULL_UP)
>>> pin15 = Pin(15, Pin.IN, Pin.PULL_UP)
>>> pin2 = Pin(2, Pin.IN, Pin.PULL_UP)
>>> pin13 = Pin(13, Pin.IN, Pin.PULL_UP)
>>> import uos
>>> uos.sdconfig(uos.SDMODE_1LINE)
>>> uos.mountsd(True)
---------------------
Mode: SD (1bit)
Name: SD16G
Type: SDHC/SDXC
Speed: default speed (25 MHz)
Size: 14784 MB
CSD: ver=1, sector_size=512, capacity=30277632 read_bl_len=9
SCR: sd_spec=2, bus_width=5

>>>

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: Just got WROVER dev board but unusable

Post by OutoftheBOTS_ » Sun Apr 08, 2018 12:02 am

I think I know why the TTGO doesn't have pullups on the SD adaptor. It is because the TTGO is designed for Ardunio and comes with Ardunio boot loader and Blink sketch installed. My LoLin32 pro came with pullups on the the SD adapter because it was designed for MicroPython and came with MicroPython pre-installed.

The Espressif docs show 2 different ways to use the SD card. In the docs for Ardunio and the sketch provided by espressif https://github.com/espressif/arduino-es ... braries/SD This Ardunio libiary uses the internal pullups and doesn't need external ones and this is shown by the provided wiring pic.

Here is also the espressif docs for SD card programmed in C and is what is used by MicroPython https://github.com/espressif/esp-idf/tr ... ge/sd_card You can see it needs external pullups.

If your using a dev board designed for Ardunio the simple work around is to enable the pullups before mounting the SD card.

User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Just got WROVER dev board but unusable

Post by liudr » Sun Apr 08, 2018 1:27 am

This makes sense but I guess arduino core and micropython core don't share developers or common code on sd card. I imagine Arduino could just use 4Line mode since the mcu is not an 8-bit mcu such as atmega328p. Maybe my board only has SPI connections made. I can check connectivity later tonight to confirm which card pins are connected to ESP32.

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: Just got WROVER dev board but unusable

Post by OutoftheBOTS_ » Sun Apr 08, 2018 2:15 am

As far as I know the Ardunio just uses the C libiaries, I think in the Ardunio sketch it just enables the internal pullups the saem as I do for my work around, you could eaisly down load the Ardunio sketch and look through it to see how it works (I haven't bothered).
Maybe my board only has SPI connections made
The SPI connection are the same as the SD 1_LINE mode connections but minus the CS line as it doesn't need it as it is a dedicated SD bus.

User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Just got WROVER dev board but unusable

Post by liudr » Sun Apr 08, 2018 2:34 am

I use Arduino IDE for smaller MCUs such as ATmega328P with 2K SRAM. Works nicely and is seamless to move to another ATmega chip with more pins and memory but never enough memory to do serious internet stuff. I used to write all the code to just send http requests to servers and process responses with very little memory. All that work is pointless now that micropython generalizes lots of different higher power mcu with simple python scripts. I still use arduino for time critical tasks.

Post Reply