Please post a link to the actual display that you are using.
RS (register select) is another name for DC (data/command)
Since you appear to have DB0-DB14 it seems rather unusual
8080-16;would need DB0-DB15
8080-18 would need DB0-DB17
8080-8 would need DB0-DB7 or DB8-DB15
The quality of any reply depends on the quality of your question.
Most of those displays with 34 pins have multiple connections.
Most of them can be connected through spi as well as parallel so it should work. But ymmv.
(According to Google that is, my similar display was killed during transport, cannot confirm personally)
I've looked at scores of sites and tried multiple approaches - nothing has worked. The support I've seen on this thread seems promising, so I'm hoping someone can help a noob out here.
What I've done:
Firmware - https://nodemcu-build.com/
I have updated it from master branch, using modules: bit, file, gpio, net, node, spi, tmr, uart, ucg, wifi
Following th update, I can communicates with the chip from ESPlorer
Once I upload code from Arduino editor, ESPlorer no longer communicates (see below)
Ardurino editor - ...you probably know the site since it hosts this forum!
In preferences, I have identified http://arduino.esp8266.com/stable/package_esp8266com_index.json as the source of additional boards. From this, I am able to select "NodeMCU 1.0 (ESP-12E Module)" as the board
Details: CPU Frequency: 80 Mhz, Flash Size: 4M (3M SPIFFS), Upload Speed: 115200, Port: COM 5
Board Info: BN: Unknown board, VID: 10C4, PID: EA60, SN: Upload any sketch to obtain it
Programmer: AVRISP mkll
My .ino Code: #include <TFT_eSPI.h> // Hardware-specific library #include <SPI.h>
TFT_eSPI tft = TFT_eSPI(); // Invoke library, pins defined in User_Setup.h
TFT_eSPI library
User_Setup.h //(I am only showing active code) #define ST7735_DRIVER #define TFT_WIDTH 128 #define TFT_HEIGHT 128 #define ST7735_GREENTAB128 // For 128 x 128 display #define TFT_CS PIN_D8 // NOTE: I have also tried: 15 #define TFT_DC PIN_D3 // NOTE: I have also tried: 0, PIN_D2, 4, PIN_D4, 2, and 1 // Data Command control pin #define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V #define TFT_MOSI PIN_D7 // NOTE: I have also tried: 13, and leaving undefined #define TFT_SCLK PIN_D5 // NOTE: I have also tried: 14, and leaving undefined
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm #define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts #define SPI_FREQUENCY 27000000 // Actually sets it to 26.67MHz = 80/3
TFT_Drivers\ST7735_Defines.h
LINE 7: #define TFT_HEIGHT 128 // NOTE: I have also tried the default: 160
Physical Connections:
Display NodeMCU
Vin 3.3V // (one by flash button in corner, same side as all other connections except RST)
// NOTE: I have also tried leaving this disconnected and just using LITE
3V3 Not connected // This is identified as an "output" in documentation... I have tried it - doesn't work
Gnd GND // Right next to 3.3V listed 2 lines above
SCK D5
MISO Not connected // Don't need to "read" screen
MOSI D7
TFT_CS D8
RESET RST // (other side of board, 3rd pin from RST button).
// NOTE: I have also tried D4 (changing User_Setup.h to PIN_D4 and 2))
D/C D3 // NOTE: I have also tried D2, D4, and TX
CARD_CS Not connected
LITE 3.3V // NOTE: I have also tried leaving this disconnected and just using Vin
Thanks in advance for your help. ...I really have put lots of work into this trying to avoid bothering you with this, but I'm stuck and would appreciate it if you could help a brother out.
It is not clear whether you are using an ESP8266 and ESP32 Board. Make sure the board support packages for the boards used are loaded and seen by the IDE. Try and compile and uploadsome simple examples first for the ESP8266 or EP32 (blink etc). Once that is working error free then move on to use the TFT library.
#include <pgmspace.h>
Should be accepted by the compiler.
If the correct board is selected, eg. Nano etc, then the IDE examples should compile without error.
If you select the ESP32 or ESP8266 boards in the IDE then the TFT_eSPI examples should compile OK. Once this has been achieved with no error configure the library for your TFT by editing the User_Setup.h file inside the library folder.
The XPT2046 touch screen controller is supported. The SPI bus for the touch controller is shared with the TFT and only an additional chip select line is needed.
Example is included for 480x320 RPi display "Touch_Controller_Demo", the screen calibration data is stored in the SPIFFS.
I have added the Button display and handling class from Adafruit_GFX. This is enhanced in that any font can be used for the button labels.
The touch screen functions built into the TFT_eSPI library (XPT2046 supported) have also been updated to improve touch detection reliability.
A simple on/off switch example has been added that tests the touch screen, this does not use the Button class.
A keypad example a for 240x320 TFT has also been added which demonstrates use of the Button class:
The touch screen handler saves the screen x,y calibration data in a SPIFFS file, so at the moment the touch screen only works with the ESP8266. Although SPIFFS support has recently been added to the ESP32 board package I have not tried it yet.
The touch and button class work fine with the RPi "Waveshare" style 320x480 display. The connection image in the library tools folder has been updated to show the MISO pin (to read the XPT2046 touch controller) and the chip select line connections.
Note: the library expects the touch controller and the TFT to share the same SPI lines. Different chip select lines are used and defined in the User_Setup.h file.
A new sketch has been added purely for touch screen calibration and test. This one does not need SPIFFS, the calibration code is posted to the Serial Monitor for easy cutting and pasting into a sketch.
The touch screen detection handling functions in the library have been updated to improve the touch detection reliability and positional accuracy.
If you hate the screen flicker when updating graphics on the screen then the latest edition of TFT_eSPI may be of interest.
I have added a "Sprite" class, this allows images to be created using graphics functions (drawLine() etc etc) from the sketch, the sprite (aka bitmap image) can then be pushed to anywhere on the screen very quickly.
The good news is very smooth flicker free screen updates are possible, the bad news is that large sprites consume a lot of RAM, this means that for the ESP8266 you are limited to a sprite of about 160x128 pixels which consumes 40Kbytes of RAM. I may make 8 bit pixels an option next to halve the RAM need.
Drawing graphics into a RAM based sprite (effectively a mini RAM screen) is very fast, the complete Adafruit graphicstest runs in less than 27 milliseconds in a 160x128 sprite.
Here is a quick demo where a 240x30 pixel sprite is generated, graphics drawn into it + text, and then pushed onto the TFT. By moving the text 1 pixel at a time for each push to screen the text scrolls across smoothly.
In the demo large "Adafruit GFX" style font digits are also drawn into a sprite with some background graphics, then pushed to screen. This eliminates flicker and allows complex graphics backgrounds (shading etc) behind changing numbers.
Sprites can be created. pasted to screen then deleted to recover RAM. This means sprites can be created at will with different sizes to update particular areas of the screen.
At the moment I have created 4 examples to show how to use sprites.
I have added support for sprites with 8 bit colour depth (3 bits red, 3 bits green, 2 bits blue), this halves the RAM required compared to a 16 bit colour sprite but reduces the colours available for graphics operations within the sprite.
Here are screen shots using 16 bit colours (65536 different colours):
8 bit colours in comparison have only 256 as follows:
Hello,
I face a strange problem.
Two months ago I compiled the examples in 480x320 pixels for ESP 32 and it worked perfectly but now when I complicate again I get the following errors:
C:\Users\Lienard Vivien\Documents\Arduino\libraries\TFT_eSPI-master\TFT_eSPI.cpp:1334:83: error: array subscript has type 'char' [-Werror=char-subscripts]
GFXglyph *glyph = &(((GFXglyph *)pgm_read_dword(&gfxFont->glyph))[uniCode]);
C:\Users\Lienard Vivien\Documents\Arduino\libraries\TFT_eSPI-master\TFT_eSPI.cpp:4421:20: error: 'yo16' may be used uninitialized in this function [-Werror=maybe-uninitialized]
int16_t xo16, yo16;
C:\Users\Lienard Vivien\Documents\Arduino\libraries\TFT_eSPI-master\TFT_eSPI.cpp:4421:14: error: 'xo16' may be used uninitialized in this function [-Werror=maybe-uninitialized]
int16_t xo16, yo16;
C:\Users\Lienard Vivien\Documents\Arduino\libraries\TFT_eSPI-master\TFT_eSPI.cpp:1512:20: error: 'yo16' may be used uninitialized in this function [-Werror=maybe-uninitialized]
int16_t xo16, yo16;
C:\Users\Lienard Vivien\Documents\Arduino\libraries\TFT_eSPI-master\TFT_eSPI.cpp:1512:14: error: 'xo16' may be used uninitialized in this function [-Werror=maybe-uninitialized]
int16_t xo16, yo16;
I can not understand why, Help would be welcome
Thanks in advance.
Vivien16
Sprites can now be scrolled, there is a new demo example showing a smoothly scrolling graph and text
fillSprite() & sprite fillRect() performance improvement using memcpy() function
The "fill" performance boost means the entire Adafruit graphicstest runs within a 160x128 sprite in 15ms for 8 bit colours, or 18ms for 16 bit colours (was 28ms). This indicates how fast graphics rendering can be inside a sprite.
Please report any issues on Github, or as a post on this forum.