Skip to content

Add alternate clock configurations for STM32#849

Open
garethky wants to merge 2 commits intoKalicoCrew:mainfrom
garethky:pr-alps-clock-config
Open

Add alternate clock configurations for STM32#849
garethky wants to merge 2 commits intoKalicoCrew:mainfrom
garethky:pr-alps-clock-config

Conversation

@garethky
Copy link
Contributor

@garethky garethky commented Mar 1, 2026

On the Mellow ALPS ADS131M02 board they used PA3 as the clock input pin to the ADC. In the existing chip config this pin is assigned to the same clock as klipper's main timer. This causes a conflict when trying to use the new [static_pwm_clock] feature to set up that pin to cycle at 8Mhz.

This PR introduces a new feature that can try multiple pins definitions in the config until it finds one that can be programmed successfully without a conflict. This means that the alternate timers for each pin can be added to the existing config. I add one such config for the ALPS board for PA3 that uses its alternate timer.

Checklist

  • pr title makes sense
  • added a test case if possible
  • if new feature, added to the readme
  • ci is happy and green

garethky and others added 2 commits February 28, 2026 16:17
The Mellow ALPS board needs PA3 to emit an 8Mhz signal to drive the ADS131M02's clock input. Unfortunatly this conflicts with klipper's primary timer, TIM2. This change switches to an alternate timer to allow this pin to emit a clock signal without the conflict.
AI fix?
Each pin has alternate timers. If the primary timer is being used or is already configured with a different time base by another pin, the alternate timer can be used.
@garethky garethky marked this pull request as ready for review March 19, 2026 22:04
@garethky
Copy link
Contributor Author

I'm doing all my ADS131M02 testing with the ALPS board that requires this to work. So its been tested to work with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant