3.95" R61581 touchscreen does not work

This is my second china screen, but error is the same.
UTFT library succesfully recognise the screen and Demo from UTFT works.
But Calibration and TestButton does not.
Calibration each time show new variant of data.

As far as I see this theme is not new, but never find the solution.

Please post links to each of your screens.

Most AliExpress Mega Shields use the same pinout and XPT2046 Touch controller as the UTFT and UTouch examples.

David.

This is back view of this board.

It would be useful to see the links. It helps with the guesswork. e.g. how truthful the vendor might be.

Your photos show a pcb that implies an ILI9488.
It looks as if you have a Touch Controller chip but no Touch Panel.

It does not really matter which controller you tell UTFT. UTFT does not use many of the controller capabilities.

David.

This is thing from China tales, do not read what are you see...
Screen recognise by UTFT as R61581, ONLY!
Seller told me about it.
It contain touch screen and when I run Calibration from UTouch it look like working.
When i press lighting point it reflect and show the next.
But calibration values does have any effect in .h files.

If you have spoken to the Chinese seller, you could post a link to her website and your particular item.

If you think that there is a Touch Panel, you would show a photo of the front of the screen.

If you think that the UTouch calibration is working, you would post the three values that are reported by the Calibration sketch.

If you actually want some help, you should provide the information. If you just want to work blindfolded, that is your choice.

David.

I have received some texts for keil, may it will be helpfull...
This is files sending by other seller, but I cannot use it.
It is look like that all text are the same.

Link for this display on aliexpress:

http://ru.aliexpress.com/item/Free-shipping-LCD-module-TFT-3-5-inch-TFT-LCD-screen-for-Arduino-MEGA2560-Board/1766509567.html

design.pdf (41.9 KB)

schema.pdf (88.8 KB)

51-keil.zip (296 KB)

Your link has 4 photos.
The 1st one shows a Touch Panel ribbon at the left hand bottom of the screen.
The 2nd one shows the XP2046 and a legend 2560 (ili9488)
The 3rd one shows the ribbon coming out of the slot in the pcb and soldered to the pcb.
The 4th one is in bad focus.

Your two PDFs refer to a 2.4" ILI9341 SPI board that is nothing to do with your Shield.
I did not bother to look at the ZIP file that is designed for an 8051.

Of course you might have an R61581 and Touch panel that is soldered to the other side of the pcb.
In which case, posting the result from your UTouch_Calibration sketch would show what is happening.

Your photos do not match photo #3.

Can you speak Chinese?

David.

Sorry, I cannot speak Chinese.
About photo 3, I see. I will check connection here.
It is look very strange. I was never see it before. Strange...

I have checked, contact ribbon from touch has soldered on the other side of the board.
To visual cheching I have to unglue screen and board.

IMG_1226.JPG

IMG_1227.JPG

IMG_1228.JPG

IMG_1229.JPG

Of course you might have an R61581 and Touch panel that is soldered to the other side of the pcb.
In which case, posting the result from your UTouch_Calibration sketch would show what is happening.

I would expect it to report something like

#define CAL_X 0x00378F66UL
#define CAL_Y 0x03C34155UL
#define CAL_S 0x0013F1DFUL

Which you copy to the UTouchCD.h file as instructed by the Calibration program.

Your values might be different. Which is why I asked you to post them here.
If you had simply typed the values in a message, it would have saved all your JPEG images.
And most importantly, you would not have had to unstick your panel.

Did you not see the Touch ribbon on the bottom left of the screen?

David.

I have another display with ribbon on place.
And it calibration in attach.
ButtonTest does not responce at all.

IMG_1243.JPG

IMG_1244.JPG

And Calibration test for the first board (not match to photo 3)

IMG_1245-b1.JPG

I.

I'm trying to work with the same LCD touch.

David suggested me to use Rowboteer's TFT_HX8357 library, i got it from GitHub - Bodmer/TFT_ILI9341: A fast Arduino IDE compatible graphics and fonts library including a driver for the ILI9341 based TFT displays.

I can run the examples without problem, but i need to work with touch capabilities.

What library are you using?

So, i want to enjoy this thread so we can work in the same issue.

Thanks.

Hi!
I use UTFT & UTouch libraries from UTFT - Rinky-Dink Electronics
And put as chip qualifier R61581.

Thanks Kuka.

i downloaded the library and have issue with the text mirrored than i fix editing the file file UTFT\tft_drivers\r61581\initlcd.h

where it mentioned
LCD_Write_COM(0x36);
LCD_Write_DATA(0xA0);

I changed to
LCD_Write_COM(0x36);
LCD_Write_DATA(0x00,0x48);

The calibration example works fine, but the data given at the end is different always.

But the other examples seems to works erratic with touch signals.

If you updated the .h file with that data that examples works fine?

Yes, I have the same results.
Each time different result.
If I put it to the .h file ButtonTest does not works.

I made a code based in Button test example.

It seems to select the button i "clicked", if you can test it and tell if works well for you

#include <UTFT.h>
#include<UTouch.h>

// Define Orientation of touch screen
#define TOUCH_ORIENTATION PORTRAIT

// Initialize Display

UTFT myGLCD(R61581, 38, 39, 40, 41);

// Init touchScreen
UTouch  myTouch( 6, 5, 4, 3, 2);

// Fonts to use
extern uint8_t BigFont[];

int x, y;

uint32_t cx, cy;
uint32_t rx[8], ry[8];
uint32_t clx, crx, cty, cby;
float px, py;
int dispx, dispy, text_y_center;
uint32_t calx, caly, cals;
char buf[13];

void setup() {
  myGLCD.InitLCD();
  myGLCD.clrScr();
  myGLCD.setFont(BigFont);
  
  myTouch.InitTouch(TOUCH_ORIENTATION);
  dispx=myGLCD.getDisplayXSize();
  dispy=myGLCD.getDisplayYSize();
  text_y_center=(dispy/2)-6;
  Serial.begin(9600);
  drawButton();
}

/**
  * Draw two buttons
  * when each button is pressed the display shows the button pressed
 */
void drawButton(){
  myGLCD.setColor(0, 0, 255);
  myGLCD.fillRoundRect (70, 10, 350, 60);
  myGLCD.fillRoundRect (70, 150, 350, 210);
  myGLCD.setColor(0,255,0);
  myGLCD.drawRoundRect(70, 10, 350, 60);
  myGLCD.drawRoundRect(70, 150, 350, 210);
  myGLCD.print("Click this TEXT", 87, 27);
  myGLCD.print("Or this 1", 87, 167);
}

// Read the touch
void readData(){
  if(myTouch.dataAvailable()){
    myTouch.read();
    x = myTouch.getX();
    y = myTouch.getY();
    
    Serial.print("Lectura: "); Serial.print(x); Serial.print(" - "); Serial.println(y);
    // The first button
    if((x>=70 && x<=350)  && (y>=10 && y<=60)){
      waitForIt(70, 10, 350, 60);
    }
    
    // The second button
    if((x>=70 && x<=350) && (y>=150 && y<=210)){
      waitForIt(70, 150, 350, 210);
    }
  }
}

// Draw a red frame while a button is touched
void waitForIt(int x1, int y1, int x2, int y2)
{
  myGLCD.setColor(255, 0, 0);
  myGLCD.drawRoundRect (x1, y1, x2, y2);
  while (myTouch.dataAvailable())
    myTouch.read();
  myGLCD.setColor(0, 255, 0);
  myGLCD.drawRoundRect (x1, y1, x2, y2);
}


void loop() {
  readData();
}

If this works.

The UTFT Library seems to map differently that UTouch does.

In UTFT you can work with resolution 480x320 but in UTouch the display resolution seems to be ~300x200