233 lines
4.8 KiB
Markdown
233 lines
4.8 KiB
Markdown
# ESP32-S3-LCD-1.3 Pin Finder Guide
|
|
|
|
## Problem: No Serial Output & Blank Display
|
|
|
|
Since we can't see serial output and the display is blank, we need to systematically find the correct pins.
|
|
|
|
## Step 1: Get Official Pin Configuration
|
|
|
|
### Download Waveshare Demo Code
|
|
|
|
```bash
|
|
cd ~
|
|
wget https://files.waveshare.com/wiki/ESP32-S3-LCD-1.3/ESP32-S3-LCD-1.3-Demo.zip
|
|
unzip ESP32-S3-LCD-1.3-Demo.zip
|
|
cd ESP32-S3-LCD-1.3-Demo
|
|
```
|
|
|
|
### Find Pin Definitions
|
|
|
|
Look for files like:
|
|
- `User_Setup.h` (TFT_eSPI configuration)
|
|
- `*.ino` files with pin definitions
|
|
- README files with pin mappings
|
|
|
|
**Search for these keywords:**
|
|
```bash
|
|
grep -r "TFT_MOSI\|TFT_SCLK\|TFT_CS\|TFT_DC\|TFT_RST\|TFT_BL" .
|
|
grep -r "pin_sclk\|pin_mosi\|pin_dc\|pin_cs\|pin_rst\|pin_bl" .
|
|
grep -r "GPIO" . | grep -E "(SCLK|MOSI|DC|CS|RST|BL|Backlight)"
|
|
```
|
|
|
|
## Step 2: Check Schematic
|
|
|
|
Download the schematic:
|
|
```bash
|
|
wget https://files.waveshare.com/wiki/ESP32-S3-LCD-1.3/ESP32S3_1.3inch.pdf
|
|
```
|
|
|
|
Open with a PDF viewer and look for:
|
|
- ST7789 chip connections
|
|
- ESP32-S3 GPIO labels
|
|
- SPI bus connections
|
|
- Backlight circuit
|
|
|
|
## Step 3: Test Pin Configurations
|
|
|
|
Based on similar Waveshare ESP32-S3-LCD boards, try these configurations:
|
|
|
|
### Configuration 1: ESP32-S3-LCD-1.28 Style (Current)
|
|
```cpp
|
|
SCLK: GPIO 10
|
|
MOSI: GPIO 11
|
|
CS: GPIO 9
|
|
DC: GPIO 8
|
|
RST: GPIO 14
|
|
BL: GPIO 2
|
|
```
|
|
|
|
### Configuration 2: ESP32-S3-LCD-1.47 Style
|
|
```cpp
|
|
SCLK: GPIO 40
|
|
MOSI: GPIO 45
|
|
CS: GPIO 42
|
|
DC: GPIO 41
|
|
RST: GPIO 39
|
|
BL: GPIO 48
|
|
```
|
|
|
|
### Configuration 3: Alternative Common Pins
|
|
```cpp
|
|
SCLK: GPIO 18
|
|
MOSI: GPIO 23
|
|
CS: GPIO 5
|
|
DC: GPIO 27
|
|
RST: GPIO 33
|
|
BL: GPIO 32
|
|
```
|
|
|
|
## Step 4: Update Pin Configuration
|
|
|
|
Edit `src/display_init.cpp` (around lines 23-41 and 64):
|
|
|
|
```cpp
|
|
// SPI bus pins
|
|
cfg.pin_sclk = XX; // Replace XX with actual GPIO
|
|
cfg.pin_mosi = XX;
|
|
cfg.pin_dc = XX;
|
|
|
|
// Panel control
|
|
cfg.pin_cs = XX;
|
|
cfg.pin_rst = XX;
|
|
|
|
// Backlight
|
|
cfg.pin_bl = XX;
|
|
```
|
|
|
|
## Step 5: Rebuild and Test
|
|
|
|
```bash
|
|
pio run --target upload
|
|
```
|
|
|
|
**Visual test**: Does the display light up? Even briefly?
|
|
|
|
- **Yes, backlight works!** → Backlight pin is correct
|
|
- **No backlight** → Wrong backlight pin, try another
|
|
|
|
## Step 6: Backlight-Only Test
|
|
|
|
If you want to test just the backlight without the full display code:
|
|
|
|
Edit `src/main.cpp`, in `setup()` add:
|
|
|
|
```cpp
|
|
// Direct backlight test
|
|
pinMode(2, OUTPUT); // Try GPIO 2
|
|
digitalWrite(2, HIGH);
|
|
delay(2000);
|
|
|
|
pinMode(48, OUTPUT); // Try GPIO 48
|
|
digitalWrite(48, HIGH);
|
|
delay(2000);
|
|
|
|
pinMode(15, OUTPUT); // Try GPIO 15
|
|
digitalWrite(15, HIGH);
|
|
delay(2000);
|
|
```
|
|
|
|
Upload and watch the display - when it lights up, you've found the backlight pin!
|
|
|
|
## Step 7: Serial Output Debug
|
|
|
|
### Check if Board is Even Running
|
|
|
|
The board should have an onboard LED. Try this in `loop()`:
|
|
|
|
```cpp
|
|
pinMode(38, OUTPUT); // Try common LED pins
|
|
for(int i = 0; i < 10; i++) {
|
|
digitalWrite(38, HIGH);
|
|
delay(200);
|
|
digitalWrite(38, LOW);
|
|
delay(200);
|
|
}
|
|
```
|
|
|
|
Try GPIO: 2, 38, 48, 47, 21
|
|
|
|
If you see blinking, the board is running but serial isn't working.
|
|
|
|
### Serial Port Issues
|
|
|
|
The board uses **CH343P USB-UART chip**. Check:
|
|
|
|
1. **Driver installed?**
|
|
```bash
|
|
lsusb | grep 1A86
|
|
```
|
|
Should show: `1a86:55d3 QinHeng Electronics`
|
|
|
|
2. **Permission?**
|
|
```bash
|
|
ls -l /dev/ttyACM0
|
|
sudo chmod 666 /dev/ttyACM0
|
|
```
|
|
|
|
3. **Try different tool:**
|
|
```bash
|
|
# Try screen
|
|
screen /dev/ttyACM0 115200
|
|
|
|
# Try minicom
|
|
minicom -D /dev/ttyACM0 -b 115200
|
|
|
|
# Try cu
|
|
cu -l /dev/ttyACM0 -s 115200
|
|
```
|
|
|
|
4. **Check dmesg:**
|
|
```bash
|
|
dmesg | tail -50 | grep tty
|
|
```
|
|
Should show USB device attachment.
|
|
|
|
## Step 8: Reset and Retry
|
|
|
|
After changing pins:
|
|
1. Power cycle the board (unplug USB)
|
|
2. Rebuild: `pio run`
|
|
3. Upload: `pio run --target upload`
|
|
4. Wait 5 seconds
|
|
5. Check display
|
|
|
|
## Known Working Configurations
|
|
|
|
Once you find the working pins, please add them here:
|
|
|
|
```
|
|
Working Configuration for ESP32-S3-LCD-1.3:
|
|
SCLK: GPIO __
|
|
MOSI: GPIO __
|
|
CS: GPIO __
|
|
DC: GPIO __
|
|
RST: GPIO __
|
|
BL: GPIO __
|
|
|
|
Verified by: [Your name]
|
|
Date: [Date]
|
|
Board Rev: [If known]
|
|
```
|
|
|
|
## Quick Reference: Waveshare Board Pin Patterns
|
|
|
|
| Board Model | SCLK | MOSI | CS | DC | RST | BL |
|
|
|-------------|------|------|----|----|-----|-----|
|
|
| ESP32-S3-LCD-1.28 | 10 | 11 | 9 | 8 | 14 | 2 |
|
|
| ESP32-S3-LCD-1.47 | 40 | 45 | 42 | 41 | 39 | 48 |
|
|
| ESP32-S3-LCD-1.69 | ? | ? | ? | ? | ? | ? |
|
|
| ESP32-S3-LCD-1.3 | **?** | **?** | **?** | **?** | **?** | **?** |
|
|
|
|
## Contact Support
|
|
|
|
If nothing works:
|
|
- Email Waveshare: support@waveshare.com
|
|
- Wiki: https://www.waveshare.com/wiki/ESP32-S3-LCD-1.3
|
|
- Forum: https://www.waveshare.com/forums/
|
|
|
|
Ask specifically for the GPIO pin mappings for the ST7789 display.
|
|
|
|
---
|
|
|
|
**Remember**: The most critical pin is the **backlight (BL)**. Without it, the display will appear blank even if everything else is correct!
|