Metro Esp32-S2 and 2.8" TFT Cap Shield

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
phineasphred
 
Posts: 15
Joined: Mon Mar 14, 2016 12:05 pm

Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by phineasphred »

Just got the Metro and tried both the graphicstest and the mock_ili9341 example sketches and I get nothing. The screen clears to white and then nothing happens.

Both sketches upload with no issues. I hit the reset button after uploading. Then I unplugged the board and installed the shield. Plug the board back in and it doesn't work.

I'm powering it through the USB port. Does the power switch have to be on or off if powering this way? Does this matter?

Any ideas as to what I'm missing?

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by mikeysklar »

Set the power switch to "on".

Did you open a serial console?

The Metro ESP32-S2 is so fast it might require a delay(500) before initialization here:

Code: Select all

  tft.begin();

User avatar
phineasphred
 
Posts: 15
Joined: Mon Mar 14, 2016 12:05 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by phineasphred »

I added the delay in the graphicstest sketch. In fact I added a 1 second delay as the first line of setup() and another 1 second delay before tft.begin():

Code: Select all

  
  delay(1000);
  Serial.begin(9600);
  Serial.println("ILI9341 Test!"); 
  delay(1000);
  tft.begin();
  
When I power up the Metro and open a serial console I get this:

Code: Select all

ILI9341 Test!
Display Power Mode: 0xDE
MADCTL Mode: 0x0
Pixel Format: 0x7
Image Format: 0xC0
Self Diagnostic: 0xE0
Benchmark                Time (microseconds)
Screen fill              200229
Text                     25458
Lines                    248294
Horiz/Vert Lines         18607
Rectangles (outline)     12682
Rectangles (filled)      416057
Circles (filled)         90811
Circles (outline)        110537
Triangles (outline)      54966
Triangles (filled)       165928
Rounded rects (outline)  54488
Rounded rects (filled)   429130
Done!
But nothing draws on the screen and it's just white.

Anything else to try?

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by mikeysklar »

The code is running and communicating with the screen. This makes me think maybe the ribbon connector is not fully seated properly. Can you pull the black latches and try re-seating it?
ribbon-connector.jpg
ribbon-connector.jpg (65.74 KiB) Viewed 284 times

User avatar
phineasphred
 
Posts: 15
Joined: Mon Mar 14, 2016 12:05 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by phineasphred »

Sorry, I should have said that I do have this working correctly using a Metro M0. I can run all my sketches and they all display perfect. I'm just not able to do the same thing with the Metro Esp32-S2.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by mikeysklar »

Looking at the Metro ESP32-S2 pinout it is clear the SPI pins are on the ICSP header (2x3) 6-pin header.

You most likely need to cut the jumpers on the underside of the shield for pin 11-13 and solder the jumpers for the ICSP pads. The guide formatting makes it sound as though this only for the resistive shield, but the wording indicates it is for any modern CircuitPython boards.

https://learn.adafruit.com/adafruit-2-8 ... ld-3034982

User avatar
phineasphred
 
Posts: 15
Joined: Mon Mar 14, 2016 12:05 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by phineasphred »

Thanks for the response. If you look at the jumpers on the Cap shield you'd notice that the jumpers are hardwired for ICSP already and NOT 11-13. So, that's not the problem.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by mikeysklar »

Good point. The v2 guide includes a v1 photo so not matched to the project page photo.

Since the serial console is showing the SPI interface as working, but the display itself not showing anything I suspect SPI related settings. The first will probably resolved it, but you might be able to get hardware SPI going with #2, #3.

1) Try the bitbang constructor by manually passing in all the pins. Keep in mind the pin numbers are different on the ICSP header.

Code: Select all

// If using the breakout, change pins as desired
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
Screenshot from 2023-04-02 15-19-12.png
Screenshot from 2023-04-02 15-19-12.png (83.76 KiB) Viewed 261 times
2) SPI bus speed - you can try this as a work around

Code: Select all

tft.begin(3000000);
3) SPI Mode which would have to be set with modifying Adafruit_ILI9341.cpp

Code: Select all

initSPI(freq, SPI_MODE3);

User avatar
adafruit2
 
Posts: 22111
Joined: Fri Mar 11, 2005 7:36 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by adafruit2 »

dont forget the S2 has different numbers for pins on TFT CS/DC/Reset, not the standard arduino pins

User avatar
phineasphred
 
Posts: 15
Joined: Mon Mar 14, 2016 12:05 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by phineasphred »

Please let me know if these are correct:
Metro-M0 : TFT_CS = 9, TFT_DC = 10, TFT_MOSI = 23, TFT_CLK = 24, TFT_RST = ?, TFT_MISO = 22
Metro-S2 : TFT_CS = 14, TFT_DC = 15, TFT_MOSI = 35, TFT_CLK = 36, TFT_RST = ?, TFT_MISO = 37

I don't know which pin Reset is on for either board so not sure what to put in there.

I tried using -1 for TFT_RST on the M0 and it locked up.

User avatar
adafruit2
 
Posts: 22111
Joined: Fri Mar 11, 2005 7:36 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by adafruit2 »

for TFT clock/mosi just use the built in SPI hardware definition can use -1 for TFT_RST

User avatar
phineasphred
 
Posts: 15
Joined: Mon Mar 14, 2016 12:05 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by phineasphred »

So, as I said in my previous post that's what I did. But when I set all the other to what I indicated the M0 locked up.

Can you verify that this should work for the M0:

Code: Select all

Adafruit_ILI9341 tft = Adafruit_ILI9341(9, 10, 23, 24, -1, 22);
And this should work for the S2:

Code: Select all

Adafruit_ILI9341 tft = Adafruit_ILI9341(14, 15, 35, 36, -1, 37);

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by mikeysklar »

I placed an order for the Metro ESP32-S2 and 2.8” TFT Cap shield. You will probably resolve this before I receive the parts, but if not I’ll determine the pinouts and post them.

User avatar
adafruit2
 
Posts: 22111
Joined: Fri Mar 11, 2005 7:36 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by adafruit2 »

you should be using the hardware SPI port, not the GPIO pins

Code: Select all

// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);

User avatar
phineasphred
 
Posts: 15
Joined: Mon Mar 14, 2016 12:05 pm

Re: Metro Esp32-S2 and 2.8" TFT Cap Shield

Post by phineasphred »

adafruit2 I don't think you're up to date on the whole thread. Please read above.

I'm trying to get the display to work with the Metro ESP32-S2. I already have it working with the Metro M0. I was trying to set all the pins on the M0 since I already knew it would work with just setting CS and DC. If I could get it to work setting all the pins on the M0 then it seems it should work with the S2 just by changing the pin numbers.

I'm unable to get the M0 working by setting all the pins, so how would I get the S2 to work using the same idea?

The issue here is NOT getting it to work on the M0 but getting it to work on the Metro ESP32-S2.

Is the M0 considered a UNO? I'm assuming if I use those values for the M0 I should be able to set all the values? I'd still like to know how to get the S2 to work.

Thanks for your response though.

Locked
Please be positive and constructive with your questions and comments.

Return to “Metro, Metro Express, and Grand Central Boards”