-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for TFT and touch screen - need feedback and testing #18129
Comments
Status screen Hotends, heated bed , heated chamber, fan, feed rate, flow rate are clickable and will lead to corresponding edit screens |
@hobiseven, would you mind some code adoption and testing on Alfawise Ux0 boards? |
Gosh... Looks like we do the same thing, different flavors. I have a Little LGVL glue ported and running on Alfawise... I invite you to read the code I built upon tag 2.5.0.3. I send you an invite to my privare repo.. |
@jmz52 LVGL is very nice to use, and the adaptation to get DMAs running in the background is really tiny. |
@jmz52 something which LVGL allows : dynamic displays : See the small moovie. I get the code from one of the forum member tonight . Please check the small video below : https://www.lesimprimantes3d.fr/forum/applications/core/interface/file/attachment.php?id=92278 |
Did you see MKS’ LVGL port? #18071 |
NOOOPEEE. So we all on our side do work on the same things! |
Options are nice 🙂 |
This is beautiful. Absolutely love it. |
@mattdog01 TFT v1.1 needs different calibration data. New code should work on TFT v1.1, but you need to change calibration data in And make sure you are using build environment from //
// ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8
//
#define TOUCH_BUTTONS
#if ENABLED(TOUCH_BUTTONS)
#define BUTTON_DELAY_EDIT 75 // (ms) Button repeat delay for edit screens
#define BUTTON_DELAY_MENU 100 // (ms) Button repeat delay for menus
/* MKS Robin TFT v2.0 */
#define XPT2046_X_CALIBRATION 12013
#define XPT2046_Y_CALIBRATION -8711
#define XPT2046_X_OFFSET -32
#define XPT2046_Y_OFFSET 256
/* MKS Robin TFT v1.1 */
//#define XPT2046_X_CALIBRATION -11792
//#define XPT2046_Y_CALIBRATION 8947
//#define XPT2046_X_OFFSET 342
//#define XPT2046_Y_OFFSET -19
#endif |
@mattdog01 looks like your touch settings are inverted in y. So touch zones are on the opposite side of the screen. We actually have also 3 touch screen flavors on alfawise. |
@jmz52 I like your print screen. I was more thinking about more arrows for move and less text menus.... |
@jmz52 @hobiseven , can I have your email or please send me email ? I want to develop the touch screen together. |
Folks, I will include a piece of LVGL code ( for the images / screens in the coming days, and push it. The goal for me was to make a POC of what the CPU can handle, without destroying the print performance. I started to build a small state machine , and picket icons googling here and there. @sensei73 asked to copy Alfawise U30 Pro GUI and he started to put together LVGL code to do that. As lvgl only updates what is nedded, we already do less DMA than with DOGM if I am correct. |
Keen to see this ported to the LP1768/9 HALS. Will open it up substantially. Very nice to see marlin supporting TFT'S natively instead of via gcode as a proxy. |
Let me ask one of my application manager if he can assign someone to this. I am from NXP. |
That would be incredible. If the SPI mode is used it could open the functionality up to many thousands who use the SKR series of motherboards via the EXP2 header. |
Well, you have a couple of things here : |
Hi @jmz52 How did you store that picture in the chip? Is that a jpg decompiled on the fly? or a SD card file? |
Hello @jmz52 |
@hobiseven this is raw 16-bit TFT image. There is an external SPI flash on MKS Robin board but I am not using it (yet) |
@jmz52 Interesting, if we have access to the external SPI flash, we could use it to load images as menu. This technique is used on the U30 Pro, less ram consumed. |
@sjasonsmith, Black F407VE works fine. |
Hello @jmz52 |
Can you share bin files? Platformio cant compile code for black F407ve. Not from marlin bugfix nor from your fork. |
@MsnSazabi, code I am using can be found at https://github.com/jmz52/Marlin/tree/tft_and_touch_N2 |
Ok, got screen running. But no reaction on touch. Running M995 from host starts calibration script, but it just dont react on touches. Touch screen shares same spi (1) with flash, cs pin set correctly. Can't understand why it doesnt work. Touch itself is ok, worked with native mks firmware. |
@MsnSazabi, what board and screen you have and how are they connected to each other? |
@jmz52 mks robin2 with mks robin tft35 v1.0 (it's a set sold together). Board has stm32f407zet6. Screen connected via fsmc, touch on spi1 (sharing with spi flash). LCD driver is ili9488, touch is hr2046. |
MKS Robin (F103ZE) uses SPI2, try this configuration for touch screen
|
Nope, doesnt work. Actually, there is a scheme with wiring. So I'm sure touch goes to spi1. @jmz52 is there any special definitions for touch screen? Maybe I'm missing some thing in code |
I have just moved to the newest bugfix-2.0.x and enabled the new UI to check it out. |
Yes, it is designed this way to reduce number of errors on smaller touch screens. |
@jmz52 Now that ColorUI is merged into Marlin, can this be closed? |
@thisiskeithb 128x128 UI not implented, so i cannot check the functionality of the TFT st7735 display. |
Where can I change this 2 default clicks to just one?(I use a bigger screen) |
Hi @bkiziuk |
@eghbalmohsen not a problem for me |
@bkiziuk |
@eghbalmohsen https://github.com/bkiziuk/Marlin/tree/bugfix-2.0.x If you have 3.2" display, maybe you should play with |
@bkiziuk Again, Thank you so much for your support, way better than MKS. |
Send For best results getting help with configuration and troubleshooting, please use the following resources:
|
Can someone advise me on setting hardware spi control register via marlin? My board uses hardware spi1 for touch screen, and via pullup resistors. As I understand, I need to set spi mode 3. But according to readed data, marlin doesnt change control register. |
Please use the links in my previous comment for configuration issues. |
Thanks for your reply, |
Hi, can someone advice me how to get a custom bootscreen shown? I´ve a few MKS TS35 running on my printers. I´ve checked some code and the Marlin folders to follow the code. |
For best results getting help with configuration and troubleshooting, please use the following resources:
|
@bkiziuk I am using your source code, I could compile it successfully, thanks for your work bro. |
@eghbalmohsen PLEASE stop bumping this thread for support issues and use the links I posted above for further configuration issues. |
TFT screens with optional touch panel can be used to control Marlin
Low-level IO uses DMA for background data transfer to TFT screen to minimize impact on Marlin's performance.
Current low-level IO implementation is for HAL STM32 and MCU STM32F1 only.
SPI implementation lacks STM32F4 initialization code.
FSMC implementation STM32F4 initialization code and (temporary) hardcoded to Zx specific.
Implementation for STM32F4 and FSMC on VE chips will follow.
Implemented Marlin_UI class for 320x240 screen.
Can be used with or without rotary encoder.
Support UBL or advanced pause is not implemented yet.
Tested on MKS Robin v2.4 with TFT v2.0 (ST7789v controller)
Earlier builds were tested on EZT-T1 and SKR Mini v1.1 with 128x128 (st7735 controller) but UI 128x128 became outdated due to changes made during touch support development.
UI 128x128 implementation will be uploaded once code is updated.
SPI IO required dedicated hardware SPI interface wich can't be shared with SD card. Should be OK to use same SPI for TFT screen and touch panel.
Build environment for MKS Robin - MarlinFirmware/Configurations#114
https://github.com/jmz52/Configurations/tree/mks_robin_hal_stm32/config/examples/Mks/Robin_HAL_STM32
The text was updated successfully, but these errors were encountered: