-
Notifications
You must be signed in to change notification settings - Fork 0
/
T-DisplayS3_Setup.txt
142 lines (119 loc) · 6.87 KB
/
T-DisplayS3_Setup.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
To begin...you need to download the Zip file from LilyGO's own GitHub:
https://github.com/Xinyuan-LilyGO/T-Display-S3
by pressing the green button "Code" and after downloading, expand the Zip.
In your libraries delete folders “TFT_eSPI" and ‘lvgl" and delete the file “lv_conf.h”.
Drag the folder called "T-Display-S3-main” into your Arduino folder.
Inside the folder T-Display-S3-main there is a folder called “lib”.
Copy the CONTENTS of the folder “lib” (not the actual folder “lib”) into your
libraries folder and then check that “lib” is empty and delete it.
Your libraries folder should now contain folders called:
lvgl
T-Display-S3-main
TFT_eSPI
and a file called
lv_conf.h
...and recently, many other helpful dependancies.
*****
If you do an Arduino libraries update you WILL have to edit the "User_Setup_Select.h" to comment-out the line:
"//#include <User_Setup.h> // Default setup is root library folder"
AND un-comment:
"#include <User_Setups/Setup206_LilyGo_T_Display_S3.h> // For the LilyGo T-Display S3 based ESP32S3 with ST7789 170 x 320 TFT"
which is about halfway down the huge file of setups.
(You will find an edited copy of "User_Setup_Select.h" here in may repository)
Now:
It is also assumed that you have already installed the ESP32 board
definitions and are using the latest version.
It is also assumed that you have installed Arduino IDE, ver 1 or 2.
(This is covered in many tutorials online, so I will be brief)
If your Arduino IDE does not already have "ESP32 Arduino" (or simply esp32)
as shown paste this:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
into Arduino Preferences, Additional Boards Manager.
Goto Boards manager and select esp32 by Espressif Systems, and wait for it to load...
From the upper menu "Arduino Tools", Board: select ESP32 Arduino, ESP32S3 Dev Module.
Right at the top!
Please see attached screenshot, "Arduino_Config.png"
Make sure that you change:
Flash Size to 16M
Partition Scheme to "Huge APP (3MB No OTA/1MB SPIFFS)"
PSRAM: "OPI PSRAM"
To enable serial monitor function for debugging, etc, be sure to also set
USB CDC On Boot "Enabled".
All settings shown, run on my computer just as shown.
If you are NOT running one of my sketches, you should add:
#define PIN_POWER_ON 15 // LCD and battery Power Enable
#define PIN_LCD_BL 38 // BackLight enable pin (see Dimming.txt)
just before the setup and then in setup add:
pinMode(PIN_POWER_ON, OUTPUT); //triggers the LCD backlight
pinMode(PIN_LCD_BL, OUTPUT); // BackLight enable pin
digitalWrite(PIN_POWER_ON, HIGH);
digitalWrite(PIN_LCD_BL, HIGH);
My repository contains examples of simple, documented easy to understand program code.
The first one to try is "HotHead.ino" which demos most of the common things you need to program this board:
Solutions to common startup issues:
A) Unit seems "bricked"
LCD does not display, unit remains dark with no white backlight:
In declarations add
#define PIN_POWER_ON 15 // LCD and battery Power Enable
#define PIN_LCD_BL 38 // BackLight enable pin (see Dimming.txt)
Then in setup add
pinMode(PIN_POWER_ON, OUTPUT);
pinMode(PIN_LCD_BL, OUTPUT);
digitalWrite(PIN_POWER_ON, HIGH);
digitalWrite(PIN_LCD_BL, HIGH);
B) Cannot see Serial.Print on Arduino Serial Monitor
To enable serial monitor function for debugging, you must also set
USB CDC On Boot "Enabled"
in the Arduino board parameters
C) Can run on USB power but not battery connector:
In declarations add
#define PIN_POWER_ON 15 // just before the setup and then in setup add:
pinMode(PIN_POWER_ON, OUTPUT); //"triggers the LCD backlight, and enables battery power
digitalWrite(PIN_POWER_ON, HIGH);) //on startup"
(LilyGO variously refers to them as "LCD power on" OR "PIN_POWER_ON")
Thanks to user RobLatour for finding this cure for the battery issue!
D) In the Port Selection, if the USB flickers on and off and you cannot upload, you may have to
manually enter "Upload Mode". (Sometimes call Download Mode)
This can be caused by a faulty sketch that is running at high speed with no delay at the
end of the loop, or working with Dual Cores.
To enter Upload Mode:
press Boot and hold, press Reset and release, then release Boot and go it into "Upload Mode"
(The reset button is the little black switch beside the Boot button, on the back of the board)
(Alternately: Unplug the USB, hold down the Boot button whilst re-connecting USB. You are now in
Upload Mode.)
I am using Arduino IDE 2.3.2 on a iMac M1 and almost never have to to this, except if I
experience difficulties connecting.
If the upload goes smoothly but the sketch does not run, i.e. no serial print or screen it is
sometimes necessary to unplug the USB and plug it back in...to start the new code!
E) When the board is shipped, the "factory.ino" sketch is calling for ESPTouch which is an app from
Espressif to transfer your WiFi SSID and Password from your phone to the board and enable the
board to go online to China. This will enable a cool clock app that has a digital flip card
style of retro alarm clock.
You can bypass ESPTouch by editing the pin_config.h in the "factory" folder with your SSID and
Password. The factory.ino sketch has no other purpose and is sometimes difficult to load...so
don't worry about it!
F) Even after uploading the HotHead sketch you get no image on the LCD, just black or white background,
but you can see the Tick/Tock in Serial Monitor:
You may not have copied ALL the files from the LilyGO repository folder 'lib' and fully replaced the
ones in your Libraries folder or you did NOT resist the temptation to do an Arduino Library Update!
The current Arduino Library for TFT_eSPI is now Bodmer's official v2.5 but there are still
setups to do.
(See above)
Pro-Tip:
If you have several different boards using TFT_eSPI library and you have installed V2.5 or greater in your
libraries you still need to find "User_Setup_Select.h" file and select the LilyGO T-Display S3 halfway
down by un-commenting it and no others.
(At the top of the file there is a reference to User_Setup.h that needs to be commented-out.
You got here!
Addendum:
<on-board LED colours and function:>
Green LED indicates board is powered up (Power Enabled) using either USB or Battery
Red LED indicates Board is powered up by USB only and indicates that the battery is being charged
The T-Display S3 LCD backlight can be dimmed by following the instructions in:
LCD DimmerNEW.txt in this repository or try the HotHead_DimmerNEW example.
I added a text file called 'ArdunioBoardSetup.h in the HotHead.ino folder for convenience.
While setting up the multiple config settings, you can glance at the included list!
In the repository root there is also a preset 'User_Setup_Select.h' to be added to your Arduino IDE libraries TFT_eSPI folder to ensure the correct config.
You can email me at [email protected]
I'm open to suggestions!
-Terry