Table of Contents



The Intro

If you are looking for a minimal example to start developing software for this board from scratch, you found the right place ;).

https://github.com/uvwxy/ttgo-t-camera-boilerplate

The goal of the repo is to give a minimal setup to start developing from scratch using platformio and the arduino framework.

I use Visual Studio Code and the platformio extensions.

This is a work in progress, until I find the time to finish this.

The Hardware

Component TTGO T-Camera Plus
MIC MSM261S4030H0
micro SD-card supported
Charging IP5306
I2C supported
Screen IPS Panel ST7789/1.3
Camera OV2640
Core ESP32-DOWDQ6
PSRAM 8MBytes
FLASH 4MBytes
UART CP2104

Unfortunately the front button is only the reset button.

Interesting Stuff

If you look at the schematics:

https://github.com/Xinyuan-LilyGO/esp32-camera-screen/blob/master/schematic/OV2640_V2.0.pdf

TODO: talk to the the charger chip via I2C :)

Also: http://community.m5stack.com/topic/62/ip5306-automatic-standby/10

if the load current drops below 45mA during 32 seconds, the IP5306 goes into standby.

The (minimal) Software

You can see the example running in the screenshot here:

https://github.com/uvwxy/ttgo-t-camera-boilerplate/blob/master/src/main.cpp

TFT

The includes:

#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>

Some params:

#define TFT_W 240
#define TFT_H 240
#define TFT_ROTATION 2

inside setup():

pinMode(TFT_BK, OUTPUT);
digitalWrite(TFT_BK, HIGH);
tft.init(TFT_W, TFT_H);    // rotate the screen so the USB port is facing down
tft.setRotation(TFT_ROTATION);
tft.fillScreen(ST77XX_BLACK);

inside loop():

tft.setCursor(0, 0);
tft.setTextColor(ST77XX_WHITE);
tft.print("Hello World");

Camera

The includes:

#include "app_camera.h"

Some params:

// INFO: you can set CAMERA_FRAME_SIZE to FRAMESIZE_HQVGA in app_camera.h
// INFO: you can set CAMERA_PIXEL_FORMAT to PIXFORMAT_RGB565 in app_camera.h
#define PREVIEW_W 240
#define PREVIEW_H 176

inside setup():

app_camera_init();

inside loop():

camera_fb_t *fb = esp_camera_fb_get();
if (fb) {
    // do sth. with fb
    // fb->buf (uint8_t array)
    // fb->len (length of buf)
    // fb->width
    // fb->height
    // fb->format (pixel format)
    esp_camera_fb_return(fb);
    fb = NULL;
}

The Pins

These pins are mapped in the file pins_arduino.h.

I2C

Name Num
SDA 18
SCL 23

TFT / SD Card

Name Num
MISO 22
MOSI 19
CLK 21
DC 15
TFT_CS 12
TFT_BK 2
SD_CS 0

MIC

Name Num
I2S_SCLK 14
I2S_LCLK 32
I2S_DOUT 33
I2S_DIN No use

OV2640

Name Num
Y9 36
Y8 37
Y7 38
Y6 39
Y5 35
Y4 26
Y3 13
Y2 34
VSNC 5
HREF 27
PCLK 25
XCLK 4
SIOD 18
SIOC 23
PWD No use
RESET No use