Skip to content
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

[FR] Add support for MKS Robin R61505U-based TFT display #18681

Open
ashavakloo opened this issue Jul 17, 2020 · 46 comments
Open

[FR] Add support for MKS Robin R61505U-based TFT display #18681

ashavakloo opened this issue Jul 17, 2020 · 46 comments
Labels
C: LCD & Controllers T: Feature Request Features requested by users.

Comments

@ashavakloo
Copy link

hello Everybody
I have a MKS Robin V2.3 board and Robin TFT V1.1R(with R61505U controller). I wanted to install Marlin-bugfix-2.0.x on it. but unfortunately R61505U-based TFT display is not supported by marlin.and i cannot write the needed init sequences.
i want to know is it a chance to add support for it?
thanks in advance.

@thisiskeithb
Copy link
Member

@makerbase-mks: Any plans for this?

@ashavakloo
Copy link
Author

@makerbase-mks: Any plans for this?

I contacted makerbase but they didn't help me

@jmz52
Copy link
Contributor

jmz52 commented Jul 17, 2020

@ashavakloo
I've checked the datasheet for your display and it looks similar to ILI9328 controller. This is both good and bad.
Good part is that I've already added support for ILI9328 and might be able to adopt it for you display.
Bad part is that I have no relevant hardware and someone needs to do lots and lots of testing (setting correct screen orientation and color mode for ILI9328 was not easy).
Are you willing to do the testing and do you know how to connect to COM port to read debug messages (plain text)?

@ashavakloo
Copy link
Author

ashavakloo commented Jul 17, 2020

thanks for replying jmz52
I changed Case 0x9328 to case 0x1505 In Marlin/scr/lcd/dogm/u8g_dev_tft_320x240_upscale.....cpp
The good news is the screen is working now but I have two problems:
1:The writings are reverse
2:TFT display is pale And it is difficult to see the writings in a bright place.
what should i do now?

@ashavakloo
I've checked the datasheet for your display and it looks similar to ILI9328 controller. This is both good and bad.
Good part is that I've already added support for ILI9328 and might be able to adopt it for you display.
Bad part is that I have no relevant hardware and someone needs to do lots and lots of testing (setting correct screen orientation and color mode for ILI9328 was not easy).
Are you willing to do the testing and do you know how to connect to COM port to read debug messages (plain text)?

tft

@ashavakloo
Copy link
Author

Can anyone help me?please😭

@xC0000005
Copy link
Contributor

Do you have a link to firmware that works with this? It might be a gamma correction setting. I can probably extract the init sequence used from that firmware.

@ashavakloo
Copy link
Author

https://github.com/makerbase-mks/MKS-Robin/blob/master/MKS%20Robin/MKS_ROBIN_V2.0.8%20Release%20file.rar
This link is related to the latest version of mks robin firmware (This is a closed source firmware).

Do you have a link to firmware that works with this? It might be a gamma correction setting. I can probably extract the init sequence used from that firmware.

@xC0000005
Copy link
Contributor

xC0000005 commented Jul 19, 2020 via email

@xC0000005
Copy link
Contributor

xC0000005 commented Jul 19, 2020 via email

@xC0000005
Copy link
Contributor

I can't make much sense of this init sequence - the first thing they do is write to a register I'm not sure exists (and this is explicitly in this LCD's execution path)

Screen Shot 2020-07-19 at 4 10 53 PM

@ashavakloo
Copy link
Author

I can't make much sense of this init sequence - the first thing they do is write to a register I'm not sure exists (and this is explicitly in this LCD's execution path)

Screen Shot 2020-07-19 at 4 10 53 PM

so there is no way to fix this?
can i replace this controller with ILI9328?

@xC0000005
Copy link
Contributor

xC0000005 commented Jul 20, 2020 via email

@jmz52
Copy link
Contributor

jmz52 commented Jul 20, 2020

@ashavakloo
Please update you MKS Robin with firmware linked below and check debug information on COM port (250000 connection speed)
https://github.com/jmz52/bin/blob/master/R61505U/Robin.bin

@ashavakloo
Copy link
Author

@jmz52
I updated my MKS Robin with your firmware.
tft1
tft2

check debug information on COM port (250000 connection speed)

I don't know how to check debug information.
It is possible to explain a bit please?

@xC0000005
Copy link
Contributor

xC0000005 commented Jul 20, 2020 via email

@jmz52
Copy link
Contributor

jmz52 commented Jul 20, 2020

@ashavakloo
You need to connect USB to your computer and use terminal program (PuTTY for example) to view information send by Marlin.
Alternatively you can use Repetier Host program - it shows logs from printer in lower part of the window.

@xC0000005
I am using this very sequence. I am not sure where it came from, but it just matter of time (and tests) to find make a correct landscape sequence from this one.

@ashavakloo
Copy link
Author

check debug information on COM port (250000 connection speed)

P1
what should i do now?

@jmz52
Copy link
Contributor

jmz52 commented Jul 21, 2020

@ashavakloo
I've stripped init sequence from non-existing regusters, please re-test Robin.bin and post photo to make sure that image is unchanged.

Also please test 5 more variants in https://github.com/jmz52/bin/tree/master/R61505U and post photos.
These variants have slightly different init sequences, I need to figure out what various parameters are responsible for.

@ashavakloo
Copy link
Author

please re-test Robin.bin and post photo to make sure that image is unchanged.

it didn't change
WhatsApp Image 2020-07-21 at 18 15 53 (1)
WhatsApp Image 2020-07-21 at 18 15 53

Also please test 5 more variants in https://github.com/jmz52/bin/tree/master/R61505U and post photos.

variant0-ili9328: writings are mirrored
WhatsApp Image 2020-07-21 at 18 15 53 (2)
WhatsApp Image 2020-07-21 at 18 15 53
variant1:lcd worked well but its inverted
WhatsApp Image 2020-07-21 at 18 28 22 (1)
WhatsApp Image 2020-07-21 at 18 28 22
variant2:just like variant0-ili9328
WhatsApp Image 2020-07-21 at 18 37 11 (1)
WhatsApp Image 2020-07-21 at 18 37 11
variant3:like variant1 in diffrent coller but it's not inverted
WhatsApp Image 2020-07-21 at 18 45 56 (1)
WhatsApp Image 2020-07-21 at 18 45 56
variant4:bootscreen is inverted and wrintigs are mirrored
20200721_192917
20200721_192940

@jmz52
Copy link
Contributor

jmz52 commented Jul 21, 2020

Please test new init sequences - variants 5 - 10

@ashavakloo
Copy link
Author

Please test new init sequences - variants 5 - 10

variants 5 :LCD is inverted,writings are mirrored and in info screen touch has some problems for example when i touched fan, nozzle 1 setting were displayed and when i touched nozzle 2 fan setting were displayed.
20200721_235820
20200721_234446
variants 6 :everything works well and touch is like variants 5
20200721_232535
20200721_232544
variants 7 :LCD is inverted,writings are mirrored and touch has many problems
20200721_233618
20200721_233719
variants 8 :writings are mirrored and touch is like variants 5
20200721_234413
20200721_234446
variants 9 : :like variants 5
20200721_234446
20200721_234413

@xC0000005
Copy link
Contributor

xC0000005 commented Jul 21, 2020 via email

@jmz52
Copy link
Contributor

jmz52 commented Jul 22, 2020

@ashavakloo
Have you tried variant 10?

Variant #6 does not work well - Y positioning is inverted
Here is how screen should look like
480x320_vs_320x240

@ashavakloo
Copy link
Author

once it calibrates, does touch work as expected?

unfortunately no

Have you tried variant 10?

I've tested it and it works well
20200722_101811

@jmz52
Copy link
Contributor

jmz52 commented Jul 22, 2020

Hooray!
Now can you please connect PuTTY and calibrate your screen?
Calibration data will be printed to COM port once screen is successfully calibrated.

@ashavakloo
Copy link
Author

Now can you please connect PuTTY and calibrate your screen?

Touch screen calibration completed
TOUCH_CALIBRATION_X 12489
TOUCH_CALIBRATION_Y 9210
TOUCH_OFFSET_X -52
TOUCH_OFFSET_ Y -17
TOUCH_ORIENTATION TOUCH_LANDSCAPE

@jmz52
Copy link
Contributor

jmz52 commented Jul 23, 2020

@ashavakloo
New code, configuration files and build environment are available at https://github.com/jmz52/Marlin/tree/R61502
Make sure you set right calibration data in Configuration.h in TOUCH_SCREEN section.

@ashavakloo
Copy link
Author

@jmz52
thank you for your help
I still have a problem
When want to compile the your firmware, I get g ++ not found error,

@jmz52
Copy link
Contributor

jmz52 commented Jul 25, 2020

Is this issue specific for modified code or you have the same problem when compiling Marlin from official repository?

@ashavakloo
Copy link
Author

Is this issue specific for modified code or you have the same problem when compiling Marlin from official repository?

no,I think yesterday i did something wrong
now i can compile and use this firmware without any problem.
Thank you very much

@ashavakloo
Copy link
Author

thank you
@jmz52
@thisiskeithb
@xC0000005
for help

should I close this issue?

@ashavakloo
Copy link
Author

i know my problem is Not related to this issue
when i want to do manual mesh bed leveling, after Homing XYZ ,Click to Begin appears.
but nothing happens when i tap on LCD
WhatsApp Image 2020-07-31 at 13 17 39
what should i do?

@ashavakloo
Copy link
Author

ashavakloo commented Aug 1, 2020

i know my problem is Not related to this issue
when i want to do manual mesh bed leveling, after Homing XYZ ,Click to Begin appears.
but nothing happens when i tap on LCD

@jmz52 please help me.
I will be grateful if you can help me.

@jmz52
Copy link
Contributor

jmz52 commented Aug 1, 2020

@ashavakloo
I've never used mesh bed leveling, so I need your help to reproduce this problem.
Please provide your configuration files and name of menu item that gets you to this screen.

@ashavakloo
Copy link
Author

First of all, I have to say thank you for your help

Please provide your configuration files

Configuration&Configuration_adv.zip

name of menu item that gets you to this screen.

I do not understand exactly what you mean but mesh bed leveling settings are between lines 1327 to 1456
in LCDs like RepRapDiscount Smart Controller, mesh bed leveling begin when you press the encoder

@jmz52
Copy link
Contributor

jmz52 commented Aug 1, 2020

Which menu item you selected (when navigated Marlin's menu) to get to this "Click to Begin" screen?

@ashavakloo
Copy link
Author

Which menu item you selected (when navigated Marlin's menu) to get to this "Click to Begin" screen?

Menu/motion/bed leveling/level bed

@sjasonsmith
Copy link
Contributor

Is this working now? I'm not sure whether this is related to all the work @rhapsodyv has done recently to improve TFT support.

@rhapsodyv
Copy link
Sponsor Member

Is this working now? I'm not sure whether this is related to all the work @rhapsodyv has done recently to improve TFT support.

I ported new color ui to STM32F1. If the user problem is related with STM32, he can compile his board for STM32F1 and give try.

@ashavakloo can you try the last bugfix and target stm32f1?

@sjasonsmith
Copy link
Contributor

The only configs I saw were an MKS Robin, which is already STM32F1. A couple board (maybe Robin Pro and Robin2) are STM32F4.

@rhapsodyv
Copy link
Sponsor Member

The new upcoming TFT code will allow set the driver, rotation and mirroring. So you may be able to configure your display without any problem.

@jmz52
Copy link
Contributor

jmz52 commented Sep 7, 2020

@ashavakloo, I am back. Will be able to dig into this in a day or two.
My guess - this problem is caused by some part of classic UI code that needs to tweaked to work with touch screen and no physical encoder.
This should not be a big problem to fix - there were number of such places, and the most troublesome was UBL support with it's direct interfacing with rotary encoder.

@ashavakloo
Copy link
Author

@jmz52
sorry I haven't been for a while
you said you Will be able to dig into this in a day or two.
How can I help you to solve this problem?
Stay healthy.

@jmz52
Copy link
Contributor

jmz52 commented Sep 21, 2020

@ashavakloo
I've found the root cause of this problem. Unfortunately it is an oversight in touch UI design (caused by lack of knowledge of some menu items' behavior).
I have an idea how to fix it, but I need more time to do it.

@jmz52
Copy link
Contributor

jmz52 commented Sep 27, 2020

@ashavakloo, I've updated UI code to emulate clicks on TFT screens for bed leveling
You can download it from https://github.com/jmz52/Marlin/tree/tft_and_touch_N2

@jmz52 jmz52 mentioned this issue Oct 9, 2020
30 tasks
@ashavakloo
Copy link
Author

@jmz52
Thank you so much

You can download it from https://github.com/jmz52/Marlin/tree/tft_and_touch_N2

I used it but unfortunately Touch does not work at all

Configuration&Configuration_adv.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: LCD & Controllers T: Feature Request Features requested by users.
Projects
None yet
Development

No branches or pull requests

6 participants