From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Hardware Developers Community - NI sbRIO & SOM

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching clocks for SCTL

Greetings,

 

I'm looking for a way to be able to run a SCTL with multiple clocks (one clock at a time of course). i.e. allow the user to select the clock of choice during or before code execution with some form switch. 

 

Our custom PCB has a 40MHz and 100MHz external clock going in the SOM and I want to be able to select a clock without recompiling or manually rerouting the PCB tracks.

 

I've tried the 'Select' and a case structure function with the clock references but that won't cut it due to dynamic refnums not being supported. (see picture)

 

Maybe someone has some suggestions that don't require adding dedicated PCB switches.

 

 

 

0 Kudos
Message 1 of 6
(4,338 Views)

The clock source for the SCTL will need to be constant at compile-time. However, there are some options you could try that might give you similar behavior to dynamically choosing the clock.

 

  1. Compile two different bitfiles, one with each clocking option, and dynamically choose which to load in your host VI.
  2. Create 2 SCTLs in your FPGA code that run simultaneously. Include logic in your code that allows you to choose which loop you care about and are getting data from.

Will

National Instruments

Message 2 of 6
(4,319 Views)

Hi Will,

 

I was hoping I can avoid these options especially copying code as it is not great for maintainability.

Does this mean that doing it in the FPGA it's impossible?

 

I've spoken to some colleagues that used to do similar practices on VHDL with clock multiplexing.   

 

0 Kudos
Message 3 of 6
(4,309 Views)

Could you compile at 200 Mhz and then run when needed? Since 200 is evenly divided by the two? 

 

I looked at clock multiplexing and this doesn't seem trivial. It could be worth reviewing for feasibility, I've never done it but it seems very interesting. 

 


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 4 of 6
(4,287 Views)

Hi Terry, 

 

The code does compile for a 20 to 200 MHz frequency range from an external clock. I see this a possible solution if I'm using an internal clock.

However, if I go with your suggestion then I'd have to replace the 100 and 40 MHz clocks with a single 200MHz one and do some re-routing, I'm not sure after that if I need to be aware of any possible timing issues that could arise. 

 

I've heard about BUFGMUX for clock selection in Xilinx chips, not sure if we have access to that.

0 Kudos
Message 5 of 6
(4,275 Views)

You won't be able to do clock selection via the BUFGMUX method directly in LabVIEW. However, this may be something you could implement yourself by modifying the CLIP.

0 Kudos
Message 6 of 6
(4,233 Views)