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

Adjust GTR PeripheralPins to avoid timer conflicts #19183

Merged

Conversation

sjasonsmith
Copy link
Contributor

Description

The GTR PeripheralPins.c and variant.h files were largely copied from the SKR Pro.

The pin assignments for fans and heaters differs significantly between these two boards, especially when considering the expansion board for the GTR.

This change allocates pins for all heaters and fans supported by this board, and consolidates them onto as few timers as possible. Along with this, the TONE timer was adjusted to avoid conflicts in Timer2 with heater pins.

Benefits

Allows use of all fan and heater pins for PWM, without causing timer conflicts. In addition two pins on the ESP header and the Servo output pin are enabled for hardware PWM.

All other pins are disabled. If people complain about pins losing PWM capabilities we may have to revisit this again.

Configurations

This configuration previously caused problems because the HEATER1 pin is specified as the Controller Fan pin, and that collided with the timer used for BLTouch control. This prevented the BLTouch from responding to commands.
Marlin.zip

Related Issues

No issue was created. This was discovered through discussion with @AdamV3D on Discord.

@sjasonsmith sjasonsmith added the Needs: Testing Testing is needed for this change label Aug 29, 2020
@sjasonsmith
Copy link
Contributor Author

I tested the following pins on my bench. I have not tested beyond this.

  • BLTouch Functionality
  • SPEAKER functionality (RepRapDiscount Full Graphics Display)
  • CONTROLLER_FAN when mapped to Heater1
  • FAN1-FAN6

I do not have this board in a printer. It would be great if @AdamV3D or other GTR users could try this and report back their results. Even if you were not already having PWM issues, I would like greater confidence that I am not breaking existing users.

@sjasonsmith sjasonsmith changed the base branch from 2.0.x to bugfix-2.0.x August 29, 2020 00:48
@thisiskeithb
Copy link
Member

I posted this in the BigTreeTech GTR group as well, so hopefully we can get this tested on real hardware configs.

@AdamV3D
Copy link

AdamV3D commented Aug 29, 2020

I've loaded up onto my completed machine. One observation, there is a light on the PCB turning on which didn't before, light blue, near where the wifi would go.

Everything seems to be working exactly as expected. Sadly my hemera gear just cracked as I was loading filament so that's going to put a bit of a delay on more testing. Hopefully I can get another shipped soon.

@sjasonsmith
Copy link
Contributor Author

One observation, there is a light on the PCB turning on which didn't before, light blue, near where the wifi would go.

@AdamV3D thanks for testing this! If the LED is D11 that is the light that tells you whether an SD card is inserted.

I don't see any other LEDs near the WIFI connector. If it is something else please post a picture.

@sjasonsmith sjasonsmith added PR: Improvement and removed Needs: Testing Testing is needed for this change labels Aug 31, 2020
@AdamV3D
Copy link

AdamV3D commented Sep 5, 2020

Got a replacement Hemera so done some more testing. Yes, light blue is definitely the micro sd card slot.

Having an issue with everything just stopping mid print. Seems like the serial interface is going to sleep or something, it just stops sending gcode so heaters stay on but all motion stops. Not sure if this is related but thought i'd mention it just in case it is.

Edit: little bit of research tells me that loss of communication is separate issue and that's the only problem i'm having so thumbs up for the pins changes.

@thinkyhead thinkyhead merged commit ef1d154 into MarlinFirmware:bugfix-2.0.x Sep 7, 2020
davidveg added a commit to davidveg/Marlin that referenced this pull request Sep 9, 2020
* commit 'bc7720c0cd3917f44200c0b78e1b635e4c7b6797': (483 commits)
  Minor HAL cleanup
  [cron] Bump distribution date (2020-09-09)
  Update HAL/STM32 platform to 8.0 (MarlinFirmware#18496)
  Make M600 heat up the nozzle. Reset runout on fail. (MarlinFirmware#19298)
  [cron] Bump distribution date (2020-09-08)
  TFT is neither "graphical" nor "character" (MarlinFirmware#19297)
  Sanity-check BABYSTEP_DISPLAY_TOTAL with ColorUI (MarlinFirmware#19284)
  Fix M166 Gradient Mix for DELTA (MarlinFirmware#19285)
  Separate Neopixel followup (MarlinFirmware#19287)
  Clean up LCD conditionals, DWIN
  Whitespace cleanup
  Adjust GTR PeripheralPins to avoid timer conflicts (MarlinFirmware#19183)
  STM32F1 EP with USB_COMPOSITE (MarlinFirmware#19281)
  Menu items for Separate NeoPixel (MarlinFirmware#19280)
  [cron] Bump distribution date (2020-09-07)
  Clarify disabling StallGuard for axes (MarlinFirmware#19263)
  Touch UI long filenames fixes (MarlinFirmware#19262)
  Fix Ender 3 V2 (DWIN) buffer overrun (MarlinFirmware#19268)
  Fix STM32F1 SPI device init, MKS_LCD12864 (MarlinFirmware#19271)
  Emergency Parser for STM32F1 (MarlinFirmware#19279)
  ...

# Conflicts:
#	.github/issue_template.md
#	Marlin/Configuration.h
#	Marlin/Configuration_adv.h
#	README.md
davidveg added a commit to davidveg/Marlin that referenced this pull request Sep 9, 2020
* commit 'bc7720c0cd3917f44200c0b78e1b635e4c7b6797': (483 commits)
  Minor HAL cleanup
  [cron] Bump distribution date (2020-09-09)
  Update HAL/STM32 platform to 8.0 (MarlinFirmware#18496)
  Make M600 heat up the nozzle. Reset runout on fail. (MarlinFirmware#19298)
  [cron] Bump distribution date (2020-09-08)
  TFT is neither "graphical" nor "character" (MarlinFirmware#19297)
  Sanity-check BABYSTEP_DISPLAY_TOTAL with ColorUI (MarlinFirmware#19284)
  Fix M166 Gradient Mix for DELTA (MarlinFirmware#19285)
  Separate Neopixel followup (MarlinFirmware#19287)
  Clean up LCD conditionals, DWIN
  Whitespace cleanup
  Adjust GTR PeripheralPins to avoid timer conflicts (MarlinFirmware#19183)
  STM32F1 EP with USB_COMPOSITE (MarlinFirmware#19281)
  Menu items for Separate NeoPixel (MarlinFirmware#19280)
  [cron] Bump distribution date (2020-09-07)
  Clarify disabling StallGuard for axes (MarlinFirmware#19263)
  Touch UI long filenames fixes (MarlinFirmware#19262)
  Fix Ender 3 V2 (DWIN) buffer overrun (MarlinFirmware#19268)
  Fix STM32F1 SPI device init, MKS_LCD12864 (MarlinFirmware#19271)
  Emergency Parser for STM32F1 (MarlinFirmware#19279)
  ...

# Conflicts:
#	.github/issue_template.md
#	README.md
davidveg added a commit to davidveg/Marlin that referenced this pull request Sep 9, 2020
* 2.0.x: (483 commits)
  Minor HAL cleanup
  [cron] Bump distribution date (2020-09-09)
  Update HAL/STM32 platform to 8.0 (MarlinFirmware#18496)
  Make M600 heat up the nozzle. Reset runout on fail. (MarlinFirmware#19298)
  [cron] Bump distribution date (2020-09-08)
  TFT is neither "graphical" nor "character" (MarlinFirmware#19297)
  Sanity-check BABYSTEP_DISPLAY_TOTAL with ColorUI (MarlinFirmware#19284)
  Fix M166 Gradient Mix for DELTA (MarlinFirmware#19285)
  Separate Neopixel followup (MarlinFirmware#19287)
  Clean up LCD conditionals, DWIN
  Whitespace cleanup
  Adjust GTR PeripheralPins to avoid timer conflicts (MarlinFirmware#19183)
  STM32F1 EP with USB_COMPOSITE (MarlinFirmware#19281)
  Menu items for Separate NeoPixel (MarlinFirmware#19280)
  [cron] Bump distribution date (2020-09-07)
  Clarify disabling StallGuard for axes (MarlinFirmware#19263)
  Touch UI long filenames fixes (MarlinFirmware#19262)
  Fix Ender 3 V2 (DWIN) buffer overrun (MarlinFirmware#19268)
  Fix STM32F1 SPI device init, MKS_LCD12864 (MarlinFirmware#19271)
  Emergency Parser for STM32F1 (MarlinFirmware#19279)
  ...

# Conflicts:
#	Marlin/Configuration.h
#	platformio.ini
@sjasonsmith sjasonsmith deleted the PR/GTR_Pins_Timers branch November 23, 2020 09:34
vgadreau pushed a commit to vgadreau/Marlin that referenced this pull request Dec 9, 2020
kageurufu pushed a commit to CR30-Users/Marlin-CR30 that referenced this pull request Apr 30, 2021
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.

4 participants