Is there a possibility to run this screen?
I went online and found the entire network can activate something that ILI9488 with screen
arduino mega2560
Someone please help me? With drivers or anything that might help.
I will be happy thank you very much
Please post a link to the actual display that you have bought. Or a clear photo of the pcb.
You have a Mega2560 shield with 8-bit parallel interface.
It is write-only. So you can NOT read the controller ID. You just have to guess. Obviously ILI9488 is the first one to try.
The MCUFRIEND_kbv library supports it as a SPECIAL.
Search for mcufriend_kbv and USE_8BIT_MEGA_SHIELD
David.
i have the library mcufriend_kbv but i didnt find how to use 8 bit mega shield?
can you please try to help me?
The is The Defines and setup function.
but the pinout here: UTFTGLUE myGLCD(0x9488,A2,A1,A3,A4,A0);
i think its for arduino uno
can you help me please??
#include <Adafruit_GFX.h>
#include <UTFTGLUE.h>
UTFTGLUE myGLCD(0x9488,A2,A1,A3,A4,A0);
// Declare which fonts we will be using
#if !defined(SmallFont)
extern uint8_t SmallFont[]; //.kbv GLUE defines as GFXFont ref
#endif
void setup()
{
randomSeed(analogRead(5)); //.kbv Due does not like A0
pinMode(A0, OUTPUT); //.kbv mcufriend have RD on A0
digitalWrite(A0, HIGH);
// Setup the LCD
myGLCD.InitLCD();
myGLCD.setFont(SmallFont);
}
The MCUFRIEND_kbv library is designed for readable UNO Shields.
To use with a MEGA Shield (18x2 double row of pins):
mcufriend_shield.h:
#define USE_SPECIAL //check for custom drivers
mcufriend_special.h:
#define USE_MEGA_8BIT_SHIELD
If you look at my examples, you will see that they all work like this:
uint16_t ID = tft.readID(); //see what ID the library reports
if (ID == 0xD3D3) ID = 0x9488; //write-only shields always say 0xD3D3
tft.begin(ID); //start with the correct ID
You need to experiment with 0x9488, 0x9486, 0x9481, 0x1581, ... when you have a write-only Shield.
You can continue to use regular Uno shields on a Uno, Zero, ...
However the Mega2560 and Due will only work with your SPECIAL. (until you remove USE_SPECIAL)
Yes, I know that this is all rather fiddly. But remember that the library is designed for Uno.
David.
ststav:
The is The Defines and setup function.but the pinout here: UTFTGLUE myGLCD(0x9488,A2,A1,A3,A4,A0);
i think its for arduino unocan you help me please??
The library is designed for regular Adafruit_GFX methods.
I provide the UTFTGLUE class as a convenience for legacy UTFT sketches.
I recommend that you do NOT use it in new programs.
Incidentally, the UTFTGLUE constructor ignores all the arguments completely.
When you find the "best" controller ID by using the graphictest_kbv sketch, you make a similar edit to the UTFTGLUE.h init() metchod.
David.
Oops. Looking at your pcb again. It is definitely 8-bit but it might be using pins D30-D37 and not D22-D29.
Please do the edits in #6 and let me know if it all works or not.
David.
david_prentice:
Oops. Looking at your pcb again. It is definitely 8-bit but it might be using pins D30-D37 and not D22-D29.Please do the edits in #6 and let me know if it all works or not.
David.
I am sorry , but i am a starter and i dont know where i need the edits?
please can you tell me more details ? i hope that you will understand me
thank you David! Very Much!
david_prentice:
The MCUFRIEND_kbv library is designed for readable UNO Shields.To use with a MEGA Shield (18x2 double row of pins):
mcufriend_shield.h:
#define USE_SPECIAL //check for custom drivers
This Step I made!
mcufriend_special.h:
#define USE_MEGA_8BIT_SHIELD
This Step I made!
If you look at my examples, you will see that they all work like this:
uint16_t ID = tft.readID(); //see what ID the library reports
if (ID == 0xD3D3) ID = 0x9488; //write-only shields always say 0xD3D3
tft.begin(ID); //start with the correct ID
This Step I did not understand. can u please explain me what to do? You need to experiment with 0x9488, 0x9486, 0x9481, 0x1581, ... when you have a write-only Shield. You can continue to use regular Uno shields on a Uno, Zero, ... However the Mega2560 and Due will only work with your SPECIAL. (until you remove USE_SPECIAL) Yes, I know that this is all rather fiddly. But remember that the library is designed for Uno. David.
You can find the library files by going to your "Documents" e.g.
C:\Users\David\Documents\Arduino\libraries\MCUFRIEND_kbv-master\mcufriend_shield.h
The biggest problem will probably be the Editor.
On Windoze, when you click on the .H file, you have probably only got NotePad to edit it. Notepad is brain-dead. If you use WordPad you have to be careful that it does not introduce a lot of "word processor garbage"
If you have got any normal Text Editor e.g. Notepad++ , you can edit the files very easily.
I can obviously make the edits for you. But would you be able to copy-paste the edited files back into the library?
The library was designed for regular Uno Shields. You never need to edit the library files at all.
I was probably naive in telling people how to use "SPECIAL" shields.
It is easier to just say that no one supports your Shield.
David.
This is the setup() ifrom the example graphictest_kbv.ino:
void setup(void) {
Serial.begin(9600);
uint32_t when = millis();
// while (!Serial) ; //hangs a Leonardo until you connect a Serial
if (!Serial) delay(5000); //allow some time for Leonardo
Serial.println("Serial took " + String((millis() - when)) + "ms to start");
static uint16_t identifier;
// tft.reset(); //we can't read ID on 9341 until begin()
g_identifier = tft.readID(); //
Serial.print("ID = 0x");
Serial.println(g_identifier, HEX);
if (g_identifier == 0x00D3 || g_identifier == 0xD3D3) g_identifier = 0x9481; // write-only shield
if (g_identifier == 0xFFFF) g_identifier = 0x9341; // serial
// g_identifier = 0x9329; // force ID
tft.begin(g_identifier);
}
Ok, the names are different. But this is the line that you change for 0x9488
if (g_identifier == 0x00D3 || g_identifier == 0xD3D3) g_identifier = 0x9488; // write-only shield
David.
This is The Full Code After edited header files :
// All the mcufriend.com UNO shields have the same pinout.
// i.e. control pins A0-A4. Data D2-D9. microSD D10-D13.
// Touchscreens are normally A1, A2, D7, D6 but the order varies
//
// This demo should work with most Adafruit TFT libraries
// If you are not using a shield, use a full Adafruit constructor()
// e.g. Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0
#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin
#include <SPI.h> // f.k. for Arduino-1.5.2
#include "Adafruit_GFX.h"// Hardware-specific library
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;
//#include <Adafruit_TFTLCD.h>
//Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
// Assign human-readable names to some common 16-bit color values:
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
#ifndef min
#define min(a, b) (((a) < (b)) ? (a) : (b))
#endif
void setup(void);
void loop(void);
unsigned long testFillScreen();
unsigned long testText();
unsigned long testLines(uint16_t color);
unsigned long testFastLines(uint16_t color1, uint16_t color2);
unsigned long testRects(uint16_t color);
unsigned long testFilledRects(uint16_t color1, uint16_t color2);
unsigned long testFilledCircles(uint8_t radius, uint16_t color);
unsigned long testCircles(uint8_t radius, uint16_t color);
unsigned long testTriangles();
unsigned long testFilledTriangles();
unsigned long testRoundRects();
unsigned long testFilledRoundRects();
void progmemPrint(const char *str);
void progmemPrintln(const char *str);
void runtests(void);
uint16_t g_identifier;
extern const uint8_t hanzi[];
void showhanzi(unsigned int x, unsigned int y, unsigned char index)
{
uint8_t i, j, c, first = 1;
uint8_t *temp = (uint8_t*)hanzi;
uint16_t color;
tft.setAddrWindow(x, y, x + 31, y + 31); //设置区域
temp += index * 128;
for (j = 0; j < 128; j++)
{
c = pgm_read_byte(temp);
for (i = 0; i < 8; i++)
{
if ((c & (1 << i)) != 0)
{
color = RED;
}
else
{
color = BLACK;
}
tft.pushColors(&color, 1, first);
first = 0;
}
temp++;
}
}
void setup(void) {
Serial.begin(9600);
uint32_t when = millis();
// while (!Serial) ; //hangs a Leonardo until you connect a Serial
if (!Serial) delay(5000); //allow some time for Leonardo
Serial.println("Serial took " + String((millis() - when)) + "ms to start");
static uint16_t identifier;
// tft.reset(); //we can't read ID on 9341 until begin()
g_identifier = tft.readID(); //
Serial.print("ID = 0x");
Serial.println(g_identifier, HEX);
if (g_identifier == 0x00D3 || g_identifier == 0xD3D3) g_identifier = 0x9488; // write-only shield
if (g_identifier == 0xFFFF) g_identifier = 0x9341; // serial
// g_identifier = 0x9329; // force ID
tft.begin(g_identifier);
}
#if defined(MCUFRIEND_KBV_H_)
uint16_t scrollbuf[320]; // my biggest screen is 320x480
#define READGRAM(x, y, buf, w, h) tft.readGRAM(x, y, buf, w, h)
#else
uint16_t scrollbuf[320]; // Adafruit only does 240x320
// Adafruit can read a block by one pixel at a time
int16_t READGRAM(int16_t x, int16_t y, uint16_t *block, int16_t w, int16_t h)
{
uint16_t *p;
for (int row = 0; row < h; row++) {
p = block + row * w;
for (int col = 0; col < w; col++) {
*p++ = tft.readPixel(x + col, y + row);
}
}
}
#endif
And i run it and nothing happned ,
i think that the problem is here:
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0
#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin
This is pinout for Arduino Uno not for Mega (i think) and i dont know the pins for Mega 2560?
please try to help me?
Your pcb "looks" very similar to photos of known 8-bit Mega2560 Shields.
If you have a DMM, you could check whether pin D22 is connected to the nearest Resistor Pack on your pcb.
Or whether D30 is connected to that RP.
Your edits look fine to me. No, you must not change the LCD_CS defines. I do not use them anyway.
I suggest that you double check that your edits got saved back to your PC correctly.
And try again. Obviously with 0x9488, 0x9481, ...
It might be wise to delete the library folder and start again with a re-install with a fresh ZIP from GitHub.
David.
Ayni ekrandan bende de var ve dokunmatik calisiyor ama ekrana görüntü gelmiyor. Bu konuda bilgisi olan var mi?
erensimsek:
Ayni ekrandan bende de var ve dokunmatik calisiyor ama ekrana görüntü gelmiyor. Bu konuda bilgisi olan var mi?
Google Translate says:
I have the same screen and the touchscreen works but there is no image on the screen. Does anyone know about this?
Please use English on this Forum.
"same screen" as what ? ? ?
Does your screen look like the photo in #2 ?
If not, please post a link to the actual screen that you bought.
If it is exactly the same as photo in #2, please read #3 and #6.
David.