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

[BUG] RAMPS 1.4 Plus - Wrong RRDSC pins #23501

Closed
fduraibi opened this issue Jan 11, 2022 · 10 comments
Closed

[BUG] RAMPS 1.4 Plus - Wrong RRDSC pins #23501

fduraibi opened this issue Jan 11, 2022 · 10 comments

Comments

@fduraibi
Copy link
Contributor

fduraibi commented Jan 11, 2022

Did you test the latest bugfix-2.0.x code?

Yes, and the problem still exists.

Bug Description

I have the RAMPS 1.4 Plus board with REPRAP_DISCOUNT_SMART_CONTROLLER (LCD2004), and the current pins file pins_RAMPS_PLUS.h doesn't work with it since the pins settings are a bit different.

LCD2004_IO_Ports

In ordered to make it work I changed the file to match the pins in the image, and disabled the code for the other type of LCD REPRAPWORLD_GRAPHICAL_LCD (LCD12864)

Here is the content of my file `pins_RAMPS_PLUS.h` that works with my printer setup:
/**
 * Marlin 3D Printer Firmware
 * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
 *
 * Based on Sprinter and grbl.
 * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 */
#pragma once

/**
 * Arduino Mega with RAMPS v1.4Plus, also known as 3DYMY version, pin assignments
 * The differences to the RAMPS v1.4 are:
 *  - Swap heater E0 with E1
 *  - Swap pins 8 and 10. Bed/Fan/Hotend as labeled on the board are on pins 8/9/10.
 *  - Change pins 16->42, 17->44 and 29->53 used for display.
 *
 * Applies to the following boards:
 *
 *  RAMPS_PLUS_EFB (Extruder, Fan, Bed)
 *  RAMPS_PLUS_EEB (Extruder, Extruder, Bed)
 *  RAMPS_PLUS_EFF (Extruder, Fan, Fan)
 *  RAMPS_PLUS_EEF (Extruder, Extruder, Fan)
 *  RAMPS_PLUS_SF  (Spindle, Controller Fan)
 */

#include "env_validate.h"

#define BOARD_INFO_NAME "RAMPS 1.4 Plus"

#define MOSFET_A_PIN                           8
#define MOSFET_C_PIN                          10

//
// Steppers
//
#define X_CS_PIN                              -1
#define Y_CS_PIN                              -1
#define Z_CS_PIN                              -1

// Swap E0 / E1 on 3DYMY
#define E0_STEP_PIN                           36
#define E0_DIR_PIN                            34
#define E0_ENABLE_PIN                         30
#define E0_CS_PIN                             -1

#define E1_STEP_PIN                           26
#define E1_DIR_PIN                            28
#define E1_ENABLE_PIN                         24
#define E1_CS_PIN                             -1

#define EXP1_03_PIN                           44
#define EXP1_04_PIN                           42
#define EXP1_05_PIN                           23
#define EXP1_06_PIN                           33
#define EXP1_07_PIN                           41
#define EXP1_08_PIN                           31
#define EXP1_09_PIN                           35
#define EXP1_10_PIN                           37

#define EXP2_03_PIN                           27
#define EXP2_04_PIN                           49
#define EXP2_05_PIN                           51
#define EXP2_06_PIN                           25
#define EXP2_07_PIN                           53
#define EXP2_08_PIN                           29
#define EXP2_09_PIN                           52
#define EXP2_10_PIN                           50

#include "pins_RAMPS.h"

// ** THIS MUST BE DISABLED SINCE IT OVERRIDES MY PREVIOUS SETTINGS **
// #if IS_ULTRA_LCD && NONE(REPRAPWORLD_GRAPHICAL_LCD, CR10_STOCKDISPLAY) && !BOTH(IS_NEWPANEL, PANEL_ONE)
//   #if DISABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)
//     #undef LCD_PINS_RS
//     #define LCD_PINS_RS                       42  // 3DYMY boards pin 16 -> 42
//     #undef LCD_PINS_ENABLE
//     #define LCD_PINS_ENABLE                   44  // 3DYMY boards pin 17 -> 44
//   #endif
//   #undef LCD_PINS_D7
//   #define LCD_PINS_D7                         53  // 3DYMY boards pin 29 -> 53
// #endif

The fix i think is simple which is to check if REPRAP_DISCOUNT_SMART_CONTROLLER is defined use the suitable pins.

@descipher
Copy link
Contributor

Try just the basic ramps 1.4, works for me.
#define MOTHERBOARD BOARD_RAMPS_14_EFB
The plus pins file looks odd.

@fduraibi
Copy link
Contributor Author

@descipher The board I have is different from the original ramps 1.4, it is called ramps 1.4 plus which integrates the MEGA and the ramps in a single board.

It is nice and small, however, the designer for some reason didn't use the same pin out as the original board, maybe for easier and more efficient pcb trace routing.

@ellensp
Copy link
Contributor

ellensp commented Jan 12, 2022

The above pins_RAMPS_PLUS.h looks fine. It shouldn't need any lcd settings since they are defined in pins_RAMPS.h and use EXP PIN definitions.
Just needs a PR created to formally change it.

@ellensp
Copy link
Contributor

ellensp commented Jan 12, 2022

@fduraibi Do you need help creating the PR, or are you going to give this a try yourself?

@fduraibi
Copy link
Contributor Author

@ellensp I will give it a try myself and by the weekend should have a PR ready

fduraibi added a commit to fduraibi/Marlin that referenced this issue Jan 14, 2022
Adding support for the REPRAP_DISCOUNT_SMART_CONTROLLER LCD module with the Ramps 1.4 Plus board

This closes the issue MarlinFirmware#23501
fduraibi added a commit to fduraibi/Marlin that referenced this issue Jan 14, 2022
Adding support for the REPRAP_DISCOUNT_SMART_CONTROLLER LCD module with the Ramps 1.4 Plus board

This closes the issue MarlinFirmware#23501
@thinkyhead thinkyhead changed the title [BUG] RAMPS 1.4 Plus pins is not correct with REPRAP_DISCOUNT_SMART_CONTROLLER [BUG] RAMPS 1.4 Plus - Wrong RRDSC pins Jan 17, 2022
@thinkyhead
Copy link
Member

thinkyhead commented Jan 17, 2022

Poking around the interwebs led me to the old PR #6033 … and the pins as suggested end up matching very closely. Only the changed pins are commented here, and all of them correspond with that PR. I did not find any schematic to confirm that the EXP1/2 headers match all the pins.

/**        ------                     ------
 *     37 |10  9 | 35      (MISO) 50 |10  9 | 52 (SCK)
 *     31 | 8  7 | 41             29 | 8  7 | 53
 *     33   6  5 | 23             25   6  5 | 51 (MOSI)
 *     42 | 4  3 | 44             49 | 4  3 | 27
 *    GND | 2  1 | 5V            GND | 2  1 | --
 *         ------                     ------
 *          EXP1                       EXP2
 */
#define EXP1_03_PIN                           44  // (29) LCD_PINS_D7
#define EXP1_04_PIN                           42  // (27) LCD_PINS_D6
#define EXP1_05_PIN                           23  // (25) LCD_PINS_D5
#define EXP1_06_PIN                           33  // (23) LCD_PINS_D4
#define EXP1_07_PIN                           41  // (16) LCD_PINS_RS
#define EXP1_08_PIN                           31  // (17) LCD_PINS_EN
#define EXP1_09_PIN                           35
#define EXP1_10_PIN                           37

#define EXP2_03_PIN                           27  // (41) BTN_ENC
#define EXP2_04_PIN                           49
#define EXP2_05_PIN                           51
#define EXP2_06_PIN                           25  // (33) BTN_EN1
#define EXP2_07_PIN                           53
#define EXP2_08_PIN                           29  // (31) BTN_EN2
#define EXP2_09_PIN                           52
#define EXP2_10_PIN                           50

@thinkyhead
Copy link
Member

The description of the linked PR also notes "their 2004LCD has a different pinout than the REPRAP_DISCOUNT_SMARTCONTROLLER it clones."

So we actually need a new LCD definition that distinguishes the clone LCD controller from the standard one, not just the differing pinouts for EXP1/2.

@fduraibi
Copy link
Contributor Author

@thinkyhead I have the clone REPRAP_DISCOUNT_SMART_CONTROLLER (LCD2004) and it works fine by just fixing the EXP1 & 2, no other modifications are needed.

@descipher
Copy link
Contributor

The description of the linked PR also notes "their 2004LCD has a different pinout than the REPRAP_DISCOUNT_SMARTCONTROLLER it clones."

In this case the main board has a different pinout than the basic ramps 1.4, the board naming "plus" is confusing. It's a single board (not the riser style) and its connected to a generic 2004 LCD.

@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 Apr 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants