MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.17k stars 19.21k forks source link

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

Open ashavakloo opened 4 years ago

ashavakloo commented 4 years ago

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 commented 4 years ago

@makerbase-mks: Any plans for this?

ashavakloo commented 4 years ago

@makerbase-mks: Any plans for this?

I contacted makerbase but they didn't help me

jmz52 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

Can anyone help me?please😭

xC0000005 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

That’s the configuration file. What firmware.bin would they have you install? I can decompile it and see how they’re intiialziing and if they’re doing custom gama correction/settings.

On Jul 19, 2020, at 1:40 PM, ashavakloo notifications@github.com wrote:

https://github.com/makerbase-mks/MKS-Robin/blob/master/MKS%20Robin/MKS_ROBIN_V2.0.8%20Release%20file.rar 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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/18681#issuecomment-660705551, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVGS4LCBOCNSFMDGZOLRETR4NK43ANCNFSM4O6AHOBQ.

xC0000005 commented 4 years ago

I found the init sequence for this LCD but it’s a mess. We will see if it does anything special once I work out the complete path.

Sent from my iPhone

On Jul 19, 2020, at 1:40 PM, ashavakloo notifications@github.com wrote:

 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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

xC0000005 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

We can certainly figure it out. It just may take time.

On Jul 19, 2020, at 10:45 PM, ashavakloo notifications@github.com wrote:

 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)

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

jmz52 commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

This code: https://github.com/nopnop2002/wiringpi-tft-tool/blob/6f0f91fed2d5a07f1e62663eb8bc37458c11bb65/8bitlib.c https://github.com/nopnop2002/wiringpi-tft-tool/blob/6f0f91fed2d5a07f1e62663eb8bc37458c11bb65/8bitlib.c

Is structured very similarly to the code in the MKS robin binary, and it also includes a write to the 0xE5 register for this LCD. In fact, the code is so similar I’m wondering if it’s a common init sequence provided by the manufacturer, or someone copied from someone else.

On Jul 20, 2020, at 8:47 AM, ashavakloo notifications@github.com wrote:

@jmz52 https://github.com/jmz52 I updated my MKS Robin with your firmware. https://user-images.githubusercontent.com/65370522/87957158-2c5ecd80-cac5-11ea-8e9d-452669da43a2.jpeg https://user-images.githubusercontent.com/65370522/87957170-2ec12780-cac5-11ea-8a88-4663a39d7b2d.jpeg 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?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/18681#issuecomment-661121818, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVGS4KUVEXX2JKOWKZ25N3R4RRIHANCNFSM4O6AHOBQ.

jmz52 commented 4 years ago

@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 commented 4 years ago

check debug information on COM port (250000 connection speed)

P1 what should i do now?

jmz52 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

Please test new init sequences - variants 5 - 10

ashavakloo commented 4 years ago

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 commented 4 years ago

If you run variant 6, and when you get to the status screen, press and hold in the upper left corner until calibration starts, once it calibrates, does touch work as expected? (I have to use a stylus to calibrate, but not after that).

On Jul 21, 2020, at 1:22 PM, ashavakloo notifications@github.com wrote:

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. https://user-images.githubusercontent.com/65370522/88099574-9a33f380-cbb0-11ea-834d-2a41e3eff9fc.jpg https://user-images.githubusercontent.com/65370522/88100438-c56b1280-cbb1-11ea-8ee8-c1df6f7ff445.jpg variants 6 :everything works well and touch is like variants 5 https://user-images.githubusercontent.com/65370522/88099774-e41cd980-cbb0-11ea-904a-d41790fb8b1a.jpg https://user-images.githubusercontent.com/65370522/88099783-e7b06080-cbb0-11ea-8bd2-767043b3e9ea.jpg variants 7 :LCD is inverted,writings are mirrored and touch has many problems https://user-images.githubusercontent.com/65370522/88099998-38c05480-cbb1-11ea-848e-7b46c23ecec3.jpg https://user-images.githubusercontent.com/65370522/88100022-3cec7200-cbb1-11ea-855a-cf4c4f75f2c4.jpg variants 8 :writings are mirrored and touch is like variants 5 https://user-images.githubusercontent.com/65370522/88100275-948add80-cbb1-11ea-9b6c-7be227c4958c.jpg https://user-images.githubusercontent.com/65370522/88100285-98b6fb00-cbb1-11ea-821d-1fcee93bd131.jpg variants 9 : :like variants 5 https://user-images.githubusercontent.com/65370522/88102645-25af8380-cbb5-11ea-9acf-57c7d8500605.jpg https://user-images.githubusercontent.com/65370522/88100427-c1d78b80-cbb1-11ea-9c8d-27d90c3d3d39.jpg — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/18681#issuecomment-662086644, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVGS4JUJR5YHLEVIXWPRS3R4X2JTANCNFSM4O6AHOBQ.

jmz52 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 TOUCHOFFSET Y -17 TOUCH_ORIENTATION TOUCH_LANDSCAPE

jmz52 commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

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

ashavakloo commented 4 years ago

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 commented 4 years ago

thank you @jmz52 @thisiskeithb @xC0000005 for help

should I close this issue?

ashavakloo commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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

ashavakloo commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

rhapsodyv commented 4 years ago

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 commented 4 years ago

@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 commented 3 years ago

@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 commented 3 years ago

@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 commented 3 years ago

@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

ashavakloo commented 3 years ago

@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