I hope this is the right place to post this. I recently purchased a 3.5" TFT MCUFRIEND touch panel from an Ebay seller that was claimed to have an ILI9488 controller. My attempts to drive it using the MCUFRIEND_kbv library were not initially working, except for the touchscreen, but a bit of digging revealed that the controller reported its ID as 9487. A bit of tweaking in the code of the various example sketches etc. to force it to be treat it as a 9488 device got it working perfectly.
I cannot find any documentation about ILI9487. Is it, perhaps, a counterfeit clone?
Anyway, I thought this info might be of use to somebody.
Ilitek seem to have a large number of variants. It is quite likely that the ILI9487 is "similar" to ILI9486 or ILI9488. I can not find a datasheet. Just force tft.begin(0x9486) or whatever.
I think that his illustrates just how easy it is to port / adapt sketches that use Adafruit_GFX style class methods.
I do not have tbillion's DS1302RTC library. So I could not build his sketch.
However I did note:
tft.begin(0x9325); //perlu address ini saat menggunakan lib.SPFD5408_Adafruit_TFTLCD.h
It is wiser to use:
tft.begin(tft.readID()); //.kbv make sure that you use the actual controller on your Shield
because i already know mine is a 9325 and yes i know that code is for the touch screen i really need a crash course with this kbv thing ... what does a glue file do? and how do yo define a special, seems like it would have been faster than what i did...
If you know that your Display contains an ILI9325, of course tft.begin(0x9325) will work.
I just think it is unlikely that others have the same Display as you have.
I was just "guessing" that your sketch was derived from one of Bodmer's examples.
Since many libraries inherit the Adafruit_GFX class, it is easy to port / adapt to another library e.g. MCUFRIEND_kbv.
It is inevitable that there are minor syntax differences between libraries.
All that a "GLUE" class does is provide the missing methods. Implementing them with the methods from your native library.
The library expects a standard Uno Shield mating with a standard Arduino Platform. You do not need to do anything except for selecting the correct Target Platform in the IDE.
The mcufriend_special.h file contains conditional code for SPECIAL wiring e.g. not using standard Shield.
Oh, my Touch example might identify a controller and use the TS_LEFT, TS_RIGHT, ... values that I have found on real-life Shields. There is no guarantee that any Shield bought from Ebay is wired the same. It is just a good start.
Hi guys!,
I have some troubles with the touch screen of my display, is a mcufriend 3.95" TFT LCD and i'm using an arduino mega for drive it. The display works fine showing images and stuff, but the touch screen it's doing something weird, it's doing a shift in the x axis. I calibrated the touch screen but that don't solve my problem. I draw some "straight lines" with the Touch_shield_kbv example and the lines get curved (i attached some photos that shows what i'm saying).
This is the data of my display:
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)
Making all control and bus pins INPUT_PULLUP
Typical 30k Analog pullup with corresponding pin
would read low when digital is written LOW
e.g. reads ~25 for 300R X direction
e.g. reads ~30 for 500R Y direction
The YP, XM pins are fine. i.e. your diagnosis was the same as used by the example sketch.
Your Calibration values look quite normal too. I would expect the red dot to follow your stylus across the screen perfectly when you use the Calibration results.
It's not only with this example that this thing happend, if i just print in the serial monitor the values of x and y i can see how the x values rapidly increase in some regions but go "normal" in others. The increasing and decreasing values of x are not lineal. I can not figured out why this is happening, and i can't find someone who is experiencing the same.
I would apreciate some fresh thought about this.
Thanks in advance for your help.
It is usually caused by faulty touch pad.
In case of the resistive touch pads, there is a non-conductive, matrix-style layer between the two resistive layers. If the non-conductive layer is partially damaged (e.g. scrapped during manufacturing test), the "sensitivity" (or accuracy/linearity) of the touch pad degrades, since the resistive layers will be able to contact together on an extended area when you push it. Theoretically, the touch pad is similar to a potentiometer (actually a pair). If the slider of this potentiometer touches several points on the resistive track, it causes non-linearity issue.
You can check the correct operation of your touch pad using a DMM.
I hope it helps.
I would agree with makoshatu. If your resistive screen is touching in two places, the "potentiometer" becomes non-linear.
You are very lucky to get a 3.95" screen that is NOT visibly broken. Ebay vendors do not protect the package contents very well. The 2.4" Shields are pretty robust. 3.5" and 3.95" seldom survive the journey.
My 3.95" ILI9488 Shield works quite well.
@Attila,
Good to hear from you. Several new 0x6814 Displays have appeared. All the new ones expect PIXFMT=0x55. Some are 272x480. Most are 320x480. I have changed the default to PIXFMT=0x55 in the current library.
Which means that your 0x6814 now requires a PIXFMT=0x66 sequence.
It would be nice to know if I could distinguish between your 0x6814 (PIXFMT=0x66) and the new 0x6814 Displays.
Please could you make a minor change to setup() in LCD_ID_readreg.ino:
...
lcdInit();
lcdReset(); //ensures that controller is in default state
for (uint16_t i = 0; i < 256; i++) readReg(i, 7, "f.k");
readReg(0x00, 2, "ID: ILI9320, ILI9325, ILI9335, ...");
readReg(0x04, 4, "Manufacturer ID");
...
This will show up all registers. Most of them will be empty. Please you could attach / paste your 0x66 result.
It could be compared with the new "PIXFMT=0x55" Shields. (Please could one 0x55 owner paste their result)
If I can find a difference, I could distinguish the two Shields and begin(0x6814) could configure automatically.
Hi, bought new 3.97 mcufriend tft lcd from aliexpress. it works with utouch calib but simple touch calib doesnt work at all and touch shield gives me 90 offset when i touch to draw. Please guide me. also some text issues are there as well. See drive link.
Have you seen AWind? or TFT Extension? they say they both work with UTFT, how hard would it be to convert them to work with the Adafruit graphics and mcufriend_kbv? kinda smoosh them all together and make the mcufriend_gui_building_extravaganza library ... lmao
I had never heard of "Awind" or "TFT Extension".
Googling "Awind" reveals that it uses UTFT and URTouch.
<URTouch.h> expects a hardware XPT2046 Touch Controller.
<TouchScreen.h> reads the bare resistive Touch Panel on Mcufriend Uno shields.
<UTFT.h> programs can be "ported" fairly easily with the UTFTGLUE class.
<URTouch.h> programs require a bit more help.
The Adafruit_GFX class is much more intuitive. GFX_Buttons are a lot easier to program.
So if anyone wanted to write a GUI from scratch would probably start with Adafruit-style libraries.
I suggest that you stick to Adafruit. Gain experience by adapting examples. Write your own sketches ...
If you have a legacy UTFT program, I am willing to help to get it running on Mcufriend Shields with UTFTGLUE.
You should never mix UTFT methods and Adafruit methods in a new program. Stick to one or the other.
thanks for the response, im currently just gutting the awind project and converting it one functin at a time to the adafruit graphics libraries from there it should be able to "just work". its kinda a big pain in the butt. i hadnt seen the adafruit buttons library i am off to go search it out, maybe in the end we can have a good quick gui for these displays.
You certainly do not want to convert the whole Awind library by hand. There seems to be quite a lot of it.
I would get it running with UTFTGLUE first. That should avoid the inevitable typos and syntax errors when you do stuff by hand. For example, you can get most of the official UTFT examples running by simply changing the include and constructor to UTFTGLUE.
If you are very keen to use Awind library, you could ask the Author about Adafruit methods.
im not really keen to it but i do like (from the screenshots) what hes done with it. I am in the middle of a project i haven't had much time to study on the UTFT glue stuff the couple examples i tried to run didnt work and about bought me a new strand of neopixels (no big deal asian clone boards) a good and complete tutorial to the finer aspects of mcufriend kbv would be wonderful, if there isnt one already sometimes to just simply read something is better than fishing through code comments, not saying anything negative, just saying in order to understand one must learn and all people learn differently, especially non code natured people. I have been in code for a long time, not as long as others but i have to remember at times its not always me who may be using something i have done