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

Fix ANYCUBIC_LCD_CHIRON compilation #20807

Merged

Conversation

sjasonsmith
Copy link
Contributor

@sjasonsmith sjasonsmith commented Jan 18, 2021

Description

This fixes several compilation issues impacting the AnyCubic Chiron display:

  1. Missing global variable instantiations
  2. Allow const string pointers to be passed to injectCommands.
  3. Two issues with power-loss recovery (I will comment on these in the code)
    • Misleading indentation, and probably incorrect if behavior.
    • Two subsequent calls to injectCommands_P. This is invalid, because the _P variant stores a single pointer. This guarantees that only the second call will be retained.

Requirements

SKR 1.4 Turbo with AnyCubic Chiron display

Benefits

Allows compilation, although I am unable to test this myself.

Configurations

These are the same as in the reported bug, but I have included the pin customizations in the Configuration file.
Bug_20805.zip

Related Issues

#20805

injectCommands_P can only hold one pointer at a time. This was guaranteed to replace the command with M1000.
@sjasonsmith sjasonsmith added Needs: Testing Testing is needed for this change PR: Bug Fix labels Jan 18, 2021
@sjasonsmith
Copy link
Contributor Author

Hopefully @BrianP310 will test this out, since they are his configs.

@BrianP310
Copy link

BrianP310 commented Jan 18, 2021

Configuration.zip

@sjasonsmith Thanks, that definitely allows it to compile now. I had to change my Configuration.h because the TFT connector on the SKR 1.4T is Serial 0, so has to set

#define LCD_SERIAL_PORT 0.  

This makes the following changes necessary:

#define SERIAL_PORT 1
#define SERIAL_PORT_2 -1

Also, annoyingly, the stock Chiron LCD has the TFT connector wired in a non-standard way. So to make it work with the SKR 1.4T, you have to swap the pins around as follows (Luckily, if your colors are different, the pins definitions are silk screened on the back of the LCD circuit board, so just match up the colors, as necessary.)

|--------------------------|
|    G    Bk   Y   R   Bl  |   G=RST, Bk=Tx (Goes to Rx on SKR), Y=Rx (Goes to Tx), R=Vss (Gnd), Bl=5V
|------|----------|--------|

So, to summarize, in total to fix this bug, we need to merge your code changes, add the two pin definitions:

#ifndef BEEPER_PIN
    #define BEEPER_PIN P1_30
#endif

//
// Second Z-Stop Pin
//
#ifndef Z_MAX_PIN
  #define Z_MAX_PIN                        P1_00  // PWRDET
#endif

and rewire the TFT connector. Seems this was definitely a bug, but it is working now.
0118210922

@sjasonsmith sjasonsmith removed the Needs: Testing Testing is needed for this change label Jan 18, 2021
@sjasonsmith sjasonsmith linked an issue Jan 18, 2021 that may be closed by this pull request
@thinkyhead
Copy link
Member

So, to summarize, in total to fix this bug, we need to merge your code changes, add the two pin definitions:

It seems that #define BEEPER_PIN EXPA1_10_PIN actually does belong under ANET_FULL_GRAPHICS_LCD in the BTT SKR 1.4 pins file as a standard thing. The pin there is labeled as "beeper."

What is the Z_MAX_PIN used for if it's not being used as an endstop?

@thisiskeithb
Copy link
Member

What is the Z_MAX_PIN used for if it's not being used as an endstop?

That's the thing with the SKR 1.4. There's no Z+ pin, just a Z stop pin. The silkscreen says PWRDET where Z+ was located previously on the SKR 1.3:
image.

As you know, many pins can be remapped and users preferred the default SKR 1.3 pins when upgrading, so I think that's why much of that bleeds over into the SKR 1.4 pins.

@BrianP310
Copy link

It is being used as the second endstop in the dual z stepper setup, however it isn't defined when you go to compile.

@thinkyhead
Copy link
Member

The Anycubic Chiron uses the OUTAGECON_PIN to send voltage which is detected by the POWER_LOSS_PIN (pin 79 / Port I, bit 7). This pin is only defined in the Trigorilla configuration. It's not clear what these pins will be on the SKR 1.4.

@BrianP310
Copy link

I don't mean for this to sound as snarky as it does, but I don't understand what that has to do with with the SKR 1.4T LCD screen problem. What am I missing? The above mentioned fix makes everything work.

@thinkyhead
Copy link
Member

It is being used as the second endstop in the dual z stepper setup…

Maybe we can add special handling of endstops in some of the pins files when the dual endstop options are enabled. The current handling only looks at sensorless homing is in use, and makes the "other endstop" available based on the primary homing direction. When dual endstops are enabled the meaning of "the other endstop" is not going to be quite the same.

@thinkyhead
Copy link
Member

I don't mean for this to sound as snarky as it does, but I don't understand what that has to do with with the SKR 1.4T LCD screen problem. What am I missing? The above mentioned fix makes everything work.

Since you're using a whole different MOTHERBOARD, I've been putting together an example configuration for it. So I need to know how to fill out the whole thing.

@BrianP310
Copy link

BrianP310 commented Jan 20, 2021

I would agree with that. I'm not a programmer (at least not in C) but that is how I was able to get it to work. How you guys think it should be "properly" implemented is probably way better than what I came up with. I just appreciate the help. I thought I was was losing my mind when I couldn't get it working, so I'm quite happy to have found an actual bug. Now if only I could get the stock bed leveling sensor to quit crashing 10mm past the bed, it'll be perfect!

@BrianP310
Copy link

16111040065978756428268343581719
I went through and did a proper wiring job, so not sure if this helps you, but here it is all wired up.

@thinkyhead thinkyhead merged commit 0a279cf into MarlinFirmware:bugfix-2.0.x Jan 21, 2021
JayceeB1 added a commit to JayceeB1/Marlin that referenced this pull request Jan 21, 2021
JayceeB1 added a commit to JayceeB1/Marlin that referenced this pull request Jan 21, 2021
@stef-ladefense
Copy link
Contributor

Port I, bit 7).

hi,
it's more like J7 isn't it?
besides since J7 is mapped on DIO74 (ref fastio_1280.h, hard 79 pin)
can me show me on a photo of the trigorilla (8bit) where is D74?

kpishere pushed a commit to kpishere/Marlin that referenced this pull request Feb 19, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
zillarob pushed a commit to zillarob/Marlin that referenced this pull request Feb 25, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
zillarob pushed a commit to zillarob/Marlin that referenced this pull request Feb 25, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
zillarob pushed a commit to zillarob/Marlin that referenced this pull request Feb 26, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
zillarob pushed a commit to zillarob/Marlin that referenced this pull request Mar 11, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
W4tel-BiDi pushed a commit to W4tel-BiDi/Marlin that referenced this pull request Apr 5, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
@cofhal
Copy link

cofhal commented Apr 9, 2021

Could this configuration file be used on the Anycubic MEGA S, with the original TFT with the SKR 1.4?

thinkyhead added a commit to thinkyhead/Marlin that referenced this pull request Apr 29, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
thinkyhead added a commit that referenced this pull request Apr 30, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
@thomin07
Copy link

Hello everyone, I would like to come here because I have a chrion which has just broken down, I have just received an SKR 1.4 turbo, do you have a wiring diagram knowing that I am keeping the original PCBs. If you also have links to the firmware, thank you in advance

@sjasonsmith sjasonsmith deleted the PR/Bug20805_Chiron branch April 21, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Anycubic Chiron w/ stock LCD w/ SKR 1.4 Turbo compile fails
7 participants