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

Klipper 12864 improve #1913

Merged
merged 5 commits into from
May 22, 2021
Merged

Klipper 12864 improve #1913

merged 5 commits into from
May 22, 2021

Conversation

Msq001
Copy link
Contributor

@Msq001 Msq001 commented May 13, 2021

Requirements

Klipper3d/klipper#3979 This PR of Klipper has solved the SPI data shift problem of TFT 12864 mode(Thanks @teeminus)
According to the setting in Klipper3d/klipper#3979 (comment), the TFT 12864 can work normally with Klipper

We need to set lcd_type to emulated_st7920, and set the correct pin of software_spi

[display]
lcd_type: emulated_st7920
spi_software_miso_pin: EXP2_1
spi_software_mosi_pin: EXP1_3
spi_software_sclk_pin: EXP1_5
en_pin: EXP1_4
encoder_pins: ^EXP2_3, ^EXP2_5
click_pin: ^!EXP1_2

Description

TFT work with SKR-2 Marlin & Full Screen OFF Marlin & Full Screen ON Klipper & Full Screen OFF Klipper & Full Screen ON
TFT24 V1.1 💚good ⚠️beta 💚good ⚠️beta
TFT35 E3 V3.0 💚good 💚good 💚good 💚good
TFT50 V3.0 💚good 💚good 💚good 💚good
TFT70 V3.0 💚good 💚good 💚good 💚good

It reduces ram loss of hundreds of bytes and increases flash of tens of bytes

Benefits

Related Issues

fixed #290

@oldman4U
Copy link
Contributor

Hi.

Should we ask the Klipper users to test this PR?

@Msq001 Msq001 marked this pull request as draft May 13, 2021 10:12
@Msq001
Copy link
Contributor Author

Msq001 commented May 13, 2021

@oldman4U
This feature can be used normally, but the code needs more cleaning. After cleaning, I will convert to Ready for review, and then ask members to test

@oldman4U
Copy link
Contributor

Perfect.

Thank you

TFT/src/User/API/boot.c Outdated Show resolved Hide resolved
@bigtreetech bigtreetech marked this pull request as ready for review May 18, 2021 08:19
TFT/src/User/API/UI/ST7920_Emulator.h Outdated Show resolved Hide resolved
@oldman4U
Copy link
Contributor

So the reaction of the community is overwhelming....

Have you got something back?

@zyonee
Copy link

zyonee commented May 21, 2021

This is working fine with an up to date version of Klipper on an SKR E3 Turbo with a BTT TFT70.

@bigtreetech bigtreetech merged commit b8b5cd2 into bigtreetech:master May 22, 2021
@Msq001 Msq001 deleted the klipper branch May 22, 2021 10:03
@Talha909
Copy link

Talha909 commented Jun 3, 2021

My lcd show the result on screen. But rotary switch did not work. What should i do

@jasc76
Copy link

jasc76 commented Jun 3, 2021

Tested this on TFT24 with MKS GEN L with the provided [display] section above.

Klippy Error:
Unknown value 'EXP2_1' in enumeration 'pin'
This type of error is frequently caused by running an older
version of the firmware on the micro-controller (fix by
recompiling and flashing the firmware).

Known versions: host=v0.9.1-533-g27f8cf02, mcu=v0.9.1-528-gc0d86048

printer.cfg
aliases:
# EXP1 header
EXP1_1=ar37, EXP1_3=ar17, EXP1_5=ar23, EXP1_7=ar27, EXP1_9=,
EXP1_2=ar35, EXP1_4=ar16, EXP1_6=ar25, EXP1_8=ar29, EXP1_10=<5V>

# EXP2 header
EXP2_1=ar50, EXP2_3=ar31, EXP2_5=ar33, EXP2_7=ar49, EXP2_9=<GND>,
EXP2_2=ar52, EXP2_4=ar53, EXP2_6=ar51,  EXP2_8=<RST>, EXP2_10=ar41

[display]
lcd_type: emulated_st7920
spi_software_miso_pin: EXP2_1
spi_software_mosi_pin: EXP1_3
spi_software_sclk_pin: EXP1_5
en_pin: EXP1_4
encoder_pins: ^EXP2_5, ^EXP2_3
click_pin: ^!EXP1_2
[output_pin beeper]
pin: EXP1_1

@bigtreetech
Copy link
Owner

My lcd show the result on screen. But rotary switch did not work. What should i do

Which motherboard do you use? Maybe there is something wrong with the setting of

encoder_pins: ^EXP2_3, ^EXP2_5
click_pin: ^!EXP1_2

@bigtreetech
Copy link
Owner

Klippy Error:
Unknown value 'EXP2_1' in enumeration 'pin'
This type of error is frequently caused by running an older
version of the firmware on the micro-controller (fix by
recompiling and flashing the firmware).

Known versions: host=v0.9.1-533-g27f8cf02, mcu=v0.9.1-528-gc0d86048

Do you using the latest version of klipper and the MCU of MKS GEN L has also updated the latest version of firmware.bin?

@jasc76
Copy link

jasc76 commented Jun 5, 2021

Known versions: host=v0.9.1-533-g27f8cf02, mcu=v0.9.1-533-g27f8cf02, rpi=v0.9.1-533-g27f8cf02

no change, error still is there. Its the latest kiauh is offering

What I discovered:
Changing
spi_software_miso_pin: EXP2_1
to
spi_software_miso_pin: EXP2_2 (was just an idea, what happens)
the error goes away and it works (screen, encoder, click, beeper tested)

@Talha909
Copy link

Talha909 commented Jun 8, 2021

I am using skr 1.4 Tubo. I got the display on the screen but my rotary switch did not work and there is no beeper. What should i do

@bigtreetech
Copy link
Owner

I am using skr 1.4 Tubo. I got the display on the screen but my rotary switch did not work and there is no beeper. What should i do

Hello, Can you confirm that the following pins are set properly? If you are still unable to work after confirmation, please provide your printer.cfg file

encoder_pins: ^EXP2_3, ^EXP2_5
click_pin: ^!EXP1_2

[output_pin beeper]
pin: EXP1_1

@Talha909
Copy link

Talha909 commented Jun 9, 2021

HI, Still facing the issue. My rotary switch is not working. I am using SKR 1.4 Tubo, TMC2130 and TFT 24
printer (5).zip

@gregmatic
Copy link

my screen shows Marlin Mode with blank screen. can anyone confirm the following works with SKR E3 Mini v1.2 & TFT35 E3 V3.0?

[board_pins]
aliases:
# EXP1 header
EXP1_1=PB5, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PB8, EXP1_9=,
EXP1_2=PB6, EXP1_4=, EXP1_6=PB9, EXP1_8=PB7, EXP1_10=<5V>

[display]
lcd_type: emulated_st7920
spi_software_miso_pin: EXP2_1
spi_software_mosi_pin: EXP1_3
spi_software_sclk_pin: EXP1_5
en_pin: EXP1_4
encoder_pins: ^EXP2_3, ^EXP2_5
click_pin: ^!EXP1_2

@bigtreetech
Copy link
Owner

my screen shows Marlin Mode with blank screen. can anyone confirm the following works with SKR E3 Mini v1.2 & TFT35 E3 V3.0?

[board_pins]
aliases:

EXP1 header

EXP1_1=PB5, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PB8, EXP1_9=,
EXP1_2=PB6, EXP1_4=, EXP1_6=PB9, EXP1_8=PB7, EXP1_10=<5V>

[display]
lcd_type: emulated_st7920
spi_software_miso_pin: EXP2_1
spi_software_mosi_pin: EXP1_3
spi_software_sclk_pin: EXP1_5
en_pin: EXP1_4
encoder_pins: ^EXP2_3, ^EXP2_5
click_pin: ^!EXP1_2

According to the instructions here
https://github.com/KevinOConnor/klipper/blob/478f26cab6c8e73e3970d2b303bc818f6910ae74/config/sample-lcd.cfg#L49
SKR-mini-E3-V1.2 has no EXP1 + EXP2 and only the Ender-3 stock display port, so the settings should be as follows

[display]
lcd_type: st7920
cs_pin: EXP1_7
sclk_pin: EXP1_6
sid_pin: EXP1_8
encoder_pins: ^EXP1_5, ^EXP1_3
click_pin: ^!EXP1_2

[output_pin beeper]
pin: EXP1_1

@gregmatic
Copy link

gregmatic commented Jun 23, 2021

[display]
lcd_type: st7920
cs_pin: EXP1_7
sclk_pin: EXP1_6
sid_pin: EXP1_8
encoder_pins: ^EXP1_5, ^EXP1_3
click_pin: ^!EXP1_2

[output_pin beeper]
pin: EXP1_1

thank you...i tried this but Marlin Mode still shows black screen. I didn't move any wiring ...the TFT35 worked fine in both Marlin Mode & Touch Mode when my firmware was Marlin..

when i plug in to stock Ender 3 LCD, it works. so i'm not sure what's wrong with my TFT35 that makes it not want to talk to Klipper. I used the compiled binary from master fork.

edit: i'm quite sure its this official firmware that doesn't work. i flashed NoTouchv1.3 from here and it worked...i have no idea why.

@Terixxx
Copy link

Terixxx commented Jul 29, 2021

Requirements

KevinOConnor/klipper#3979 This PR of Klipper has solved the SPI data shift problem of TFT 12864 mode(Thanks @teeminus)
According to the setting in KevinOConnor/klipper#3979 (comment), the TFT 12864 can work normally with Klipper

We need to set lcd_type to emulated_st7920, and set the correct pin of software_spi

[display]
lcd_type: emulated_st7920
spi_software_miso_pin: EXP2_1
spi_software_mosi_pin: EXP1_3
spi_software_sclk_pin: EXP1_5
en_pin: EXP1_4
encoder_pins: ^EXP2_3, ^EXP2_5
click_pin: ^!EXP1_2

Description

TFT work with SKR-2 Marlin & Full Screen OFF Marlin & Full Screen ON Klipper & Full Screen OFF Klipper & Full Screen ON
TFT24 V1.1 💚good ⚠️beta 💚good ⚠️beta
TFT35 E3 V3.0 💚good 💚good 💚good 💚good
TFT50 V3.0 💚good 💚good 💚good 💚good
TFT70 V3.0 💚good 💚good 💚good 💚good

It reduces ram loss of hundreds of bytes and increases flash of tens of bytes

Benefits

Related Issues

fixed #290

Could you please provide Pin map and board corresponding to this configuration. I have BTT Octopus V1.1 and TFT3.5 V3.0 and have issue with TMC2130 SPI drivers.

@hapklaar
Copy link

@Msq001 This is working for me, except for that the screen gets garbled/scrambled after a few minutes of printing. Tried both ways of addressing the screen, doesn't seem to matter for this specific problem.

[display]
lcd_type: st7920 
cs_pin: EXP1_4
sclk_pin: EXP1_5
sid_pin: EXP1_3
encoder_pins: ^EXP2_5, ^EXP2_3
click_pin: ^!EXP1_2

and

[display]
lcd_type: emulated_st7920
spi_software_miso_pin: EXP2_1
spi_software_mosi_pin: EXP1_3
spi_software_sclk_pin: EXP1_5
en_pin: EXP1_4
encoder_pins: ^EXP2_3, ^EXP2_5
click_pin: ^!EXP1_2

@vMeph
Copy link

vMeph commented Jan 24, 2022

@Msq001 could you provide the config for the btt SKR2 to testout
thanks in advanced

@vMeph
Copy link

vMeph commented Jan 25, 2022

its working !!!

@mlaci001
Copy link

The same is true with the E3 turbo and TFT35-E3-v3.
The screen is blank.
If the TFT button is held down for 3 seconds, the mode selection window will appear, here you have to select the Marlin mode (no matter what mode the screen is in).
The screen will still be blank, but if you press the button again, the menu will appear and work from there.
You have to do it again every time you start.
I don't know why it's not good at startup.
I can't use emulated_st7920 mode, the motherboard only has an EXP1 connector.

@chaicracker
Copy link

chaicracker commented Mar 30, 2022

Hello everyone :)

Currently trying to get a BTT TFT35 V3 (the wide one, not the E3 version) working with an SKR Mini E3 V2.0

this is the configuration I could muster so far, though none of the tries suceeded so far. I had installed the fitting NoTouchScreenFirmware for the Display and says "ST7920Emulated ready"

[board_pins]
aliases:
EXP1_1=PB5, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PB8, EXP1_9=,
EXP1_2=PA15, EXP1_4=, EXP1_6=PB9, EXP1_8=PB15, EXP1_10=<5V>,

[display]
lcd_type: emulated_st7920
en_pin: EXP1_7
spi_software_sclk_pin: EXP1_6
spi_software_mosi_pin: EXP1_8
spi_software_miso_pin: PA3
encoder_pins: ^EXP1_5, ^EXP1_3
click_pin: ^!EXP1_2

Cheers :)

@douglasdtlltd
Copy link

douglasdtlltd commented Oct 7, 2022

This works with a current compile of the BTT TF35 V3.0 firmware and a BTT SKR Mini E3 V2 with Klipper.

IM SO HAPPY I FOUND THIS.

Hello everyone :)

Currently trying to get a BTT TFT35 V3 (the wide one, not the E3 version) working with an SKR Mini E3 V2.0

this is the configuration I could muster so far, though none of the tries suceeded so far. I had installed the fitting NoTouchScreenFirmware for the Display and says "ST7920Emulated ready"

[board_pins] aliases: EXP1_1=PB5, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PB8, EXP1_9=, EXP1_2=PA15, EXP1_4=, EXP1_6=PB9, EXP1_8=PB15, EXP1_10=<5V>,

[display] lcd_type: emulated_st7920 en_pin: EXP1_7 spi_software_sclk_pin: EXP1_6 spi_software_mosi_pin: EXP1_8 spi_software_miso_pin: PA3 encoder_pins: ^EXP1_5, ^EXP1_3 click_pin: ^!EXP1_2

Cheers :)

The only problem I have no is that I can't edit the displays settings in the touch mode because it "doesnt have a printer connected." obviously. ugh.

another edit that was quick google if you found this comment, I found this.

https://www.reddit.com/r/BIGTREETECH/comments/ieoua5/tft24_display_rotation/g2jcjx8/

douglasdtlltd added a commit to douglasdtlltd/klipper that referenced this pull request Oct 7, 2022
bigtreetech/BIGTREETECH-TouchScreenFirmware#1913 (comment) 

This config allows the use of BTT TFT displays with the latest compiled version of BTT firmware (Only tested working on TFT35 V3.0)

This information was a pain to find and would like to make it easier for other users of this display.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] [ST7920_Simulator.c] Add a character generator in order to use klipper