fbiego / dt78-esp32-firmware

Firmware for the DT78 watch based on ESP32 microcontroller
MIT License
31 stars 9 forks source link

ESP32-S3-Touch-LCD-1.28 (porting) #2

Open Santix29 opened 2 weeks ago

Santix29 commented 2 weeks ago

I flashed the firmware into the esp32-s3 but it doesn't show me anything. What can I do about it?

fbiego commented 2 weeks ago

You need to check your connections, how are you connecting your display?

Santix29 commented 2 weeks ago

I'm using ESP32-S3-Touch-LCD-1.28, so the display is attached to the microcontroller. I will add the shematic pdf here and a photo of the esp32-s3 ESP32-S3-Touch-LCD-1.28-Sch.pdf esp32-s3-touch-lcd-1 28-07 ESP32-S3-Touch-LCD-1 28-details-7

fbiego commented 1 week ago

Have you gotten your display working before? Check https://github.com/moononournation/Arduino_GFX/wiki/Data-Bus-Class

Then you will need to change this to match your display https://github.com/fbiego/dt78-esp32-firmware/blob/750739d03cb232f682c9b4b6234c2c92b4d176d9/src/main.cpp#L29-L30

Santix29 commented 1 week ago

I changed this line and doesn't seem to work even with these modifies

fbiego commented 1 week ago

At least provide how you've modified the code, other wise i can't help much

Santix29 commented 1 week ago

sure
Arduino_ESP32SPI *bus = new Arduino_ESP32SPI(8 /* DC */, 9 /* CS */, 10 /* SCK */, 11 /* MOSI */, 12 /* MISO */);

fbiego commented 1 week ago

What about the next line?

Santix29 commented 1 week ago

Arduino_GC9A01 *gfx = new Arduino_GC9A01(bus, 19, 0 /* rotation */, true /* IPS */);

fbiego commented 1 week ago

You need to change 19 to 14 in that line

Also change this line to match the BL pin (2) https://github.com/fbiego/dt78-esp32-firmware/blob/750739d03cb232f682c9b4b6234c2c92b4d176d9/include/main.h#L3

Santix29 commented 1 week ago

I changed this: Arduino_GC9A01 gfx = new Arduino_GC9A01(bus, 14, 0 / rotation /, true / IPS */); and this: #define BL 2 but it doesn't work

fbiego commented 1 week ago

It would be advisable to search and check for code that already works with your board first. Especially one that uses the same library (Arduino GFX)

Santix29 commented 1 week ago

i found a code that works on my esp32-s3 with Arduino GFX Library:

#define TFT_BLK 2
#define TFT_RES 14

#define TFT_CS 9
#define TFT_MOSI 11
#define TFT_MISO 12
#define TFT_SCLK 10
#define TFT_DC 8

#define GFX_BL TFT_BLK

Arduino_ESP32SPI *bus = new Arduino_ESP32SPI(TFT_DC, TFT_CS, TFT_SCLK, TFT_MOSI, TFT_MISO, HSPI, true); // Constructor
Arduino_GFX *gfx = new Arduino_GC9A01(bus, TFT_RES, 0 /* rotation */, true /* IPS */);

in this code all the gpio for the display are defined and it have hspi the code seem more simpler than yours so idk if that can help

fbiego commented 1 week ago

In that case, you may need to include HSPI and true in the constructor

https://github.com/fbiego/dt78-esp32-firmware/blob/750739d03cb232f682c9b4b6234c2c92b4d176d9/src/main.cpp#L29-L30

Arduino_ESP32SPI *bus = new Arduino_ESP32SPI(8 /* DC */, 9 /* CS */, 10 /* SCK */, 11 /* MOSI */, 12 /* MISO */, HSPI, true);
Arduino_GC9A01 *gfx = new Arduino_GC9A01(bus, 14, 0 /* rotation */, true /* IPS */);

You also need to make sure the display pins are not conflicting with other declarations, so change unused to -1

https://github.com/fbiego/dt78-esp32-firmware/blob/750739d03cb232f682c9b4b6234c2c92b4d176d9/include/main.h#L3-L10

#define BL 5
#define CHARGE -1
#define BATT -1
#define MOTOR -1
#define B0 -1
#define BT1 -1
#define BT2 -1
#define MPU_INT -1

Also set you touch pins, the existing ones conflict with the display

https://github.com/fbiego/dt78-esp32-firmware/blob/750739d03cb232f682c9b4b6234c2c92b4d176d9/include/touch.h#L4-L7

#define TSCL 7
#define TSDA 6
#define TINT 5
#define TRST 13

[!IMPORTANT]
Double check the pins again with the schematics

[!WARNING]
The IMU in your board is different, probably you will have to comment out the current IMU code

Santix29 commented 1 week ago

i think the IMU code is this: QMI8658

Santix29 commented 1 week ago

i changed this: Arduino_ESP32SPI bus = new Arduino_ESP32SPI(8 / DC /, 9 / CS /, 10 / SCK /, 11 / MOSI /, 12 / MISO /, HSPI, true); Arduino_GC9A01 gfx = new Arduino_GC9A01(bus, 14, 0 / rotation /, true / IPS /);

this: #define TSCL 7

define TSDA 6

define TINT 5

define TRST 13

and this: #define BL 2

define CHARGE -1

define BATT -1

define MOTOR -1

define B0 -1

define BT1 -1

define BT2 -1

define MPU_INT -1

but nothing has changed

fbiego commented 1 week ago

You had some code that worked, can you share the full code in the repo? Also include the board configuration and IDE used

Santix29 commented 1 week ago

The code is this: clock.zip for this code I used Arduino IDE, while for yours I used visual studio code.

fbiego commented 1 week ago

What board are you selecting in Arduino IDE, You need to match the same in VS Code https://github.com/fbiego/dt78-esp32-firmware/blob/750739d03cb232f682c9b4b6234c2c92b4d176d9/platformio.ini#L13

Santix29 commented 1 week ago

yes, i have already changed that because he would give me an error

fbiego commented 1 week ago

This is as far as i can help you since I don't have the same board as you. Maybe someone with more experience and with the same board can help you out. I'll leave the issue open

Santix29 commented 1 week ago

Ok, I understand. Thanks anyway for your help

Santix29 commented 1 week ago

i solved the problem. I found a code on github (forked from yours) that was for the esp32-s3 mini, I changed the pins and now it works. but now I have another problem, when the esp32-s3 receive a notification or I want to send a watchfaces, it seems to reset and lose the connection with the smartphone. i saw the diagnostics of chronos app and it says "WATCH_ERROR_133".