Skip to content

Fix management of CLKOUT/MCU_CLK synth sharing on H1R9#1780

Open
martinling wants to merge 1 commit into
greatscottgadgets:mainfrom
martinling:r9-mcu-clk
Open

Fix management of CLKOUT/MCU_CLK synth sharing on H1R9#1780
martinling wants to merge 1 commit into
greatscottgadgets:mainfrom
martinling:r9-mcu-clk

Conversation

@martinling

@martinling martinling commented Jun 12, 2026

Copy link
Copy Markdown
Member

On HackRF One r9, the CLKOUT and MCU_CLK clocks use the same Si5351A multisynth and output (CLK2).

Enabling and disabling the two outputs individually is achieved by downstream logic driven by the CLKOUT_EN and MCU_CLK_EN signals.

The work in #1751 to add control of the MCU clock still had some bugs on r9:

  1. Calling si5351c_mcu_clkin_enable(drv, true) called si5351c_clkout_enable in turn to enable the shared clock, but never set the MCU_CLK_EN GPIO to gate that clock further downstream, so the MCU did not actually receive a clock.
  2. Calling si5351c_mcu_clkin_enable(drv, true) had the side effect of turning on the CLKOUT_EN signal despite CLKOUT not being requested.
  3. If both CLKOUT and MCU_CLK were enabled, calling either si5351c_clkout_enable(drv, false) or si5351c_mcu_clkin_enable(drv, false) would break the other clock by disabling the shared multisynth.

Fix this by making both functions check the state of the other clock output, and control the multisynth and GPIOs accordingly.

@martinling martinling requested review from mndza and mossmann June 12, 2026 15:17
@martinling martinling added this to the harmony milestone Jun 12, 2026
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