TfT touchscreen trouble

Hello.
I am trying to work with arduino and 3.2 TFT SPI 240x320 V1.0 touchscreen.
Programs work well when i am only wieving objects on screen.
If i want to get to my program work with touch, its impossible, because when i write command ts.InitTouch(); whole display just go to white color and nothing changes in whole program. When i delete this command, touch doesnt work, but showing on display work well. some advices?

#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include "URTouch.h"
#include <SPI.h>

#define TFT_DC 9
#define TFT_CS 10
#define TFT_RST 8
#define TFT_MISO 12
#define TFT_MOSI 11
#define TFT_CLK 13

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);

#define t_SCK 3
#define t_CS 4
#define t_MOSI 5
#define t_MISO 6
#define t_IRQ 7

URTouch ts(t_SCK, t_CS, t_MOSI, t_MISO, t_IRQ);

void setup() {
tft.begin();
tft.setRotation(3);

ts.setPrecision(PREC_MEDIUM);
ts.InitTouch();

tft.fillScreen(ILI9341_BLACK);

}

void loop()
{
int x, y;

while (ts.dataAvailable())
{
ts.read();
x = ts.getX();
y = ts.getY();
if ((x != -1) && (y != -1))
{
Serial.println("p");
x += 13;
y += 4;
int radius = 4;
tft.fillCircle(x, y, radius, ILI9341_YELLOW);
}
}
}

You have chosen Software constructor for the TFT instead of using Hardware SPI constructor.

The URTouch library has no concept of hardware SPI. It only uses software SPI which it bit-bangs on your random pins.

Note that the TFT requires strictly 3.3V logic signals.
The XPT2046 Touch controller can use 5V logic but will work fine with 3.3V logic.

I would expect your program to work (albeit slowly)
I suggest that you call ts.setPrecision() before ts.initTouch()

Personally I would put TFT, SD, XPT2046 all on the same hardware SPI bus with 3.3V logic. e.g. with level converters on each signal.
Yes, these displays are very popular. They work fine on proper 3.3V Arduino boards like Zero, Due, ESP32, ESP8266, ...
They should work fine on 5V Arduinos if you provide level shifters. (makes wiring complicated)

David.

Thanks for your help. I was thinking to use this 3.3 V shifter, but i connected these pins trought 10K resistors and everything is working instead of this one thing. Exchange of these two commands (precision and init) did not change something.

10k resistors should work ok.
You don't need resistors on the t_MISO and tft_MISO pins.

David.