Round Display with Xiao Nrf52840 Sense ,TFT_eSPI , LVL Example

Hi there,
I have done it this way. for a locking device as well as BLE device pairing also.
this is the tech involved it’s extremely reliable and requires almost no power with sleep mode being used. I can use a card for access VIA the phones NFC reader.
(insert video) WIP.
Near Field Communication (NFC) tags can be used to configure Wi-Fi so that users can connect to a network without needing to enter a password. This can be useful for allowing guests to connect to Wi-Fi at a home or business without sharing the password.

Here are some steps for using NFC to configure Wi-Fi:

  1. Turn on NFC on your phone
  2. Go to Settings, then Connections, and then Wi-Fi
  3. Long press on the network you want to connect to
  4. Select NFC tag from the menu that appears
  5. Enter the password for the network
  6. Touch your phone to the NFC tag to write the Wi-Fi profile to it
    You can also use an app like NFC Task Launcher to program an NFC tag with your Android device.
    Also works with Google and Alexa.

HTH
GL :slight_smile: PJ
:v:

HERe it is in Action, This is just a portion of the FULL monty… :wink: :+1:

Notice the NFC tag/Sticker on the top (Black Circle) could be a Xiao also.
HTH
GL :slight_smile: PJ
:v:

Thanks for the example! GJ there.

(And also good to see you’re also a photography enjoyer :wink:)

1 Like

i was wondering when you told me in the past you were working on a camera lens… i think at the time we were talking about how crappy the S3 camera was… and I thought you were inventing a lens for that… and i was thinking … What Da?.. I dont think that is going anywhere… lol

I’m sorry I’m late! I will be testing as soon as possible based on this feedback.

Hi there,
Something I notice that appears to be a common OVERSITE when using or testing with the
TFT_eSPI lib. The examples include a Diagnostic from the Author that is meant to be run after the edits are made to verify what the LIB recognises as setup.

“READ_USER_SETUP.ino”
Do not proceed further if it doesn’t look like it should or if it does NOT run at all , it means you knurled it Up.
You should receive a serial output like this:

[code]
TFT_eSPI ver = 2.5.23
Processor    = ESP32
Frequency    = 160MHz
Transactions = Yes
Interface    = SPI
Display driver = 9A01
Display width  = 240
Display height = 240

MOSI    = GPIO 10
MISO    = GPIO 9
SCK     = GPIO 8
TFT_CS   = GPIO 3
TFT_DC   = GPIO 5

TFT_BL           = GPIO 21

Font GLCD   loaded
Font 2      loaded
Font 4      loaded
Font 6      loaded
Font 7      loaded
Font 8      loaded
Smooth font enabled

Display SPI frequency = 40.00
[/code]

This is the process I use and it get’s me there EVERY Time!
HTH
GL :slight_smile: PJ
:v:

1 Like

yeah i NEVER PROCEED FURTHER… hell i dont even prceed that far!

I have just got one of these and I its proving a challenge? Does it need the battery in the back to work? The screen is on and I am trying to run the demos?

HardwareTest fails to compile
LvglBenchmark fails to compile
TFT_eSPI_Clock compiles, but shows nothing on the screen or the monitor
TFT_eSPI_GifPlayer fails to compile with a missing library AnimatedGIF.h that is refusing to install it seems.
I don’t dare run TP_firmware_update …

I feel like sending it back…

Hi there,
No it does NOT require the Battery to test with just USB will get it done.
There is a DRAG and DROP Uf2 file posted on here, it’s in a zipit has the build with all the correct LIBs, that is the issue, The BSP has to be a certain one as well.
If you use the TFT_eSPI lib run the Usersettings.ino first or after you made your edits to see if they are what you expect.
If it turns on! it’s NOT defective. Fix the software part…:+1:
HTH
GL :slight_smile: PJ :v:

I managed to get something out of this, it will detect screen touches–but when I load the next demo I see this.

Build:Feb  7 2021
rst:0x8 (TG1WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40380082
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x1058
load:0x403cc710,len:0x8a8
load:0x403ce710,len:0x2fac
entry 0x403cc710
ESP-ROM:esp32c3-api1-20210207

So now its continuously crashing the ESP32C3 I got plugged in? This is code it is running…

#include <TFT_eSPI.h>
#include <SPI.h>
#define USE_TFT_ESPI_LIBRARY
#include "lv_xiao_round_screen.h"

lv_coord_t touchX, touchY;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);

  pinMode(TOUCH_INT, INPUT_PULLUP);
  Wire.begin();
  
  // Initialise the screen
  tft.init();

  tft.setRotation(0);
  tft.fillScreen(TFT_BLACK);
}

void loop() {
  // put your main code here, to run repeatedly:
  if(chsc6x_is_pressed())
  {
    Serial.println("The display is touched.");
    chsc6x_get_xy(&touchX, &touchY);
    tft.drawCircle(touchX, touchY, 15, TFT_WHITE);
  }
  
  delay(50);
}

Is there som secret to recovering from a crashing binary; I am unable to download any more code because it reports the serial line is busy…

I feel like this is the third chip I have toasted like this? It is impossible to work with?

Hi there,
Not unusual at all, once you learn your way around , you’ll get the flow.
Stop crashing by using Boot loader mode. Step 1
You switched from a Nrf52840 to a C3 ?
LMK
GL :slight_smile: PJ :v:

I just grabbed a old round eye from my drawer and compiled and display the demo no issue’s

It is the line that sets up the TFT.init() line that causing it to crash. And this is the version of TFT library I have installed?

Screenshot 2024-10-03 at 20.23.22

Hi there,
So what in the heck are you trying to do?
Get the display to work? or run some example?
pick an MCU and stay with that until you do.

I recommend you start with getting it to work.
HTH
GL :slight_smile: PJ :v:

Ok, so BTW the above code compiles and runs , outputs the display is touched via serial port.

I just trying to understand why it doesn’t work? There is something wrong with the TFT library maybe? What version are you using?

That is the code I am trying to get to work PJ?

YES, you need to use the one linked from the WiKi, 2.5.23
HTH
GL :slight_smile: PJ

Look at the compiler output I posted , match what I have it will work!
PITA i know but that is how it is. :v:

FYI I’m using the 2.0.11 BSP for esp32c3 in Arduino IDE 2.3.3

PJ,
I just did that and I get this…

In file included from /Users/localuser/Arduino/libraries/TFT_eSPI/TFT_eSPI.h:98,
                 from /Users/localuser/Arduino/libraries/TFT_eSPI/TFT_eSPI.cpp:16:
/Users/localuser/Arduino/libraries/TFT_eSPI/Processors/TFT_eSPI_ESP32_C3.c: In function 'void dc_callback(spi_transaction_t*)':
/Users/localuser/Arduino/libraries/TFT_eSPI/Processors/TFT_eSPI_ESP32_C3.h:180:22: error: 'GPIO' was not declared in this scope
  180 |         #define DC_D GPIO.out_w1ts.val = (1 << TFT_DC)//;GPIO.out_w1ts.val = (1 << TFT_DC)
      |                      ^~~~
/Users/localuser/Arduino/libraries/TFT_eSPI/Processors/TFT_eSPI_ESP32_C3.c:790:28: note: in expansion of macro 'DC_D'
  790 |   if ((bool)spi_tx->user) {DC_D;}

OK, so check the BSP you are using , first line of the compiler output?
what is it?
PJ :v:

should look like this;

FQBN: esp32:esp32:XIAO_ESP32C3
Using board 'XIAO_ESP32C3' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11
Using core 'esp32' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11
____ EDIT for brevity___
Using library TFT_eSPI at version 2.5.23 in folder: D:\Arduino_projects\libraries\TFT_eSPI 
Using library SPI at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\SPI 
Using library FS at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\FS 
Using library SPIFFS at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\SPIFFS 
Using library Seeed Arduino Round display at version 1.0.0 in folder: D:\Arduino_projects\libraries\Seeed_Arduino_Round_display 
Using library lvgl at version 8.3.7 in folder: D:\Arduino_projects\libraries\lvgl 
Using library Wire at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\Wire 
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\riscv32-esp-elf-gcc\\esp-2021r2-patch5-8.4.0/bin/riscv32-esp-elf-size" -A "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\1777BB0415837D74F4ACE98E26042B5C/sketch_oct3b.ino.elf"
Sketch uses 283838 bytes (21%) of program storage space. Maximum is 1310720 bytes.
Global variables use 14148 bytes (4%) of dynamic memory, leaving 313532 bytes for local variables. Maximum is 327680 bytes.

Scroll the box, to see the versions.>>>
It’s the first 3 lines & the Last 20 ish ones.

What do you see when you compile, Post it using the code tags above </>
:v:

Quick check list:
Round Display by Seeed
Xiao ESP32C3 in the socket seat
BSP (Board support package) Espressif esp32 ver. 2.0.11 (3.0.5) is the current one.
TFT_eSPI graphics library, version 2.5.23 Installed from Wiki as TFT_eSPI_Master ?(just add it)
Lvgl if you use it, 8.3.7 all things equal.
NOTES edit the User_setup.h to the correct items (one display driver at a time ONLY, etc.)
for C3, S3 " #define GC9A01_DRIVER" is in the User_Setup.h…
User_setup_select.h Should be setup66 for seeed round display, BTW…
USE the User settings ino to test your settings.(edits)
load the demo and compile. should work from the get go.!
HTH
GL :slight_smile: PJ :v:

As an aside to the ROUND display.
So the Seeed Studio Round Display , albeit very nice looking is the Hardest of the seed products I would argue to get too work. Not because it’s not good hardware but the software is tricky. Once you get it going and gain the knowledge that it takes, it’s like a secret decoder ring for a lot of seeed MCU’s (BSP’s and LIB version) always has been but necessary to know as a new person trying to figure it out. (start with the RGB_Blinker.uf2 as a safety net , IMO) can be frustrating but rewarding all at the same time.
ASK FOR HELP!
best words I can offer.
GL :slight_smile: PJ :v:

Just to put a BOW on this , @Mark_Lucking did a master work article on Medium for the “round eye display” :wink: I suggest you read it to be re-inspired to take the technology on head long. Great Article!! and thanks for the props. :v:

1 Like