2,8" tft lcd, Unknown LCD driver chip: 0 error

Hi, first of all im kind of a noob when it comes to lcd’s but i bought a 2,8" tft lcd and i installed the 3 adafruit drivers it needed: TFTLCD-Library-master, Adafruit-GFX-Library-master, Adafruit_TouchScreenmaster.

i put them in my / program files / arduino / libraries / folder. i uploaded the graphicstest example and nothing happened i just got a white screen, same as it was before and in the serial i got this message:

TFT LCD test
Using Adafruit 2.8" TFT Breakout Board Pinout
TFT size is 240x320
Unknown LCD driver chip: 0
If using the Adafruit 2.8" TFT Arduino shield, the line:
** #define USE_ADAFRUIT_SHIELD_PINOUT**
should appear in the library header (Adafruit_TFT.h).
If using the breakout board, it should NOT be #defined!
Also if using the breakout, double-check that all wiring
matches the tutorial.

im sure there is no wiring mistake as i have checked over and over. I will also include the verbose output whilst compiling and uploading, i cannot include it in the post as it is over 9000 words, sorry for any inconvenience.

Any help would be greatly appreciated!

output.txt (14.5 KB)

Please post a link to the actual display that you have bought. e.g. the Ebay sale

It is very useful to report the result of your “build”. The useful lines are:

Using library Adafruit-GFX-Library-master at version 1.2.9 in folder: C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master 
Using library TFTLCD-Library-master in folder: C:\Program Files (x86)\Arduino\libraries\TFTLCD-Library-master (legacy)
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI

You should really let the Library Manager install your libraries.
They normally go in your User libraries folder. Do NOT put them in the “System” folder.

David.

Hi,

here is the link from where i bought it,

https://www.ebay.co.uk/itm/2-4-TFT-LCD-Display-Shield-Touch-Panel-ILI9341-240X320-for-Arduino-UNO-MEGA/302289940523?hash=item4661e2702b:g:hu4AAOSwtplZxNoe

so, quick question, should i remove the libraries from / program files / arduino / libraries / and reinstall them with the library manager?

thanks.

You have bought a regular Red Mcufriend Uno Shield. I suggest that you install MCUFRIEND_kbv library through the Library Manager.

Yes, I suggest that you leave the IDE. Probably need Administrator privileges. Delete any "User" libraries from the Arduino "System" libraries folder. It should only have libraries that were installed with the IDE like SD, Bridge, Esplora, ... You can get hints from the folder creation dates.

Then re-start the IDE. Install the User libraries properly with the Library Manager.

Run all the examples from MCUFRIEND_kbv. They should all work out of the box.

Please tell us how you get on. Please say which controller is actually mounted on your Display. (MCUFRIEND_kbv examples print the ID on the Serial Terminal)

Please say whether the pcb on your desk matches the photos of the pcb in your Ebay link. e.g. different printing or different components.

Then we can tell you if and how the Adafruit_TFTLCD library works with your controller.

David.

Thank you very much! it worked!

it outputs and id of 0x9341 and yes, the lcd does somewhat match the sellers images, although it doesnt have the (i think voltage regulator) 5v regulator to the left of the sd card slot and i think the chips could perhaps be different too

here is a short clip,

https://drive.google.com/open?id=1gdtPskbnRuJh24mklQEqbAHXB6s__V-2

i have also managed to calibrate the touchscreen although x and y are inverted. I tried to swap the 2 analog touchscreen pins (A3 and A2) but that just made the touchscreen non functioning.

The calibration sketch determines which are X, Y touch pins (in Portrait mode) i.e. X is the short direction.

If your sketch uses Landscape or Reverse orientations, you have to map the Touchscreen values accordingly.

Think about it. The Touch panel is fixed. It will always return the physical ADC values. Your logical pixel addressing alters with screen rotation.

David.

im using the Touch_Shield_New example, im using it in portrait mode. here is the code,

i only changed these two lines

const int XP=9,XM=A3,YP=A2,YM=8; //ID=0x9341
const int TS_LEFT=177,TS_RT=799,TS_TOP=951,TS_BOT=217;

the older version of the mcu library had a swapxy function but that still didnt work.

i ran the calibration example but i dont know if and what i need to change.

code.txt (7.63 KB)

If you are asking a question about a specific example, just quote the example name and library version number.

There is no point in attaching an anonymous "code.txt". If you have modified an example, say so. I really don't see why I should have to "diff" your anonymous file with a "guessed" example.

Regarding the "TouchScreen_Calibr_native" example from v2.9.8. You do NOT change it. 1. Run it. 2. Read the instructions on TFT 3. Read any messages on Serial Terminal. 4. Copy-paste the "const" lines from Serial to your program. 5. There is a "Button_simple" example. 6. There is a "Touch_Shield_new" example.

If you have a problem, quote which example. And describe your problem.

I suggest that you start with Portrait applications. Then you can use the Portrait Calibration.

David.

i did exactly that, with the Touch_Shield_New example and all other touchscreen sketches i get the inverted x and y problem, and also if i try to draw a straight line, from some specific points it for some reason draws a curved line

Run the calibration sketch. Copy-paste the whole output from the Serial Terminal to a Code window in your message.

Then run the Touch_shield sketch WITH your calibration values.

David.

here is the output,

TouchScreen.h GFX Calibration
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

Testing : (A2, D8) = 41
Testing : (A3, D9) = 32
Diagnosing as:-
YP,YM:  (A2, D8) = 41
XM,XP:  (A3, D9) = 32
ID = 0x9341

cx=928 cy=179 cz=577 LEFT, TOP, Pressure
cx=569 cy=214 cz=526 LEFT, MIDH, Pressure
cx=211 cy=187 cz=479 LEFT, BOT, Pressure
cx=925 cy=472 cz=518 MIDW, TOP, Pressure
cx=222 cy=416 cz=435 MIDW, BOT, Pressure
cx=928 cy=864 cz=450 RT, TOP, Pressure
cx=577 cy=588 cz=438 RT, MIDH, Pressure
cx=219 cy=672 cz=316 RT, BOT, Pressure
MCUFRIEND_kbv ID=0x9341  240 x 320

const int XP=9,XM=A3,YP=A2,YM=8; //240x320 ID=0x9341
const int TS_LEFT=169,TS_RT=731,TS_TOP=950,TS_BOT=193;
PORTRAIT CALIBRATION     240 x 320
x = map(p.x, LEFT=169, RT=731, 0, 240)
y = map(p.y, TOP=950, BOT=193, 0, 320)
Touch Pin Wiring XP=9 XM=A3 YP=A2 YM=8
LANDSCAPE CALIBRATION    320 x 240
x = map(p.y, LEFT=950, RT=193, 0, 320)
y = map(p.x, TOP=731, BOT=169, 0, 240)

i calibrated it and set the touch pin wiring that it gave me, the problems still persisted

heres the part of the code that i updated

const int XP=9,XM=A3,YP=A2,YM=8; //240x320 ID=0x9341
const int TS_LEFT=169,TS_RT=731,TS_TOP=950,TS_BOT=193;

Copy the calibration to the Touch Shield program.
When you run the Touch Shield program, as you touch the screen the pixel coordinates get displayed.

The X coordinate will say 0 to 239 as you move across from left to right. And the Y will say 0 to 319 from top to bottom.

Press the red message in the middle of the screen. It should go to a “Paint” style program. A coloured dot should correspond to where you touch the screen.

Your calibration values look perfectly normal. Most Touch Panels are wired A2 with 9 and A3 with 8. Yours was diagnosed with A2,8 and A3,9 which is less usual. I have a shield with A1,6 and A2,7. Anything is possible.

I am intrigued. If X, Y pins were diagnosed correctly, I would expect your cx values to be similar for the LEFT cross-hairs.

If you have a DMM, please measure the resistance between A2,8 and between A3,9

I appreciate your feedback. I would like to resolve your problem. It will help everyone else.

David.

so between A2 and 8 there is a supposed resistance of 940 ohms and between A3 and 9 around 580 ohms,

another thing is when i move from left to right the value increases well above 239 to around the values i put in this part of the code, i did find this strange as the screen only has 240x320 pixels.

TS_LEFT=169,TS_RT=731,TS_TOP=950,TS_BOT=193;

and when i move from left to right y moves instead of x and vice versa, when i move from top to bottom the x coordinate starts at its highest value not from its lowest, although the y doesnt have this problem

if youd like i can insert a video link that can better explain

thanks,

The explanation is faiirly simple. Your A2,8 resistance is too high. It refers to the X direction. I would expect it to be 300R not 940R i.e. the shorter direction would have lower resistance.

I suggest that you adjust the results accordingly. My diagnosis determines X as the shorter direction with smaller resistance. Your panel is clearly "unusual".

Once you get the X, Y pins correct, you can see how well it works in practice. I am doubtful that you will get reliable results from an "unusual" high resistance X direction.

Hey-ho. It would be interesting to hear if anyone else has had similar experience.

David.

i'll try,

thanks for your help tough :)