Go Down

Topic: MCUFRIEND_kbv Library for Uno 2.4, 2.8, 3.5, 3.6, 3.95 inch mcufriend Shields (Read 464501 times) previous topic - next topic

Mode30


Mode30

Sorry,I couldn't understand the instruction its complicated for me .
My display+blue pill +mcufriend works really well.
Just it uses all PA0-PA7 pins for 8 bit data A0..A7.
I just want to connect these A0..A7 on other pins if possible.
Please advice me easiest way.

Regards

david_prentice

Seriously.    You need to choose your own random wiring if you don't want to use a published wiring.

You can put the databus on PORTB pins.    You can choose other control pins.

David.

Mode30

https://www.stm32duino.com/viewtopic.php?f=9&t=4195&hilit=ili9481&start=30

Please check the link.
This is what I'm looking for.
I,m going to try it now.

Regards

Mode30

https://www.stm32duino.com/viewtopic.php?f=9&t=4195&hilit=ili9481&start=30

With this above instruction,everything working fine.

Thanks David for your time.

Regards

david_prentice

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

Code: [Select]

//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.

Dancopy

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

david_prentice

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.

Dancopy

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

david_prentice

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

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

david_prentice

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)


Quote
2) 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.

Quote
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.

Dancopy

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

david_prentice

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.

tunikovski


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.


Code: [Select]
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

Go Up