Wednesday, August 30, 2023

Lolin esp32-c3 pico Notes (PIO, Qwiic Stemma QT)




I don't work on this often, so when I do, I feel like I'm having to go back and figure things out. These notes will hopefully save me some time.

PIO platform.ini (first 4 lines)

[env:c3_pico]
platform = espressif32
board = esp32-c3-devkitm-1 ; or could use lolin_c3_pico if setup
framework = arduino
upload_port = com4
upload_speed = 921600
monitor_port = com4
monitor_speed = 115200


Digital Pins: just the digit (0, 1, 2,... -- number matches IO)

Analog Pin: A0, A1, A2, A3, A4, A5 (number matches IO)


I2C Pins:

static const uint8_t SDA = 8; //IO8

static const uint8_t SCL = 10; // IO10


Lolin I2C Port and Qwiic / StemmaQT (Not Compatible!) - both use 4 Pin SH1.0 connectors

Lolin:  VCC     SCL     SDA     GND

Qwiic:  Black   Red     Blue    Yellow

Lolin ESP32-C3 Pico I2C Connector



Qwiic / StemmaQT I2C Connector


Possibly could build a custom converter adapter - but probably easily just to use the board pin for IO8 & IO10 as they are the same pins unless you are connecting multiple Qwiic compatible I2C connections.

Upload Code

Make C3 boards into Device Firmware Upgrade (DFU) mode.

  • Hold on Button 9
  • Press Button Reset
  • Release Button 9 when you hear the prompt tone on USB reconnection


Battery

Make sure to check polarity of the battery before plugging it in! For my battery the JST polarity connections were backwards.



Resources:

https://www.wemos.cc/en/latest/_static/files/sch_c3_pico_v1.0.0.pdf

https://www.wemos.cc/en/latest/tutorials/c3/get_started_with_arduino_c3.html

https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf

https://github.com/espressif/arduino-esp32/blob/master/variants/lolin_c3_mini/pins_arduino.h (similar?)

https://learn.adafruit.com/assets/113383 (stemmaQT/qwiic connector)

https://mischianti.org/2023/06/12/wemos-lolin-esp32-c3-pico-high-resolution-pinout-and-specs/

https://forum.arduino.cc/t/esp32-c3-lipo-battery-wont-charge/1108618/5