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] Working TOUCH_UI_FTDI_EVE support #16628

Closed
TB1405 opened this issue Jan 20, 2020 · 179 comments
Closed

[FR] Working TOUCH_UI_FTDI_EVE support #16628

TB1405 opened this issue Jan 20, 2020 · 179 comments
Labels
C: LCD & Controllers help wanted Needs: Patch A patch is needed to fix this T: Feature Request Features requested by users.

Comments

@TB1405
Copy link

TB1405 commented Jan 20, 2020

Bug Description

The TOUCH_UI_FTDI_EVE does not work on marlin 2.0.1 or 2.0.x
i tried on Ramps, Arduino, SKR Pro, Fysetc S6 and SKR 1.3
the compiling issue #16534 is sloved.
but now only the display back light is on. i tried a lot different configurations but the result was every time the same.
Green screen while booting and after this backlight is on and display black.
Only if disconnect the MISO pin, on the display is the notification Release to begin screen calibration
Picture1
Picture2

with the marlin version from fysetc the display works pefect.
https://github.com/FYSETC/Marlin-2.0.x-FYSETC/tree/S6/BUG-FIX-CLCD
Picture3

i also copied the folder ftdi_eve_touch_ui from fysetcs marlin in the marlin 2.0.1 branch after this the display works also but only with s6 board and SKR pro.
copy the ftdi_eve_touch_ui folder to the actual bugfix version does not work because there comes a lot of errors.

My Configurations

here are my configs that i actual work on my printer. (TOUCH_ui Folder is from fysetc)
Config_SKRPRO_MMU2_FTDI2.0.1WithFysetcTouchUI.zip

Steps to Reproduce

  1. download marlin 2.0.1
  2. use my config and connect a ftdi display to the board
  3. compile it with original ftdi_eve_touch_ui folder from the marlin branch Expected behavior: [Display doesnt work]
  4. compile it again with fysetc ftdi_eve_touch_ui from the marlin branch Expected behavior: [Display does work]

Additional Information

I also noticed that the #defines from the cofiguration.adv are not taken over.
As an example you select //#define CLCD_USE_SOFT_SPI in config.adv but the display still works with the normal SPI pins on EXP2.

but if you change it as follows in the pin_mappings.h

#ifdef SKR_PRO_TFT_PINMAP
  #ifndef __MARLIN_FIRMWARE__
    #error This pin mapping requires Marlin.
  #endif

  #define CLCD_SPI_CS PG10 //PD11 
  #define CLCD_MOD_RESET PF11 //PG2 
  
  //#define CLCD_USE_SOFT_SPI
    // #define CLCD_SOFT_SPI_MOSI PG3
    //#define CLCD_SOFT_SPI_MISO PG4
    //#define CLCD_SOFT_SPI_SCLK PA8 // PORTA3 Pin 7             
#endif

the display is now controlled by the defined pins (backlight goes on) but unfortunately not correctly because the display is only switched on but nothing is displayed. so Software_SPI isnt work correctly
the same problem even if the CS and PD pin is only defined in config.adv the display is not controlled at all.
also this must happen in pin_mappings.h as mentioned above.

#define CLCD_SPI_CS PG10 //PD11
#define CLCD_MOD_RESET PF11 //PG2
`
next problem is now
if we use the LCD on the hardware spi bus we cant connect a sd card module.
as soon as i have connected the sd card module to the spi bus of the display the display shows only strange things
is it possible to use sd card modul with software spi?

I hope this is written understandably.

@thinkyhead
Copy link
Member

Someone will have to finish porting support for this display into bugfix-2.0.x using the FYSETC fork as a reference.

@TB1405
Copy link
Author

TB1405 commented Jan 22, 2020

@thinkyhead maybe you have any idea because the issue with sd card ?
EDIT: My SD Card modul is the problem i connect the sd card modul from the smart discount controller and it works.
and one more question will this display be supported in the future if for example new submenus are created. As far as I know these would have to be created in the FTDI Eve program.

@marciot
Copy link
Contributor

marciot commented Feb 24, 2020

I don't know whether this thread is still active, but I suggest putting a resistor on the MISO line, as someone else had run into problems without one. If in fact there is a software fix, I would find it to be interesting and worth additional investigation.

@marciot
Copy link
Contributor

marciot commented Feb 24, 2020

My SD Card modul is the problem i connect the sd card modul from the smart discount controller and it works.

Interesting. I do not recommend sharing the SPI bus between the FTDI display and the SD card. If you need to use an SD card, connect it to the SPI pins and run the FTDI display off some other pins using the software SPI option.

one more question will this display be supported in the future if for example new submenus are created. As far as I know these would have to be created in the FTDI Eve program.

No, the display code was developed at LulzBot (I wrote it). We could not use FTDI's closed-source tools so we wrote our own code from scratch. Some menus might get added in the future if anyone pays me to do it. Like right now I doing some work for CocoaPress :)

@thisiskeithb
Copy link
Member

thisiskeithb commented Feb 24, 2020

I don't know whether this thread is still active, but I suggest putting a resistor on the MISO line, as someone else had run into problems without one. If in fact there is a software fix, I would find it to be interesting and worth additional investigation.

I’m watching this issue since I have an FT810 that I couldn’t get working with Marlin’s version on an SKR 1.3 & 1.4 (never tried Fysetc’s fork/don’t have an S6 board).

Edit: Here's the related issue with more info and what some of us have tried in the past to get these panels working: #16534

@thinkyhead thinkyhead changed the title [BUG] TOUCH_UI_FTDI_EVE doesnt work. [FR] Working TOUCH_UI_FTDI_EVE support Feb 25, 2020
@thinkyhead thinkyhead added the T: Feature Request Features requested by users. label Feb 25, 2020
@sl1pkn07
Copy link
Contributor

sl1pkn07 commented Apr 14, 2020

my touch_eve is arrived (Fysetc 5" (https://es.aliexpress.com/item/4000628057351.html)). i want to test it in a SKR E3 DIP and Ramps+ReARM

#define TOUCH_UI_FTDI_EVE
#define LCD_HAOYU_FT810CB

my first test i have hit the error #16534 (comment). add

diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h
index ff42beb92..48c9e8605 100644
--- a/Marlin/src/HAL/STM32F1/HAL.h
+++ b/Marlin/src/HAL/STM32F1/HAL.h
@@ -47,6 +47,9 @@
   #include "msc_sd.h"
 #endif
 
+
+#define pgm_read_ptr_near(addr) pgm_read_ptr(addr)
+
 // ------------------------
 // Defines
 // ------------------------

in src/HAL/STM32F1/HAL.h seems silence the error

now set a custom pin map

add

diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h
index fef8eeb61..13f87a099 100644
--- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h
+++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h
@@ -220,6 +220,15 @@
 
 #endif // HAS_SPI_LCD
 
+#if ENABLED(TOUCH_UI_FTDI_EVE)
+  #define CLCD_USE_SOFT_SPI
+  #define CLCD_MOD_RESET     EXPA1_08_PIN
+  #define CLCD_SPI_CS        EXPA1_04_PIN
+  #define CLCD_SOFT_SPI_MOSI EXPA1_03_PIN
+  #define CLCD_SOFT_SPI_MISO EXPA1_09_PIN
+  #define CLCD_SOFT_SPI_SCLK EXPA1_05_PIN
+#endif // TOUCH_UI_FTDI_EVE
+
 //
 // SD Support
 // 

after this now fail in:

Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp:141:8: error: macro "GET_TEXT" passed 4 arguments, but takes just 1
        ))
        ^
Compiling .pio/build/STM32F103RE_btt/src/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_start_print_dialog_box.cpp.o
Compiling .pio/build/STM32F103RE_btt/src/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/confirm_user_request_alert_box.cpp.o
Compiling .pio/build/STM32F103RE_btt/src/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/default_acceleration_screen.cpp.o
In file included from /home/sl1pkn07/.platformio/packages/framework-arduinoststm32-maple/STM32F1/cores/maple/WString.h:29:0,
                 from /home/sl1pkn07/.platformio/packages/framework-arduinoststm32-maple/STM32F1/cores/maple/wirish.h:47,
                 from /home/sl1pkn07/.platformio/packages/framework-arduinoststm32-maple/STM32F1/cores/maple/Arduino.h:30,
                 from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/../../../../../inc/../HAL/./STM32F1/../shared/Marduino.h:36,
                 from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/../../../../../inc/../HAL/./STM32F1/HAL.h:32,
                 from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/../../../../../inc/../HAL/HAL.h:26,
                 from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/../../../../../inc/MarlinConfig.h:30,
                 from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/../../../ui_api.h:45,
                 from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/../compat.h:31,
                 from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/../config.h:24,
                 from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp:23:
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp: In static member function 'static void AboutScreen::onRedraw(draw_mode_t)':
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp:60:14: error: 'TOOLHEAD_NAME' was not declared in this scope
     strlen_P(TOOLHEAD_NAME) + 1
              ^
/home/sl1pkn07/.platformio/packages/framework-arduinoststm32-maple/STM32F1/cores/maple/avr/pgmspace.h:27:29: note: in definition of macro 'strlen_P'
 #define strlen_P(a) strlen((a))
                             ^
Compiling .pio/build/STM32F103RE_btt/src/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/developer_menu.cpp.o
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp:70:14: error: 'about_str' was not declared in this scope
     strcpy_P(about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2));
              ^
/home/sl1pkn07/.platformio/packages/framework-arduinoststm32-maple/STM32F1/cores/maple/avr/pgmspace.h:23:37: note: in definition of macro 'strcpy_P'
 #define strcpy_P(dest, src) strcpy((dest), (src))
                                     ^~~~
Compiling .pio/build/STM32F103RE_btt/src/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/dialog_box_base_class.cpp.o
Compiling .pio/build/STM32F103RE_btt/src/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/display_tuning_screen.cpp.o
Compiling .pio/build/STM32F103RE_btt/src/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/endstop_state_screen.cpp.o
In file included from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/../../../../../inc/../core/language.h:382:0,
                 from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/../../../../../inc/MarlinConfig.h:44,
                 from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/../../../ui_api.h:45,
                 from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/../compat.h:31,
                 from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/../config.h:24,
                 from Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp:23:
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp: In static member function 'static void AdvancedSettingsMenu::onRedraw(draw_mode_t)':
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/../../../../../inc/../core/multi_language.h:77:53: error: 'GET_TEXT' was not declared in this scope
 #define GET_TEXT_F(MSG) (const __FlashStringHelper*)GET_TEXT(MSG)
                                                     ^
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp:135:48: note: in expansion of macro 'GET_TEXT_F'
       .tag(7) .button( JERK_POS,               GET_TEXT_F(
                                                ^~~~~~~~~~
*** [.pio/build/STM32F103RE_btt/src/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp.o] Error 1
*** [.pio/build/STM32F103RE_btt/src/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp.o] Error 1

anyone know how fix this?

greetings

@marciot
Copy link
Contributor

marciot commented Apr 14, 2020

@sl1pkn07: Yah, it's a mistake in "src/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/advanced_settings_menu.cpp"

The lines starting on line 135 which read:

      .tag(7) .button( JERK_POS,               GET_TEXT_F(
        #if DISABLED(CLASSIC_JERK)
          MSG_JUNCTION_DEVIATION
        #else
          JERK_POS
        #endif
       ))

Should be:

      .tag(7) .button( JERK_POS,               GET_TEXT_F(
        #if DISABLED(CLASSIC_JERK)
          MSG_JUNCTION_DEVIATION
        #else
          MSG_JERK
        #endif
       ))

And in "src/lcd/extui/lib/ftdi_eve_touch_ui/screens/about_screen.cpp"

  char about_str[
    strlen_P(GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)) +
    strlen_P(TOOLHEAD_NAME) + 1
  ];

Should be:

  char about_str[
    strlen_P(GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)) +
    #ifdef TOOLHEAD_NAME
      strlen_P(TOOLHEAD_NAME) +
    #endfi
    1
  ];

I'll submit a patch.

@thisiskeithb
Copy link
Member

I’d be interested if you can get this working on that board because I could never get it working on an SKR 1.3/1.4 or E3 series.

marciot added a commit to drunken-octopus/drunken-octopus-marlin that referenced this issue Apr 14, 2020
@sl1pkn07
Copy link
Contributor

sl1pkn07 commented Apr 14, 2020

Thanks @marciot now build without problem!

now, the true's hour. flash the firmware....

i've edited my post with s litte changes about the pinout when use the cr10_tft_pinmap. @thisiskeithb looking with your eyes, is ok?

greetings

marciot added a commit to drunken-octopus/drunken-octopus-marlin that referenced this issue Apr 14, 2020
@sl1pkn07
Copy link
Contributor

hardware conected and not works :/

anyone have the pinout of this screen? @GerogeFu ?

@marciot
Copy link
Contributor

marciot commented Apr 14, 2020

@sl1pkn07: Try one of two things:

  1. Power on the board with your finger on the display. Hold it there for a few seconds while the board starts up. This enables a failsafe mode which may help (especially if the display is dimmed all the way).
  2. If that does not do the trick, enable TOUCH_UI_DEBUG in "src/lcd/extui/lib/ftdi_eve_touch_ui/config.h" and look for errors in the serial console.

marciot added a commit to drunken-octopus/drunken-octopus-marlin that referenced this issue Apr 14, 2020
@sl1pkn07
Copy link
Contributor

sl1pkn07 commented Apr 14, 2020

nope the 1). the 2) IDK how get the serial console

one question. in the S6, is need to conect in EXP2, rigth?

i fount this:
Screenshot_20200414_172930

but for example, in the E3 DIP, the connector is flipped
Screenshot_20200414_172810

flip the connector (disassemple in the cord and turn 180º) seems now have the rigth connect (at least, the +5/gnd). but the screen is still blank

@marciot
Copy link
Contributor

marciot commented Apr 14, 2020

Without having this board myself, I can' really offer much guidance. There are pin specific configuration options in:

  • src\lcd\extui\lib\ftdi_eve_touch_ui\ftdi_eve_lib\config.h
  • src\lcd\extui\lib\ftdi_eve_touch_ui\ftdi_eve_lib\pin_mappings.h

Also, there are board and display specific configurations in:

  • src\lcd\extui\lib\ftdi_eve_touch_ui\ftdi_eve_lib\basic\boards.h
  • src\lcd\extui\lib\ftdi_eve_touch_ui\ftdi_eve_lib\basic\resolutions.h

All these things need to line up correctly for the display to work. If anyone wants to donate one of these displays, I can figure out how to make it work, otherwise this is pretty much all the guidance I can offer.

@thisiskeithb
Copy link
Member

@marciot: If I can get you some SKR boards, would you be able to help get this TFT/screen type working in 2.0.x?

@sl1pkn07
Copy link
Contributor

i also create a custom adapter with dupont wires

  /** Fysect Touch EVE 5" display pinout
   *                   _____
   *             MISO | 1 2 | SCK
   *        MOD_RESET | 3 4 | SD_CS
   *           LCD_CS | 5 6   MOSI
   *           SD_DET | 7 8 | RESET
   *              GND | 9 10| 5V
   *                   -----
   *                    EXP1
   */

from Fysect S6 EXP2 pinout and CR10_TFT_PINMAP logic in pin_mappings.h

not works

i also make a diff betwen https://github.com/FYSETC/Marlin-2.0.x-FYSETC/tree/S6/MASTER and marlin-bugfix-2.0.x and i not see related difference with respect the Touch_EVE

Diff_fysect_s6_marlin_bugfix-2.0.x.diff.txt

maybe need a more power?

greetings

@marciot
Copy link
Contributor

marciot commented Apr 14, 2020

@marciot: If I can get you some SKR boards, would you be able to help get this TFT/screen type working in 2.0.x?

If you were willing to donate an SKR board and a TFT panel of the type you need working, I could look into getting it supported. My guess is that there are parameters that aren't quite right.

@marciot
Copy link
Contributor

marciot commented Apr 14, 2020

Try disabling SD_SUPPORT. At least for starters. It might be an incompatibility there.

@thisiskeithb
Copy link
Member

I’ll ping BigTreeTech about the boards and get back to you.

I only have one FTDI EVE FT810 at the moment and I’m not even sure if it works since I could never get anything to display on the screen.

@marciot
Copy link
Contributor

marciot commented Apr 14, 2020

@thisiskeithb: It's better to take things one step at a time. There are some Arduino sketches here that should light up the display:

https://github.com/marciot/drunken-octopus-marlin/tree/master/extras-tools/ftdi-eve-lib-examples

If you can get that to work, then the next step is to try getting it to work in Marlin and on the LPC chip.

@MESlammer
Copy link
Contributor

MESlammer commented May 1, 2020

The GET_TEXT_F problems were caused by mismatched parenthesis. With the new SPI changes, compilation for the Archim (SAM) board was broken. This is because the SPI wrapper class is only present in the HAL for the LPC1768 and STM32F1 and not present for all the other variants. Rather than check for each individually, I decided it is best to use the existence of CLCD_SPI_BUS as the determining factor on whether the wrapper class is used. Thoughts?

I gave it a quick test on Arduino Due (they share the same ATSAM3X8E MCU, right?), it works on device, but during compilation there are a lot of warnings like:
Marlin\src\lcd\extui\lib\ftdi_eve_touch_ui\theme\../ftdi_eve_lib/../config.h:60:0: warning: "CLCD_MOD_RESET" redefined
and OTHER_PIN_LAYOUT settings are ignored, so CLCD_MOD_RESET and CLCD_SPI_CS always pins 9 and 10. Am I doing something wrong?

@marciot
Copy link
Contributor

marciot commented May 1, 2020

@MESlammer: I updated the PR above with a fix for this. Thank you for reporting this bug!

@TB1405
Copy link
Author

TB1405 commented May 1, 2020

should it after this PR also work with SKR1.3 /1.4 than i would try this tomorrow

@RudolphRiedel
Copy link
Contributor

@marciot Thanks, I will rebase when this is thru then.

@TB1405 As you can test with the SKR 1.3/1.4, can you use EXP2+5V and switch to hardware-SPI for the LPC1768? I know EXP2 is on SPI0 with SSEL0 = P0.16, SCK0 = P0.15, MISO0 = P0.17 and MOSI0 = P0.18 - as the schematics says so.
But I have no idea how to configure it, after a quick look over HAL/LPC1768/HAL_SPI.cpp though I am afraid that a simple "SPIClass EVE_SPI(CLCD_SPI_BUS);" with CLCD_SPI_BUS = 0 will not do.

@RudolphRiedel
Copy link
Contributor

I checked it out but now SPI_FREQUENCY is missing in SPI.cpp.
It was in config.h and I suppose it should be in Configuration_adv.h?

@RudolphRiedel
Copy link
Contributor

Damn it, it builds now, the firmware is flashing but my Cheetah is dead.
Looks like the 5V regulator is toast, I need to repair the board before I can continue.

@P-C-R
Copy link

P-C-R commented May 3, 2020

Where would be the best place to ask for UI changes and additions? Should i open a new feature request?

Best

@RudolphRiedel
Copy link
Contributor

I tried to repair my Cheetah today and had to give up.
Long story short, something around the 5V stepdown and the TMC drivers is broken and I blame it on the design that supplies the board when plugging in USB.
@georgefu: Fysetc "owes" me a board - and if it were open source I would have a better chance to repair it.

Anyways, I cut of the 5V regulator and replaced D14 which connects USB_5V to 5V with a 0R0 resistor in order to supply my display from USB.
And as my 5" 800x480 was drawing too much current from the USB, I switched over to a 4.3" with 480x272.
I had to add a new entry to boards.h and also a new entry in resolutions.h.
Then I had to add my new "resolution" to fonts.h to make Marlin compile again.
This concept of separating "boards" and "resolutions" does not really work anymore when you expand the supported displays.

And with my new adapter-board I am using the original LCD-cable from Creality now:
20200504_163935s

It kind of works but now I have this timeout bug.

@RudolphRiedel
Copy link
Contributor

The problem with the timeout is this in base_screen.cpp:
void BaseScreen::reset_menu_timeout() {
TERN_(LCD_TIMEOUT_TO_STATUS, last_interaction = millis());
}

This is supposed to do the same as the old version:
void BaseScreen::reset_menu_timeout() {
#if LCD_TIMEOUT_TO_STATUS
last_interaction = millis();
#endif
}

But I really have no idea what TERN_ expands to in the end.
When I roll it back the timeout works just fine.

@thinkyhead I really do not get what the benefit of using these macros is other than obfuscation.
And if you insist on using these, fine, no problem, but please do at least test that your changes are working before committing them.

@marciot
Copy link
Contributor

marciot commented May 4, 2020

I tried to repair my Cheetah today and had to give up.
Long story short, something around the 5V stepdown and the TMC drivers is broken and I blame it on the design that supplies the board when plugging in USB.

Sorry to hear this :(

This concept of separating "boards" and "resolutions" does not really work anymore when you expand the supported displays.

Having the resolution tied to the board does not work either, because in the past I've exchanged the TFT panels on boards to get different resolutions than the default. You can't do this is the board type is tied to a particular resolution.

The font size mapping is sort of a PITA, but it is meant to reduce the load on the CPU by determining font sizes at compile-time.

If you have CPU cycles to spare, enable TOUCH_UI_FIT_TEXT and then before drawing any string the code will measure the text and choose a font size that fits the buttons, no matter the display resolution. This is somewhat inefficient though, because it requires the looping through font metrics objects each time a string is drawn. We do use it on our 32-bit boards, with good results.

It kind of works but now I have this timeout bug.

I made a PR with fix for the timeout bug, for the moment, you can set LCD_TIMEOUT_TO_STATUS to 0 in Configuration_adv.h

@RudolphRiedel
Copy link
Contributor

RudolphRiedel commented May 6, 2020

Why has pins_FYSETC_CHEETAH.h been modified for TOUCH_UI_FTDI_EVE?
This and any other pins_ file should be completely off-limits for this module.

And the obfuscation with additional layers of defines is not helping at all.

CLCD_MOD_RESET -> BTN_EN1 -> EXPA1_06_PIN -> PC11
CLCD_SPI_CS -> LCD_PINS_RS -> EXPA1_04_PIN -> PB12
CLCD_SOFT_SPI_MOSI -> LCD_PINS_ENABLE -> EXPA1_03_PIN -> PB15
CLCD_SOFT_SPI_MISO -> LCD_PINS_SCK -> EXPA1_07_PIN -> PB14
CLCD_SOFT_SPI_SCLK -> LCD_PINS_D4 -> EXPA1_05_PIN -> PB13

While the resulting pins are correct, the steps in between are all wrong.
-> this is working by chance rather than planned

The first thing is, the footprint of the header is wrong, that is not how the pins are defined for the Cheetah or the RepRap GLCD, that is just the wrong version from Creality.

 *             5V | 1 2 | GND
 *    (MOSI) PB15 | 3 4 | PB12 (LCD_EN)
 *     (SCK) PB13 | 5 6   PC11 (BTN_EN1)
 *  (LCD_RS) PB14 | 7 8 | PC10 (BTN_EN2)
 * (BTN_ENC) PC12 | 9 10| PC9  (BEEPER)
 *                 EXP1

Apart from the incorrect numbering of the pins, BTN_EN1 is connected to PC10 and
BTN_EN2 is connected to PC11 on the Cheetah.

LCD_RS and LCD_EN are the names from FYSETC for the pins in the Cheetah schematic.
If this is taken from the Cheetah schematic, why not use the pin numbers?

Without pins numbers the relation between function, RepRap and µC pin is like this:

CLCD_MOD_RESET -> LCD_PINS_ENABLE -> PC11
CLCD_SPI_CS -> LCD_PINS_D6 -> PB12
CLCD_SOFT_SPI_MOSI -> LCD_PINS_D7 -> PB15
CLCD_SOFT_SPI_MISO -> LCD_PINS_RS  -> PB14
CLCD_SOFT_SPI_SCLK -> LCD_PINS_D5 -> PB13

So how is anyone supposed to look at pin_mappings.h and know what pins are connected?

  #define CLCD_MOD_RESET                 BTN_EN1

BTN_EN1 does not exist for RepRap on EXP1.

  #define CLCD_SPI_CS                    LCD_PINS_RS

LCD_PINS_RS in RepRap Context would be PB14 for the Cheetah.

  #define CLCD_SOFT_SPI_MOSI           LCD_PINS_ENABLE

LCD_PINS_ENABLE in RepRap is LCDE, that would make it PC11 for the Cheetah.

  #define CLCD_SOFT_SPI_MISO           LCD_PINS_SCK

LCD_PINS_SCK does not exist for RepRap on EXP1.

  #define CLCD_SOFT_SPI_SCLK           LCD_PINS_D4

LCD_PINS_D4 in RepRap context would be PC10 for the Cheetah.

Please change this back to the original pins_FYSETC_CHEETAH.h and to whatever other pins_ file has been changed in this context.
And please change this back to my original simple re-mapping for the Cheetah in pin_mappings.h, although a bit modified:

#ifdef CHEETAH_TFT_PINMAP
  #ifndef __MARLIN_FIRMWARE__
    #error "This pin mapping requires Marlin."
  #endif

    #define CLCD_MOD_RESET  PC11
    #define CLCD_SPI_CS     PB12

    //#define CLCD_USE_SOFT_SPI
    #if ENABLED(CLCD_USE_SOFT_SPI)
      #define CLCD_SOFT_SPI_MOSI PB15
      #define CLCD_SOFT_SPI_MISO PB14
      #define CLCD_SOFT_SPI_SCLK PB13
    #else
      #define CLCD_SPI_BUS  2
    #endif
#endif

@marciot
Copy link
Contributor

marciot commented May 6, 2020

And the obfuscation with additional layers of defines is not helping at all.

CLCD_MOD_RESET -> BTN_EN1 -> EXPA1_06_PIN -> PC11
CLCD_SPI_CS -> LCD_PINS_RS -> EXPA1_04_PIN -> PB12
CLCD_SOFT_SPI_MOSI -> LCD_PINS_ENABLE -> EXPA1_03_PIN -> PB15
CLCD_SOFT_SPI_MISO -> LCD_PINS_SCK -> EXPA1_07_PIN -> PB14
CLCD_SOFT_SPI_SCLK -> LCD_PINS_D4 -> EXPA1_05_PIN -> PB13

@RudolphRiedel: I was not involved in the creation of pin mappings for FYSETC, so I can't speak to the current config, but I will chime in on why my initial pin_mappings for the Rambo and Archim used the RepRapDiscount pins as an intermediary. The reason for this is that many boards already had a 10 pin connector for the RepRapDiscount display and the AlephObjects display uses the same 10 pin connector for compatibility. AFAIK, it is the only board that uses that connector. By defining my new TFT interface pin out in terms of the old, there was at least a chance that the AlephObjects display could be used on any board with the same ribbon cable as used in the RepRapDiscount display, without having to come up with a new pin map. That was the idea, anyway, whether it works in practice I cannot know.

But yes, if you are using some non-AlephObjects controller, then the pin mapping could count as obfuscation. You certainly do not need to use it for new boards.

@RudolphRiedel
Copy link
Contributor

That was not about using the RepRap names per se.
I defined the changes to pin_mappings.h for the Cheetah and it worked just fine.
Only the pin in use for CLCD_MOD_RESET was "in dispute" as I originally chose PC9 for it.
But I agreed to switch over to PC11.
The original defines like LCD_PINS_RS are not active anymore in pins_FYSETC_CHEETAH.h as HAS_SPI_LCD is not true anymore.
So "#define CLCD_SPI_CS PB12" works with the unchanged pins_FYSETC_CHEETAH.h but "#define CLCD_SPI_CS PB12 LCD_PINS_RS" does not.
Also LCD_PINS_RS does not serve any purpose anymore.

Then @sl1pkn07 stepped in and went overboard with it, changed pins_FYSETC_CHEETAH.h and put up annother layer of defines around the pin names - why?
This is unnecessary complex now.
And a bit scary as in the end the pins somehow still are assigned correctly to their function, despite bugs like the wrong numbering and the wrong assignment of BTN_EN1 and BTN_EN2.

@sl1pkn07
Copy link
Contributor

sl1pkn07 commented May 7, 2020

first for all apologizes for all disturb

from the schemes
Screenshot_20200507_161602
from pic of the board
Screenshot_20200507_161713

the position of the pin cover is the same as other E3 board like the stock, BTT E3/DIP, so I flip the pinheader

image

because in all pin_foo files, the pinout draw use as reference the gap in the plastic in the right side and pin 1 in the upper left

is the same i use to draw the pin connector in the pins_cheetha.h

Screenshot_20200507_162451

wich is the same used in BTT_SKR_E3_DIP in first time https://github.com/MarlinFirmware/Marlin/blob/04cea864bcc197a91a162f8cc48cd6588260f8af/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h

now, in the cheetha schemas

Screenshot_20200507_162803
Screenshot_20200507_162842
Screenshot_20200507_163017

so yes, the BTN_EN1 and BTN_EN2 is switched, is my enterely fault. sorry

about use pin alias instead of real pins. is because i follow the pin_mappings.h scheme, with use alias except the CR10 pinout (what CR10 board?). like the pins_BTT_SKR_E3_DIP.h/pins_BTT_SKR_MINI_E3.h (the board i own and can test. i brougth a cheetha 1.1 and MKS E3D boards for add support for the Fysetc TFT81050 display, but both is still in transit)

@marciot @thinkyhead is possible get rid the pins_mappings.h file and do the job in each compatible boards? like the other displays. also is posible reformat the pin scheme structure in all boards?, because all board have his own different structure, wich is difficult use one as reference

greetings
and again, apologizes for all disturb

@marciot
Copy link
Contributor

marciot commented May 7, 2020

@marciot @thinkyhead is possible get rid the pins_mappings.h file and do the job in each compatible boards? like the other displays. also is posible reformat the pin scheme structure in all boards?, because all board have his own different structure, wich is difficult use one as reference

Of course it is possible. It is not even necessary to get rid of the "pin_mappings.h" file, as it won't come into play unless one of pin mapping constants is defined somewhere. So all you really need to do to implement what you want is to define the various CLCD_* variables in the pin map file for whatever board you are working with.

IMHO, the "pin_mapping.h" file should only be used for generic non-board specific pin maps which make use of the RepRapDiscount pin assignments as an intermediary. Specific setups for boards can and should happen in the pins file for the board itself.

@marciot
Copy link
Contributor

marciot commented May 7, 2020

BTW, I like how you made the ASCII diagram with the gap to show the direction of the connector. Some board schematics define the pin numbers in reverse order, making things very confusing. Usually I have to look at the ground pin to figure out which direction the numbering is going.

@sl1pkn07
Copy link
Contributor

sl1pkn07 commented May 7, 2020

i'm not sure is the pin number order is the correct (ISO(?) standard), i only follow other examples. and yes. draw the connector (if have a ovbiously visual point of reference like this one ) is more concise than only enumerate the pins with names

greetings

@RudolphRiedel
Copy link
Contributor

No, I feel a bit sorry for the noise I made but I felt this needs to be discussed.

sl1pkn07
from the schemes
from pic of the board

Yes, this is correct.

the position of the pin cover is the same as other E3 board like the stock,
BTT E3/DIP, so I flip the pinheader

And this is wrong, The Beeper pin is the top-left one in the board picture.
And the top left pin on all the E3 boards is pin 1.

Just one example from a datasheet for this type of connector:
grafik

Note the little triangle, it marks pin 1. You will also find it on the connector.

because in all pin_foo files, the pinout draw use as reference the gap in the plastic
in the right side and pin 1 in the upper left

I won't check all the files now but if this is the case, all the files are wrong.
But if the polarization gap is there that is at least a reference to resolve this.
In any case, documenting it differently as the manufacturer of the board could cause
serious confusion.

wich is the same used in BTT_SKR_E3_DIP in first time https://github.com/MarlinFirmware/Marlin/blob/04cea864bcc197a91a162f8cc48cd6588260f8af/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h

Then this is wrong as well:
grafik

This is from the BTT-SKR-E3-DIP schematic.
Okay, this is not really helpfull as the 2x5 is drawn as 1x10, but the pin numbers do match the Fysetc board.
And there is this:
grafik

This is from the SKR-mini-E3 schematic:
grafik
grafik

Excellent, same connector, same pin-assignement, different numbering scheme.

My guess is, Creality messed up.
And as the mini-E3 is a drop-in replacement BTT copied the mistake.
But at least Fysetc did not fell for it.

i'm not sure is the pin number order is the correct (ISO(?) standard),

I am not sure if there is a standard either, I found DIN 41651 though but that might regulate only some special properties for these types of connectors.
But check this:
https://www.digikey.de/products/de/connectors-interconnects/rectangular-connectors-headers-male-pins/314?k=&pkeyword=&sv=0&pv7=2&pv7=3&sf=1&FV=69%7C411897%2C88%7C63986%2C90%7C121326%2C1790%7C9726%2C2024%7C9726%2C-8%7C314%2C2021%7C402177&quantity=&ColumnSort=0&page=1&pageSize=25
3M, TE, Hirose, Samtec, Molex, Harting, etc - they all use the same numbering scheme.

about use pin alias instead of real pins. is because i follow the pin_mappings.h scheme, with use >alias except the CR10 pinout (what CR10 board?).
like the pins_BTT_SKR_E3_DIP.h/pins_BTT_SKR_MINI_E3.h

The CR10 uses the same board as the Ender-3, the CR10S uses a different board.
And I do not object to the alias names per se, I object to use a scheme like this:
CLCD_MOD_RESET -> BTN_EN1 -> EXPA1_06_PIN -> PC11
CLCD_SPI_CS -> LCD_PINS_RS -> EXPA1_04_PIN -> PB12
CLCD_SOFT_SPI_MOSI -> LCD_PINS_ENABLE -> EXPA1_03_PIN -> PB15
CLCD_SOFT_SPI_MISO -> LCD_PINS_SCK -> EXPA1_07_PIN -> PB14
CLCD_SOFT_SPI_SCLK -> LCD_PINS_D4 -> EXPA1_05_PIN -> PB13

What is the benefit of trying to hide that CLCD_MOD_RESET is connected to PC11?
And you added the EXPA1_ defines as additional layer.

If you have this:
#define CLCD_MOD_RESET PC11

You can hover with the mouse over CLCD_MOD and it will tell you that it is defined as PC11.
As it is now I can only see that it is defined as BTN_EN1.
And when I look up BTN_EN1 I find it in a different file and that it is defined as EXPA1_06_PIN.
Then I have to check the definition for EXAPA1_06_PIN.

That the pin assignment is currently wrong and that CLCD_MOD should be assigned to BTN_EN2 is an excellent showcase for how important it is to make things simple and not cover it in several layers of defines that are not even used anywhere.

marciot
IMHO, the "pin_mapping.h" file should only be used for generic non-board specific pin
maps which make use of the RepRapDiscount pin assignments as an intermediary.
Specific setups for boards can and should happen in the pins file for the board itself.

Okay, I made my point and you two would like to go in the opposite direction.
Fine, no problem, looks like we are going for the board specific files then.

And if the defines are removed from pin_mappings.h it should be a lot easier to read pins_xxx.h as this is all in one place then.

@sl1pkn07
Copy link
Contributor

sl1pkn07 commented May 7, 2020

my point is also get out the file and o the work in each board pin file

about the pin numeration, thinkyhead@28008ac. just i say, i only follow the existent code

the use of a tons of alias is because is used in the pins_mapping, but my start point is in the BTT E3 DIP file, wich have setted the EXPA1_FOO alias, the i use it in the other files i modified. in this point seems i make a mistake when i lead my initiative without thinking in other devs. sorry for that

but if i get rid the expa1/2 alias, i can do the same in the rest of pin files wich have seteed on?

Grep Output
───╼  grep -R EXPA[1,2]
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA1_03_PIN                       P1_23
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA1_04_PIN                       P1_22
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA1_05_PIN                       P1_21
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA1_06_PIN                       P1_20
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA1_07_PIN                       P1_19
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA1_08_PIN                       P1_18
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA1_09_PIN                       P0_28
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA1_10_PIN                       P1_30
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define LCD_PINS_RS             EXPA1_03_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define BTN_EN1                 EXPA1_06_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define BTN_EN2                 EXPA1_04_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define BTN_ENC                 EXPA1_08_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define LCD_PINS_ENABLE         EXPA1_05_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define LCD_PINS_D4             EXPA1_07_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define LCD_PINS_RS             EXPA1_04_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define BTN_EN1                 EXPA1_08_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define BTN_EN2                 EXPA1_06_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define BTN_ENC                 EXPA1_09_PIN  // (58) open-drain
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define LCD_PINS_ENABLE         EXPA1_03_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define LCD_PINS_D4             EXPA1_05_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define LCD_PINS_RS             EXPA1_07_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define BTN_ENC                 EXPA1_09_PIN  // (58) open-drain
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define LCD_PINS_ENABLE         EXPA1_08_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define LCD_PINS_D4             EXPA1_06_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:      #define DOGLCD_CS             EXPA1_08_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:      #define DOGLCD_A0             EXPA1_07_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:      #define LCD_RESET_PIN         EXPA1_06_PIN  // Must be high or open for LCD to operate normally.
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:          #define RGB_LED_R_PIN     EXPA1_05_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:          #define RGB_LED_G_PIN     EXPA1_04_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:          #define RGB_LED_B_PIN     EXPA1_03_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define NEOPIXEL_PIN        EXPA1_05_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define DOGLCD_CS           EXPA1_05_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define DOGLCD_A0           EXPA1_04_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define BTN_EN1             EXPA1_08_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define BTN_EN2             EXPA1_06_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define BTN_ENC             EXPA1_09_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define DOGLCD_CS           EXPA1_04_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define DOGLCD_A0           EXPA1_05_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define DOGLCD_SCK          EXPA1_10_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define DOGLCD_MOSI         EXPA1_03_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define LCD_PINS_D5         EXPA1_05_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define LCD_PINS_D6         EXPA1_04_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define LCD_PINS_D7         EXPA1_03_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:#define EXPA1_03_PIN                        PB7
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:#define EXPA1_04_PIN                        PB8
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:#define EXPA1_05_PIN                        PB9
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:#define EXPA1_06_PIN                        PA10
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:#define EXPA1_07_PIN                        -1
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:#define EXPA1_08_PIN                        PA9
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:#define EXPA1_09_PIN                        PB6
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:#define EXPA1_10_PIN                        PB5
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define BEEPER_PIN              EXPA1_10_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define BTN_ENC                 EXPA1_09_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define BTN_EN1                 EXPA1_08_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define BTN_EN2                 EXPA1_06_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define LCD_PINS_RS             EXPA1_04_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define LCD_PINS_ENABLE         EXPA1_03_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define LCD_PINS_D4             EXPA1_05_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define LCD_PINS_RS             EXPA1_05_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define LCD_PINS_ENABLE         EXPA1_09_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define LCD_PINS_D4             EXPA1_04_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define LCD_PINS_D5             EXPA1_06_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define LCD_PINS_D6             EXPA1_08_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define LCD_PINS_D7             EXPA1_10_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define BTN_ENC                 EXPA1_09_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define BTN_EN1                 EXPA1_08_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define BTN_EN2                 EXPA1_06_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define DOGLCD_CS               EXPA1_04_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define DOGLCD_A0               EXPA1_05_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define DOGLCD_SCK              EXPA1_10_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:    #define DOGLCD_MOSI             EXPA1_03_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:  #define BEEPER_PIN                EXPA1_09_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:  #define BTN_EN1                   EXPA1_08_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:  #define LCD_PINS_RS               EXPA1_04_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:  #define LCD_PINS_ENABLE           EXPA1_03_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:  #define LCD_PINS_D4               EXPA1_05_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:  #define SD_DETECT_PIN             EXPA1_10_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3.h:  #define SS_PIN                    EXPA1_06_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:#define EXPA1_03_PIN                        PB7
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:#define EXPA1_04_PIN                        PB8
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:#define EXPA1_05_PIN                        PB9
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:#define EXPA1_06_PIN                        PA10
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:#define EXPA1_07_PIN                        -1
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:#define EXPA1_08_PIN                        PA9
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:#define EXPA1_09_PIN                        PB6
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:#define EXPA1_10_PIN                        PA15
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define BEEPER_PIN              EXPA1_10_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define BTN_ENC                 EXPA1_09_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define BTN_EN1                 EXPA1_08_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define BTN_EN2                 EXPA1_06_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define LCD_PINS_RS             EXPA1_04_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define LCD_PINS_ENABLE         EXPA1_03_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define LCD_PINS_D4             EXPA1_05_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define LCD_PINS_RS             EXPA1_05_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define LCD_PINS_ENABLE         EXPA1_09_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define LCD_PINS_D4             EXPA1_04_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define LCD_PINS_D5             EXPA1_06_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define LCD_PINS_D6             EXPA1_08_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define LCD_PINS_D7             EXPA1_10_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define BTN_ENC                 EXPA1_09_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define BTN_EN1                 EXPA1_08_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define BTN_EN2                 EXPA1_06_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define DOGLCD_CS               EXPA1_04_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define DOGLCD_A0               EXPA1_05_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define DOGLCD_SCK              EXPA1_10_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:    #define DOGLCD_MOSI             EXPA1_03_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:  #define BEEPER_PIN                EXPA1_09_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:  #define BTN_EN1                   EXPA1_08_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:  #define LCD_PINS_RS               EXPA1_04_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:  #define SD_DETECT_PIN             EXPA1_10_PIN
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h:  #define SS_PIN                    EXPA1_06_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:#define EXPA1_03_PIN                        PB15
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:#define EXPA1_04_PIN                        PB12
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:#define EXPA1_05_PIN                        PB13
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:#define EXPA1_06_PIN                        PC11
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:#define EXPA1_07_PIN                        PB14
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:#define EXPA1_08_PIN                        PC10
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:#define EXPA1_09_PIN                        PC12
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:#define EXPA1_10_PIN                        PC9
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:  #define BEEPER_PIN                EXPA1_10_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:    #define DOGLCD_A0               EXPA1_07_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:    #define DOGLCD_CS               EXPA1_04_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:    #define DOGLCD_SCK              EXPA1_05_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:    #define DOGLCD_MOSI             EXPA1_03_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:  #define LCD_PINS_RS               EXPA1_04_PIN  // CS -- SOFT SPI for ENDER3 LCD
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:  #define LCD_PINS_D4               EXPA1_05_PIN  // SCLK
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:  #define LCD_PINS_ENABLE           EXPA1_03_PIN  // DATA MOSI
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:    #define BTN_EN1                 EXPA1_06_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:    #define BTN_EN2                 EXPA1_08_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:    #define BTN_ENC                 EXPA1_09_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:  #define BEEPER_PIN                EXPA1_10_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:  #define BTN_EN1                   EXPA1_06_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:  #define LCD_PINS_RS               EXPA1_04_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:    #define LCD_PINS_ENABLE         EXPA1_03_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:    #define LCD_PINS_SCK            EXPA1_07_PIN
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h:    #define LCD_PINS_D4             EXPA1_05_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA2_03_PIN                       -1
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA2_04_PIN                       P1_31
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA2_05_PIN                       P0_18
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA2_06_PIN                       P3_25
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA2_07_PIN                       P0_16
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA2_08_PIN                       P3_26
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA2_09_PIN                       P0_15
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:#define EXPA2_10_PIN                       P0_17
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define BTN_EN1                 EXPA2_08_PIN  // (31) J3-2 & AUX-4
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define BTN_EN2                 EXPA2_06_PIN  // (33) J3-4 & AUX-4
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define LCD_SDSS                EXPA2_07_PIN  // (16) J3-7 & AUX-4
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:    #define SD_DETECT_PIN           EXPA2_04_PIN  // (49) (NOT 5V tolerant)
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:      #define DOGLCD_SCK            EXPA2_09_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:      #define DOGLCD_MOSI           EXPA2_05_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define DOGLCD_SCK          EXPA2_09_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:        #define DOGLCD_MOSI         EXPA2_05_PIN
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h:  #define SS_PIN                    EXPA2_07_PIN

@thinkyhead, is ok if remove the set up EXPA alias and set the pin name instead?

greetings

@RudolphRiedel
Copy link
Contributor

Woa, okay, I would say you got me good there.
I do not have to like it to go with the flow. :-)

@thinkyhead
Copy link
Member

is ok if remove the set up EXPA alias and set the pin name instead?

Yes.

The point of any of these indirect header plug mappings is to make it easier to map different common display connectors to the EXP headers. However, in practice it doesn't always look as pretty or map as cleanly as we would like.

Can you imagine trying to make a single pins/pins_lcd.h file that contains just one mapping for each type of display? And the board-oriented pins files would just describe the plugs that displays are expected to use. At one time I thought that might be possible….

@RudolphRiedel
Copy link
Contributor

RudolphRiedel commented May 10, 2020

Okay, I just pushed #17935 which removes the special pinout for the Cheetah from pin_mappings.h and puts the necessary defines into pins_FYSETC_CHEETAH.h.

When I opened pins_FYSETC_CHEETAH.h I intended to keep the EXPA1_ definitions.
But I quickly realised what I noticed the first time already, these do not serve any purpose as these are not used anywhere else outside of that file.
The only thing that the EXPA1_ definitions really do is to obfuscate to which pin of a controller a function is actually assigned to.
For example when you are in spi.cpp and want to know to what pin CLCD_SOFT_SPI_MISO is assigned to, VSCode will now directly tell you it is PB14 if you use software-SPI with the Cheetah.

I also corrected the pinout for the connector and added a couple of lines to explain this.

IMHO these EXPA1_ definitions should be removed from the only three files using these, namely pins_BTT_SKR_V1_3.h, pins_BTT_SKR_E3_DIP.h and pins_BTT_SKR_MINI_E3.h.
But I do not have one of these and therefore can not test this.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2020
jmp0x0000 pushed a commit to jmp0x0000/Marlin that referenced this issue Aug 7, 2020
njibhu pushed a commit to njibhu/Marlin that referenced this issue Aug 24, 2020
HairingX pushed a commit to HairingX/Marlin that referenced this issue Jun 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: LCD & Controllers help wanted Needs: Patch A patch is needed to fix this T: Feature Request Features requested by users.
Projects
None yet
Development

No branches or pull requests

9 participants