2 Replies Latest reply on Oct 20, 2017 6:24 AM by tycoc_2489271

    change clock source in operation

      Is this possible? We are hoping to change between PLL1 which is ECO trimmed to Direct_Sel or something else that can be sourced from IMO and USB trimmed. The reason why is that when power is disconnected from the host Laptop, the communication timing appears to change a little bit, and when the clock is trimmed by the host it seems to handle it better. I am hoping to change the clock source whenever VBus is detected but return to normal when it is disconnected to keep good timing on a CAN bus also connected to the micro.

        • 1. Re: change clock source in operation



          You can detect the USB connection from the VBUS detection. It is possible to disable the USB lock using firmware. CySysClkImoDisableUsbLock() disables USB lock.




          1 of 1 people found this helpful
          • 2. Re: change clock source in operation

            Just went and read the function description. It sounds like that function modifies the IMO clock trimming, is that right? I need to swap between IMO and PLL1 for the HFCLk, luckily though I scrolled down just a little bit after reading that function you suggested and found another function that I think does what I want to do:



            void CySysClkWriteHfclkDirect(uint32 clkSelect)


            * Selects the direct source for the HFCLK.

            * \param clkSelect One of the available HFCLK direct sources.

            * CY_SYS_CLK_HFCLK_IMO     IMO.

            * CY_SYS_CLK_HFCLK_EXTCLK  External clock pin.

            * CY_SYS_CLK_HFCLK_ECO     External crystal oscillator. Applicable for

            *                          PSoC 4100 BLE / PSoC 4200 BLE / PSoC 4200L.

            * CY_SYS_CLK_HFCLK_PLL0    PLL#0. Applicable for PSoC 4200L.

            * CY_SYS_CLK_HFCLK_PLL1    PLL#1. Applicable for PSoC 4200L.