2023-10-08 08:59 AM - edited 2023-10-10 11:26 AM
Hi, i am making a project with the ST NUCLEO F401Re using a TFT display of MCUFRIEND (not so good display), and the implementation is running with touchGFX 4.22.0.
The display works with data serial using 8 pins of data and 4 to control (just for context).
I have been making the entire UI and it works fine, but the problem is each time i need to swap from one screen to other, the refresh delays quite much in update all the screen (you can see the screen updating from top to buttom maybe like half second or less).
I am not sure but i think the problem might be my display.
For other side i noticed that if i am in one screen, and change widgets like buttoms, slider and so one the response is good and one cant notice the refresh.
Because i have the same background in all the screens (i attached the images of some of them) i was wondering if it is posible to not update the bockground but the widgets and texts only .
If someone have any idea or suggestion it will be very appriciate.
More info about the project:
Display
I am using a TFT display of 3,5'' and 380x420 dimensions . The product was made by a company called "MCUFRIEND" and its a module with a touch screen, TFT displays and SD card slot (wich i am not using).
The display works with paralel 8 data pins, being the data format of 16 bits (most of the comands are 8 bits but to write on the display you send 16bits data).
To control the display i have been working with MCUFRIEND library which is used for many types of displays controlers. In my case i found that i my controler was an RM68140.
The touchscreen has a 4 wire controller, so it´s use 2 wires for each axes. For other side, the display also have 5 pins to control betwen comands and other kinds of data. Because the board use the same 4 pins to check the touch screen and controll the display, is necesary to make an multiplexation betwen each function. (I make it changing pins direction, readding the ADC to know the position press and going back to display control).
I addapted the code to works with my controller and only use the drivers functions that i need for my aplication (so i reduce code and ejecution times).
The drivers i use are the following (i only add waht i think is relevant code, but if you need all the code or another function tell me and i add the rest).
// Function that i pass to touchGFX to write on the display.
#define write8(x) { write_8(x); WRITE_DELAY; WR_STROBE; WR_IDLE; }
#define CS_ACTIVE PIN_LOW(CS_PORT, CS_PIN)
#define CS_IDLE PIN_HIGH(CS_PORT, CS_PIN)
#define WR_STROBE { WR_ACTIVE; WR_IDLE; }
#define WRITE_DELAY { WR_ACTIVE; }
#define WR_ACTIVE PIN_LOW(WR_PORT, WR_PIN)
There is an init function and so on but i think they don´t have any to do with my actual problem.
Note that i know (now) that spi is better than this scheme to send data , i really do, but now i am working with that display and i could not change it.
TOUCHGFX info:
About touchGFX i am using none transition betwen screens
And for the background i make an container so i garante that al the backgrounds are the same.
RTOS SO
I know that i have mentioned this at begging, but i am using RTOS to work with TouchGFX. Those are the task and configurations that i have make:
//TASKS CREATES
xTaskCreate(TouchGFXSYNC_process, "GFX SYNC", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL);
xTaskCreate(Touchscreen_process, "UPD TS", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL);
xTaskCreate(TouchGFX_Task, "UPD GFX", 2000, NULL, tskIDLE_PRIORITY + 2, NULL);
// TASKS
I think i tell you all the relevant but if i forgot something don't hesitateto tell me i will add all you need.
Best regards Guido
2023-10-08 11:41 AM
Your info is zero technical info. 8pin plus ... isnt serial interface.
Start with speed of rendering your screen and used bus info
2023-10-09 05:14 AM
Hello @guidoglorioso01 ,
Which transition do you have when changing between your screens?
2023-10-09 09:32 AM - edited 2023-10-09 09:37 AM
If you use SPI (partial buffer), TouchGFX does a great job. There is no delay. Give more information about the interface you are using, because I can only guess! And also the settings of the interface.
2023-10-10 11:28 AM
Hi @MM..1 , you are right. Sory for the poor information i am really new in forums. I added all the information i think relevant in the post. Thanks you.
2023-10-10 11:29 AM
Hi @Osman SOYKURT , i am using none transitions betwen screens.
Thanks for the help.
2023-10-10 11:30 AM
Hi @Panchev68 , thanks for the advise, but i am using this screen and i cant change it :( . In a future i will have this present.
2023-10-10 12:37 PM
..and what is : PIN_LOW(xxx) ?
HAL ..LL or what then? this is about speed of access, did you test your timing ? screen shot on DSO ?
at 380x420 pix , you get about 300k 8bit accesses; what is minimum access time of your display ?
because 1us -> 0,3 sec full screen update... you see the problem ?
2023-10-10 01:39 PM
Your code seems be sw emulation of 8080 interface. F4 have types with hw support this mode, i dont remember if 401 have FMC. As ASha writes how is your one write8() time?
2023-10-10 04:35 PM
All the functions touch directly the registers. In this case PIN_LOW() implementation is the next:
#define PIN_LOW(port, pin) (port)->BSRR = (1<<((pin)+16))
#define PIN_HIGH(port, pin) (port)->BSRR = (1<<(pin))
also the implementation of write8() is the next:
#define write_8(d) { \
GPIOA->BSRR = 0x0700 << 16; \
GPIOB->BSRR = 0x0438 << 16; \
GPIOC->BSRR = 0x0080 << 16; \
GPIOA->BSRR = (((d) & (1<<0)) << 9) \
| (((d) & (1<<2)) << 8) \
| (((d) & (1<<7)) << 1); \
GPIOB->BSRR = (((d) & (1<<3)) << 0) \
| (((d) & (1<<4)) << 1) \
| (((d) & (1<<5)) >> 1) \
| (((d) & (1<<6)) << 4); \
GPIOC->BSRR = (((d) & (1<<1)) << 6); \
}
I do not use HAL functions in this case to gain some extra time in execution.
For other side i did not checked de timming, i will do in next days and attach the results. But i think it could be the problem. Because of the timming in data transfer is why i asked if it is posibble to not send all the time the background, so i gain time not sending the same data.
Thanks for the help!!