4 Replies Latest reply on Feb 13, 2017 4:05 AM by vsrs

    External clock for a timer

    thomas.baehler

      I want connect an external clock (16 MHz) to a TCPWM for better accuracy. But I can't get it right.

         

      I connected the external clock to Pin [0.6] and mapped it in the "configure system clock" - window to EXTCLK.
      In the same window I routed the EXTCLK to "Routed2" and was then able to configure the clock-component in the TopDesign to the existing clock "Routed2".

         

      I get the error:

         
      Pin guidance unavailable: Invalid connection for clock input "\IVC_S1_Timer:cy_m0s8_tcpwm_1\:clock"  driven from "ClockBlock:dsi_in_1". The component requires a clock from the clock block.
         

      I tried also another pin and configured and routed it as "DigitalSignal" with the same result.

         

      Is there somewhere a tutorial on how to use an external clock with PSoC 4?
      What is a "clock from the clock block"?

         

      Thanks
      Thomas

        • 1. Re: External clock for a timer
          user_242978793

          A clock block  is a  clock component . This Component  can be found  in the components on the right side of the Psoc Creator window when you are in the top design.

          • 2. Re: External clock for a timer
            thomas.baehler

            Thanks for your reply.
            The TCPWM is driven by a clock component. The clock component is configured to feed the external clock.
            And the confusing thing is, that the error says, the TCPWM is driven by "ClockBlock:dsi_in_1" but requires a clock from the clock block?

               

            Thomas
             

            • 3. Re: External clock for a timer
              thomas.baehler

              Here's an example where I tried to connect an external clock to a TCPWM

                 

               

                 

              • 4. Re: External clock for a timer
                vsrs

                Hi Thomas,

                It will not be possible to use external clock directly to that fixed function block until it is not kept as device clock. I can suggest you 3 ways to avoid this problem,

                1. Use the UDB implementation of the the PWM. In that case you any of the GPIO as the input to the component. The external clock can be given through that pin. You may have to the the firmware code with correct API's.

                   

                2. Use the external clock as input to the whole system. If you don't want a lower(16MHz) clock to run the system, use a 48 MHz external source,finally in the clock component you can select HFCLK and divider value to get the frequency you require.

                   

                3. Another low cost solution is to use WCO. You can connect it externally(32.768kHz) and in the IMO you choose "Trim with" option to be WCO. You can see the accuracy changing from 2% to 0.2%.

                I hope this answer helps.

                Best Regards,
                VSRS