Page 1 of 1
setting clock_ref in gr-bladeRF
Posted: Fri May 20, 2022 5:03 pm
Hi,
I'm using a bladerf 2.0 A9 unit. I've installed the gr-bladeRF source block, and I have it working. I've experimented with providing a 10 MHz external reference through the J95 connector. I notice that the gnuradio source block has an entry to specify the reference frequency, but nowhere to enable the ADF4002. The bladeRF-cli program has "set clock_ref enable", but not the source block. But I notice that when I turn on my external 10 MHz reference (a Bliley OCXO) the spectrum of a continuous tone really cleans up, losing its big phase noise sidebands. So is the blade automatically sensing the external reference? Or is there a need to include the clock_ref in the source block.
Thanks much!
Re: setting clock_ref in gr-bladeRF
Posted: Sun May 22, 2022 3:21 pm
I'll answer my own question: looking at the source for the gr-bladeRF source block, I see that in bladerf_common.cc we have
Code: Select all
if(dict.count("ref_clk"))
{
auto freq = boost::lexical_cast<int>(_get(dict,"ref_clk"));
if(freq)
{
init_refclk(freq);
}
else
...
So only if the frequency freq entered into the block is nonzero does init_refclk get called. In the init_refclk routine:
Code: Select all
...
status = bladerf_set_pll_enable(_dev.get(), true);
...
So it seems it is the block code enabling the ADF4002. The board isn't detecting the presence of the reference signal and then enabling the pll.
Re: setting clock_ref in gr-bladeRF
Posted: Wed Aug 27, 2025 1:59 am
by albertblack
[email protected] wrote: ↑Fri May 20, 2022 5:03 pm
Hi,
I'm using a bladerf 2.0 A9 unit. I've installed the gr-bladeRF source block, and I have it working. I've experimented with providing a 10 MHz external reference through the J95 connector. I notice that the gnuradio source block has an entry to specify the reference frequency, but nowhere to enable the ADF4002. The bladeRF-cli program has "set clock_ref enable", but not the source block. But I notice that when I turn on my external 10 MHz reference (a Bliley OCXO) the spectrum of a continuous tone really cleans up, losing its big phase noise sidebands. So is the blade automatically sensing the external reference? Or is there a need to include the clock_ref in the source block.
Thanks much!
It sounds like the bladeRF 2.0 is automatically detecting and locking to the external 10 MHz reference — especially since you're seeing reduced phase noise. While the GNURadio source block doesn’t expose a setting for clock_ref, the hardware likely enables the ADF4002 when it detects a valid signal. For reliability, you can run set clock_ref external via bladeRF-cli before starting your flowgraph. That should ensure proper locking.
Re: setting clock_ref in gr-bladeRF
Posted: Wed Aug 27, 2025 6:48 pm
by worldguesser
Thanks for the clarification on clock_ref—setting it correctly really helped improve stability in my setup. Appreciate the support from the community!
Stickman Hook