• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

SP32 Display Capacitive Touchscreen ESP-32 ESP-WROOM-32 Development Board ST7789 I2C hangs

Q&A Forum › SP32 Display Capacitive Touchscreen ESP-32 ESP-WROOM-32 Development Board ST7789 I2C hangs
0 Vote Up Vote Down
Michael Mosseau asked 2 weeks ago

Hi,  I’m new to this board and my project uses the I2C bus.  I use the default GPIO pins IO21-SDA and IO22-SCL.

When I run my program stripped down with no graphics or touch screen the program runs fine on the board and communications with my I2C peripheral works perfectly.  When I modify a working graphics-touchscreen program to include I2C by adding I2C the program run on the same board, it compiles but then hangs when I add Wire.begin();  The graphics will load but the touchscreen stuff quits working.  I tweaked a bit with trying to reassign SDA and SCL, but that didn’t seem to help.  The documentation isn’t the greatest and there are limited GPIO pins available to use.

 

Any help would be greatly appreciated

Thanks!

1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 weeks ago

Hi.
 
If you have a CYD board like ours, GPIO 21 is used to control the backlight of the display. So, I don’t recommend using that GPIO for I2C communication.
You can learn more about the pinout of the board here: https://randomnerdtutorials.com/esp32-cheap-yellow-display-cyd-pinout-esp32-2432s028r/
 
Instead, I recommend using GPIOs 22 and 27.
SDA – GPIO 27
SCL – GPIO 22
 
So, you need to set a custom I2C bus on those pins.
An example is this tutorial, in which we connect a BME280 sensor. Take a look at the code and see how we used the custom pins for I2C communication:https://randomnerdtutorials.com/esp32-cyd-lvgl-display-bme280-data-table/
 
I hope this helps.
 
Let me know if you can fix the issue.
 
Regards,
Sara
 

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.