MCUFRIEND_kbv Library for Uno 2.4, 2.8, 3.5, 3.6, 3.95 inch mcufriend Shields

Yes, if you are happy with that choice wiring. Mr altEnergy says that he has tested it. this message contains his SPECIAL

//LCD pins  |D7  |D6  |D5  |D4  |D3  |D2  |D1  |D0  | |RD |WR |RS |CS |RST|
//STM32 pin |PA9 |PA8 |PB15|PB14|PB13|PB12|PB11|PB10| |PA0|PA1|PA2|PA3|PA4|

Altering the data bus pins is fiddly.
Altering the control pins is easy. e.g. move any of the PA0-PA4 pins.

David.

Greetings David
Where can I find in the MCUFRIEND_kbv library the pin settings for the various Arduino boards like Mega, including the ESP for this screen: https://pt.aliexpress.com/item/32908809356.html?spm=a2g0o.cart.0.0.689a3c00Aju6Wi
Remembering it's a Beackout board
Thank you very much

Your other posts imply that you have ESP8266 or ESP32.
Bodmer's TFT_eSPI library works fine with your 3.3V SPI display.

MCUFRIEND_kbv only supports Parallel displays.

David.

Is that I have a sketch that uses your library 'MCUFRIEND_kbv' and would like to adapt it to this display with SPI pins; it's possible?
I leave here the attached sketch,
Thank you

arduino_clock.ino (9.53 KB)

TFT_eSPI has similar methods to Adafruit_GFX which it handles with its own code.

  1. omit Adafruit_GFX.h
  2. omit tft.reset(), tft.readID()
  3. replace tft.begin(ID) with tft.begin()
  4. replace tft.setFont(&FreeFont) with tft.setFreeFont(&FreeFont)
  5. include <TFT_eSPI.h> and TFT_eSPI constructor

You have a similar name-change for other libraries. Nothing is too difficult.

I compiled without TinyGPS because it is not available through the Library Manager.

I attach the modified sketch. Search for .kbv

But first off: RUN ALL OF BODMER'S LIBRARY EXAMPLES ON YOUR ILI9488 SCREEN

Ask if you don't understand something.

David.

dancopy_clock.ino (10.6 KB)

Hi David,
Thank you for the kindness to send me the modified code; I have a few more questions:

  1. Because you say: But first off: RUN ALL OF BODMER'S LIBRARY EXAMPLES ON YOUR ILI9488 SCREEN
  2. How to connect the display pins on the Mega? Is it like on the Adafruit page?
  3. Would this work with ESP8266 as well?
  4. Finally, it showed the following error:

dancopy_clock: 8:22: error: pgmspace.h: No such file or directory
compilation terminated.
exit status 1
pgmspace.h: No such file or directory

Thanks again

I give up.

You have an ESP32 board
You have an ESP8266 board.
You can install TFT_eSPI library
You can read Bodmer's wiring diagrams
You can read Bodmer's instructions for User_Setup.h
TFT_eSPI works fine with your ILI9488 screen. (I have the same screen)

  1. How to connect the display pins on the Mega? Is it like on the Adafruit page?

What are you talking about?
TFT_eSPI is only for Expressif ESP32 and ESP8266 Arduinos.
Your screen is 3.3V It will not work with 5V Mega.

dancopy_clock: 8:22: error: pgmspace.h: No such file or directory

There is no mention of pgmspace.h in the file that I attached.
ESP8266 Cores "know" about pgmspace but might store it in <avr/pgmspace.h> or in <pgmspace.h>

David.

Sorry to leave you confused.

  1. I mentioned ESP because I did not need to use Shift Level for the Display.
  2. The 'pgmspace.h' error persists with the Mega board.

Arduino: 1.8.8 (Windows 10), Placa:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from C:\Users\Daniel\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.h:62:0,

from D:\Arduino\Displays TFT\Display TFT ILI9488\Relógio com Display TFT 3.5 ILI9488 com Arduino Mega e GPS\dancopy_clock\dancopy_clock.ino:33:

C:\Users\Daniel\Documents\Arduino\libraries\TFT_eSPI/Fonts/glcdfont.c:6:22: fatal error: pgmspace.h: No such file or directory

#include <pgmspace.h>

^

compilation terminated.

exit status 1
Compiling error for the Arduino / Genuine board Mega or Mega 2560

If you have a problem, quote which library example produced it.

For a home-grown sketch you need to paste / attach the sketch. Quote library versions, IDE version, target board.

As I explained earlier. TFT_eSPI only applies to Expressif chips.

I do not see how you could possibly use it with a Mega2560 board.

I attached a "modified" sketch in #2739. I can make no claims for the mystery "TinyGPS" because it is not a "known" library. I hope that I have shown the differences in library method()s

I still recommend that you RUN ALL BODMER's EXAMPLES

David.

Hi david, I came back here to try to make this display work, I run the LCD_ID_READNEW example,
My display has always gone white, what can I do to be able to use it?

thank you.

Read Registers on MCUFRIEND UNO shield
controllers either read as single 16-bit
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)

diagnose any controller
reg(0x0000) 00 00	ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 38 80 00	Manufacturer ID
reg(0x0009) 00 00 61 00 00	Status Register
reg(0x000A) 08 08	Get Powsr Mode
reg(0x000C) 06 06	Get Pixel Format
reg(0x0030) 00 00 00 01 3F	PTLAR
reg(0x0033) 00 00 00 01 40 00 00	VSCRLDEF
reg(0x0061) 00 00	RDID1 HX8347-G
reg(0x0062) 00 00	RDID2 HX8347-G
reg(0x0063) 00 00	RDID3 HX8347-G
reg(0x0064) 00 00	RDID1 HX8347-A
reg(0x0065) 00 00	RDID2 HX8347-A
reg(0x0066) 00 00	RDID3 HX8347-A
reg(0x0067) 00 00	RDID Himax HX8347-A
reg(0x0070) 00 A6	Panel Himax HX8347-A
reg(0x00A1) 00 00 00 00 00	RD_DDB SSD1963
reg(0x00B0) 00 00	RGB Interface Signal Control
reg(0x00B3) 00 22 1E 00 00	Frame Memory
reg(0x00B4) 00 02	Frame Mode
reg(0x00B6) 00 24 02 00 00	Display Control
reg(0x00B7) 00 00	Entry Mode Set
reg(0x00BF) 00 00 00 00 00 00	ILI9481, HX8357-B
reg(0x00C0) 0A 0A 0A 0A 0A 0A 0A 0A 0A	Panel Control
reg(0x00C1) 00 07 07 07	Display Timing
reg(0x00C5) 00 20	Frame Rate
reg(0x00C8) 40 40 40 40 40 40 40 40 40 40 40 40 40	GAMMA
reg(0x00CC) 00 00	Panel Control
reg(0x00D0) 00 00 00 00	Power Control
reg(0x00D1) 00 00 00 00	VCOM Control
reg(0x00D2) 00 00 00	Power Normal
reg(0x00D3) 00 01 16 02	ILI9341, ILI9488
reg(0x00D4) 00 00 00 00	Novatek
reg(0x00DA) 38 38	RDID1
reg(0x00DB) 80 80	RDID2
reg(0x00DC) 00 00	RDID3
reg(0x00E0) 00 22 23 25 08 10 14 40 7B 50 0B 1B 22 20 2F 37	GAMMA-P
reg(0x00E1) 00 0C 14 23 0E 14 15 36 59 46 0B 1F 27 1F 20 22	GAMMA-N
reg(0x00EF) 00 00 00 00 00 00	ILI9327
reg(0x00F2) 00 24 04 04 1E 00 00 00 00 00 00 00	Adjust Control 2
reg(0x00F6) 00 00 00 00	Interface Control

You have a 0x1602 controller.

From extras/mcufriend_how_to.txt

UNKNOWN  240x320  ID=0x1602 readGRAM() does not work

The v2.9.8 Library Release should work. (i.e. what the Library Manager installs)
The Beta on GitHub might give you slightly better colours.

I have no idea who makes this controller. If I could find a manufacturer and part number I migt be able to get a datasheet.

David.

I tried but it didn't work, do I need to change something in the library? I'm sending some specifications that I found, I bought it on a site that probably buy from Aliexpress

@tunikovski,

Please do not try to dismantle your shield. You may damage it.

The shield has a screen on one side. It has a Red pcb with male header pins on the other side.

The 0x1602 screen should "work" with Release v2.9.8 but it looks streaky. VERTICAL SCROLL direction is wrong.

If you use the Beta from GitHub the streakiness is reduced. The SCROLL direction is correct.

Whether you bought from Ebay, AliExpress, local website, ... you will have a link to the shop.
I would like to see the pcb. I would like to see components and printed legends e.g. 74HC245, AMS1117, printed www.mcufriend.com

David.

Its ok, the components are the 2 TM74HC245 and a regulator AMS1117 H148

Every example i tested with mcufriend library, stays with white screen

Thanks for the photo of part of your pcb.
That specific section of pcb matches the pcb on my desk exactly. i.e. same components, same copper traces.

Of course I can't see RP1 and the associated copper traces.
I can't see "www.mcufriend.com"
I can't see "2.4" TFT LCD SHIELD"

I don't know what library version(s) you are using.
I don't know what ID was reported by the Library Manager

Seriously. There are several diagnostic sketches in the examples.
Even if you only get a white screen, the sketches often report to the Serial Terminal.

The good news is that you have an AMS1117 regulator.
You may have damaged the screen when you pulled it apart.
Reassemble carefully. Use fresh double-sided sticky foam tape.

It looks as if 0x1602 has been supported since v2.9.2-Beta i.e. Jan 2017
I would expect you to see the display with tft.begin(0x9329)

David.

I use 2.98 version, sorry i thought it was sended to you the pcb, the display its ok, no damage, i opened the mcufriend.cpp and i uncommented the line 17 to try again, "#define SUPPORT_9326_5420"

but doens't works, i tested with another library and force tft.begin (0x9329) and still white, i think when i bought came with display damage, on serial shows like it's working, thank you for your support, i will try again and again :(, if you have the idea what i do, i attach the pcb

Thanks for the full photo. That was easy. Your pcb is exactly the same as the one on my desk.
A picture is worth a 1000 words !!!

Your readreg report looks the same as mine.

I presume you have tried the shield on different Arduinos e.g. Uno, Mega, Due, ...

If you still get a White screen I suspect you just have a damaged shield. And it is too late to ask for your money back. Just buy a new one (which will probably omit the AMS1117)

David.

Hello David,

I very much enjoy the use of your "diagnose_tft_support" program. It works great for me with a "2.4 mcufriend" tft shield I have and I can plink around with your testing examples.

Now, I would like to use an ESP32 module because it has 3.3v . I want to do testing of 8-bit i8080, 3.3v-only lcd panels. Your program is the best one out there I've found for 8-bit mcu interface, so I'd like to use your code, but I'm not in the shield form factor any more. Is there an easy way to setup my own custom pins? I have enough pins, and can control them with Blink, but they're numbered different.

I have pins 2, 4, 5, 12, 13, 14, 18, 19, 21, 22, 23, 25, 26, 27, silkscreened and easily available to me as a user. I've verified pin 2 (built-in led), 5, and 27 with a blink program, that is, i did digitalWrite(5, HIGH) and pin 5 lit up, etc.

The board itself is one of those little 30-pin ESP32-WROOM devkit boards that are commonly available these days. This website has some info: ESP32 DevKit ESP32-WROOM GPIO Pinout | Circuits4you.com , I have the 30-pin variant.

I tried to modify the sketch but couldn't figure out where exactly those default pins were set...

I suppose basically a big brick of commented out //#defines at the start of "diagnose_TFT_support.ino" would solve my problem.

Thanks for the free software!

I strongly advise you to use the TTGO D1 R32 board (and make the minor hardware mods)

Shields will mate with the Arduino headers on the TTGO D1 R32 board.
It will use the default pinout from mcufriend_shield.h

If you want to use a bare display module ( with just a flexi-ribbon ) you must connect all the signals correctly.

David.