Page 33 of 47

Re: MicroPython on ESP32 with SPIRAM support

Posted: Wed Jan 31, 2018 11:39 am
by OutoftheBOTS_
Has anyone else used the analog lamb Wrover breakout board?

It's schematic shows IO12 being pulled up to 3.3v see https://github.com/AnalogLamb/esp32/blo ... eakout.pdf

Yet the Wrover datasheet doesn't show to do this in the peripherals schematic see https://www.espressif.com/sites/default ... eet_en.pdf

Is it maybe a fault in the analog design?? has someone make the analog Lamb wrover breakout work??

Re: MicroPython on ESP32 with SPIRAM support

Posted: Wed Jan 31, 2018 1:59 pm
by cartere
OutoftheBOTS_ wrote:
Wed Jan 31, 2018 11:39 am
Has anyone else used the analog lamb Wrover breakout board?

It's schematic shows IO12 being pulled up to 3.3v see https://github.com/AnalogLamb/esp32/blo ... eakout.pdf

Yet the Wrover datasheet doesn't show to do this in the peripherals schematic see https://www.espressif.com/sites/default ... eet_en.pdf

Is it maybe a fault in the analog design?? has someone make the analog Lamb wrover breakout work??
I have got the board to work (sorta), pull enable and io0 high, boot switch to pull io0 low on power up. Serial connection through an Adafruit monitor cable, basically just using the breakout as a convenient place to solder the wrover module.

Re: MicroPython on ESP32 with SPIRAM support

Posted: Wed Jan 31, 2018 2:46 pm
by mattyt
For the record, the second of my LOLIN32 Pro boards appears to be operating fine. No heat - and greeted by the friendly MicroPython 1.9.2 WebREPL when making a serial connection to the board...

Re: MicroPython on ESP32 with SPIRAM support

Posted: Wed Jan 31, 2018 6:59 pm
by cartere
I am working on a anemometer that has a magnet that closes a reed switch each revolution.

Code: Select all

from time import *
import machine
import network
pin22 = machine.Pin(22,machine.Pin.IN)

twind =ticks_ms()
windSpeed=0

def callback22(p):
    global twind
    global windSpeed
    a = ticks_ms()
    deltat= ticks_diff(a , twind)
    if deltat>25:
        twind=ticks_ms()
        windSpeed=(( 10000/(deltat)*306)/1000)
        #print(windSpeed)

def getSpeed():
    global windSpeed
    return windSpeed

pin22.irq(trigger=machine.Pin.IRQ_RISING, handler=callback22)
 
I have two issues, how to keep windSpeed in scope and time.sleep() seems to shut down the pin callback. Having to def getSpeed() would seem to be a hack. Do I need to look at threads for the pin callback?

Re: MicroPython on ESP32 with SPIRAM support

Posted: Wed Jan 31, 2018 8:21 pm
by loboris
cartere wrote:
Wed Jan 31, 2018 6:59 pm
I am working on a anemometer that has a magnet that closes a reed switch each revolution.
The pulse module will be available soon (probably early next week) which will use ESP32 hardware peripherals to count pulses, measure pulse duration and/or frequency etc.
It will make that kind of tasks much easier and precise.

Re: MicroPython on ESP32 with SPIRAM support

Posted: Wed Jan 31, 2018 9:10 pm
by cartere
thanks loboris!

Re: MicroPython on ESP32 with SPIRAM support

Posted: Wed Jan 31, 2018 11:23 pm
by OutoftheBOTS_
Ok at this point I feel like an idiot.

It seems it was the way I connected the usb to serial converter to the ESP32. Seems the TX on the converter needs to connect the RX on the ESP32. This is opposite of the labaling stem32 dev board that I have known as the blue pill.

On the up side I now make it go :) :) :)

Re: MicroPython on ESP32 with SPIRAM support

Posted: Thu Feb 01, 2018 9:27 am
by OutoftheBOTS_
I have had my robot up and driving around today and now need to start to hook all the peripherals up. I need to workout what pins I will ise for what( I am likely to use them all).

I want to make sure that I am not connecting something to a pin that shouldn't be used.

Can someone confirm that these pins are ok to use.

I assume that I can use pin 0 as a digital IO providing it isn't pulled low during boot???

I assume that I need to leave pin 2, 4, 12, 13, 14, 15 for the SD card in 4 pin mode and not connect anything else to them unless using SD card in SPI mode then fine to use???

Pin 5 is listed as VSPI in ESP32 datsheet but on Wrover scehmatic it isn't shown in blue as 1.8v, I am unsure if it is ok to use???

18, 19, 21, 22, 23, 25, 26, 27 are fine as digital IO pins

32, 33, 34, 35 can be used as analog input pins or digital IO pins.

I am unsure about 36, 39????

I very much assume that I shouldn'y ever connect anything to : SD0, SD1, SD2, SD3, CMD, CLK, 16, 17 as these are all listed in blue as 1.8v for the SPI RAM

Thanks for anyone that can help :)

Re: MicroPython on ESP32 with SPIRAM support

Posted: Thu Feb 01, 2018 11:43 am
by loboris
OutoftheBOTS_ wrote:
Thu Feb 01, 2018 9:27 am
... Can someone confirm that these pins are ok to use ...
You are right about the pins usage.

Be carefull about using GPIO0. I think the high level is sampled only on boot from power up.

I wouldn't recommend usin the SDCard in SPI mode, there are known problems with using the SPI display and SDCard in SPI mode!
But, you can use it in 1-line SD mode, you will have 3 more pins left (only GPIOs 14,15 & 2 are needed).

If using GPIO 12 (MTDI) be very carefull not to pull it down during boot. If pulled low it will select 3.3V for Flash & SPIRAM power wich can (and probably will) damage both chips.

You can use pin 5 as you want.

You can use 36 & 39, they are input only pins.

Never use or connect anything to the pins marked with blue on schematics (external Flash can be connected to those pins, but special procedure and fuse programming must be used).

Re: MicroPython on ESP32 with SPIRAM support

Posted: Thu Feb 01, 2018 11:57 am
by OutoftheBOTS_
@laboris

Thanks for your help. This will allow me to make the most of the available pins, I think that I will nee all of them and will run the SD card in 1 line mode as will need the extra pins.

Hoping to run : SPI TFT, SPI touch, SD card, 2 x SPI encoder counters, H-bridge needing 4 output pins, ADC for battery monitor and still have space to hook up I2C sensors.

Can I use 36 or 39 as SPI MISO ??

Can I use 36 or 39 as ADC input for the battery monitor??