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] M504 interferes with ST7565 SPI LCD and causes it to clear on BTT v1.4 #18133

Closed
richardklingler opened this issue May 27, 2020 · 16 comments

Comments

@richardklingler
Copy link

richardklingler commented May 27, 2020

Bug Description

Sending the command M504 causes a ST7565 SPI LCD first to smear on the left side, then on the second M504 command it is cleared...

My Configurations

configuration.zip

Steps to Reproduce

  1. Flash Marlin 2.0.4.4
  2. Install on BTT v1.4 LPC1768 board
  3. Send M504 command

Expected behavior: [No influence on LCD]

IMG_1632

Actual behavior: [First M504 command sent]

IMG_1633

Actual behavior: [First M504 second sent]

IMG_1634

@richardklingler
Copy link
Author

Seems the defined A0 line is taken low during the execution of M504...

Tested with:

#define DOGLCD_A0 P0_16

and with default setting:

#define DOGLCD_A0 P1_22

@richardklingler richardklingler changed the title [BUG] (short description) [BUG] M504 interferes with ST7565 SPI LCD and causes it to clear on BTT v1.4 May 27, 2020
@richardklingler
Copy link
Author

Issuing the command (set LCD contrast)

M250 C200
or M501

brings the display back...

When issuing the M504 command...and read back M250 contrast value, it is modified....

After reset:

M250
LCD Contrast: 190

After M504:

M504
echo:EEPROM OK
ok
M250
LCD Contrast: 255

After M501:

echo:; LCD Contrast:
echo: M250 C190

@boelle
Copy link
Contributor

boelle commented Jun 21, 2020

@richardklingler still an issue?

@boelle boelle closed this as completed Jun 23, 2020
@richardklingler
Copy link
Author

This is still happening with 2.0.6 bugfix...

@thinkyhead thinkyhead reopened this Aug 4, 2020
@thinkyhead
Copy link
Member

@richardklingler — Enable PINS_DEBUGGING and see if M43 reveals anything about pin usage.

@MarlinFirmware MarlinFirmware deleted a comment from boelle Aug 4, 2020
@boelle
Copy link
Contributor

boelle commented Aug 4, 2020

@richardklingler

Does it also happen with bugfix-2.0.x branch ?

@richardklingler
Copy link
Author

richardklingler commented Aug 4, 2020

This is what M43 returns:

M43
PIN: 0.00 <unused/unknown> Input = 1
PIN: 0.01 <unused/unknown> Input = 1
PIN: 0.02 (A 2) TXD0 Input = 1
PIN: 0.03 (A 3) RXD0 Input = 1
PIN: 0.04 TMC_SW_SCK Output = 1
PIN: 0.05 TMC_SW_MISO Input = 1
PIN: 0.06 <unused/unknown> Output = 1
PIN: 0.07 <unused/unknown> Input = 0
PIN: 0.08 <unused/unknown> Input = 1
PIN: 0.09 <unused/unknown> Input = 1
PIN: 0.10 <unused/unknown> Input = 1
PIN: 0.11 E0_DIR_PIN protected
PIN: 0.15 DOGLCD_SCK Output = 0
. SCK_PIN Output = 0
PIN: 0.16 LCD_SDSS Input = 1
PIN: 0.17 MISO_PIN Input = 1
PIN: 0.18 DOGLCD_MOSI Output = 0
. MOSI_PIN Output = 0
PIN: 0.19 Y_STEP_PIN protected
PIN: 0.20 Y_DIR_PIN protected
PIN: 0.21 Z_ENABLE_PIN protected
PIN: 0.22 Z_STEP_PIN protected
PIN: 0.23 (A23) <unused/unknown> Analog in = 0 Input = 0
PIN: 0.24 (A24) <unused/unknown> Analog in = 1023 Input = 0
PIN: 0.25 (A25) <unused/unknown> Analog in = 1023 Input = 0
PIN: 0.26 (A26) SPINDLE_LASER_ENA_PIN Output = 1
PIN: 0.27 <unused/unknown> Input = 0
PIN: 0.28 BTN_ENC Input = 1
PIN: 0.29 <unused/unknown> Input = 1
PIN: 0.30 <unused/unknown> Input = 0
PIN: 1.00 POWER_LOSS_PIN Input = 1
PIN: 1.01 E1_CS_PIN protected
. Y2_CS_PIN protected
. Z2_SERIAL_TX_PIN protected
. Z2_SERIAL_RX_PIN protected
. E1_SERIAL_TX_PIN protected
. E1_SERIAL_RX_PIN protected
PIN: 1.04 E0_SERIAL_TX_PIN Input = 1
. E0_SERIAL_RX_PIN Input = 1
PIN: 1.08 Z_CS_PIN protected
. Z_SERIAL_TX_PIN protected
. Z_SERIAL_RX_PIN protected
PIN: 1.09 Y_CS_PIN protected
. Y_SERIAL_TX_PIN protected
. Y_SERIAL_RX_PIN protected
PIN: 1.10 X_CS_PIN protected
. X_SERIAL_TX_PIN protected
. X_SERIAL_RX_PIN protected
PIN: 1.14 E1_DIR_PIN protected
. Y2_DIR_PIN protected
PIN: 1.15 E1_STEP_PIN protected
. Y2_STEP_PIN protected
PIN: 1.16 E1_ENABLE_PIN protected
. Y2_ENABLE_PIN protected
PIN: 1.17 TMC_SW_MOSI Output = 0
PIN: 1.18 LCD_PINS_ENABLE Output = 0
PIN: 1.19 LCD_PINS_RS Output = 0
PIN: 1.20 LCD_PINS_D4 Output = 1
PIN: 1.21 DOGLCD_CS Output = 1
. LCD_PINS_D5 Output = 1
PIN: 1.22 DOGLCD_A0 Output = 1
. LCD_PINS_D6 Output = 1
PIN: 1.23 LCD_PINS_D7 Output = 1
. SDSS Output = 1
. SS_PIN Output = 1
PIN: 1.24 NEOPIXEL_PIN Input = 0
PIN: 1.25 FIL_RUNOUT2_PIN Analog in = 0
. E1_DIAG_PIN Input = 1
PIN: 1.26 E0_DIAG_PIN Input = 1
PIN: 1.27 Z_MAX_PIN protected
. Z_DIAG_PIN protected
. Z_STOP_PIN protected
PIN: 1.28 Y_MIN_PIN protected
. Y_DIAG_PIN protected
. Y_STOP_PIN protected
PIN: 1.29 X_MIN_PIN protected
. X_DIAG_PIN protected
. X_STOP_PIN protected
PIN: 1.30 (A62) BEEPER_PIN Output = 0
PIN: 1.31 (A63) <unused/unknown> Analog in = 818 Input = 0
PIN: 2.00 SERVO0_PIN Input = 1
PIN: 2.01 X_ENABLE_PIN protected
PIN: 2.02 X_STEP_PIN protected
PIN: 2.03 FAN_PIN protected
PIN: 2.04 FAN1_PIN protected
PIN: 2.05 HEATER_BED_PIN protected
. SPINDLE_LASER_PWM_PIN protected
PIN: 2.06 X_DIR_PIN protected
PIN: 2.07 HEATER_0_PIN protected
PIN: 2.08 Y_ENABLE_PIN protected
PIN: 2.09 <unused/unknown> Input = 0
PIN: 2.10 <unused/unknown> Input = 1
PIN: 2.11 Z_DIR_PIN protected
PIN: 2.12 E0_ENABLE_PIN protected
PIN: 2.13 E0_STEP_PIN protected
PIN: 3.25 BTN_EN2 Input = 1
PIN: 3.26 BTN_EN1 Input = 1
PIN: 4.28 <unused/unknown> Input = 0
PIN: 4.29 <unused/unknown> Input = 1

@richardklingler
Copy link
Author

Interesting is that M504 changes the contrast value which gets returned by M250:

M250
LCD Contrast: 210
ok
M504
echo:EEPROM OK
ok
M250
LCD Contrast: 255
ok

@github-actions
Copy link

github-actions bot commented Sep 4, 2020

This issue is stale because it has been open 30 days with no activity. Remove stale label / comment or this will be closed in 5 days.

@richardklingler
Copy link
Author

So no comment on this?

@ellensp
Copy link
Contributor

ellensp commented Sep 23, 2020

Your configs updated to current bugfix for testing.
Configuration.zip

@ellensp
Copy link
Contributor

ellensp commented Sep 23, 2020

Current bugfix this still happens

M250
LCD Contrast: 195
ok
M504
echo:EEPROM OK
ok
M250
LCD Contrast: 255
ok

@ellensp
Copy link
Contributor

ellensp commented Sep 23, 2020

Found it... preparing PR

@ellensp
Copy link
Contributor

ellensp commented Sep 23, 2020

If you take a look at the above PR it fixes the contrast corruption for the "M250 M504 M250" test.
It should also fix your LCD issue.
Please test and confirm.
Its only a tiny 5 line change and should be easy to apply to your older version of marlin.

@ellensp
Copy link
Contributor

ellensp commented Sep 23, 2020

Is now part of marlin.

@ellensp ellensp closed this as completed Sep 23, 2020
@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 Nov 24, 2020
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

5 participants