1 Reply Latest reply on Oct 2, 2020 2:51 PM by LePo_1062026

    Change clk component parameters Realtime



      Using cyble-0222014 module, I want to change the frequency of the CLK component during program execution.

      I have a clk with a frequency of 1 kHz and when the Bluetooth is connected i want to change it to 510kHz.

      Because I want to use the blue LED blink during paring, and when its connected i want to be able to fade the blue LED w PWM.

      I have used all possible counter/timer on schematic, so i want to change the CLK instead, How?

        • 1. Re: Change clk component parameters Realtime



          You speak of your CLK component.  Depending on which clock component and the source frequency of it, the answer is yes.


          If you're using the clock component of which I'm thinking, then you can use CLK_SetFractionalDividerRegister() to switch frequencies to downstream components on-the-fly.

          * Function Name: CLK_SetFractionalDividerRegister
          * Summary:
          *  Modifies the clock divider and the fractional divider.
          * Parameters:
          *  clkDivider:  Divider register value (0-65535). This value is NOT the
          *    divider; the clock hardware divides by clkDivider plus one. For example,
          *    to divide the clock by 2, this parameter should be set to 1.
          *  fracDivider:  Fractional Divider register value (0-31).
          * Returns:
          *  None


          Can you share your TopDesign file with the forum?