External clock for a timer

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ThBa_1159851
Level 3
Level 3
First like received First like given

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 Solution
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

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

View solution in original post

0 Likes
6 Replies
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

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.

0 Likes
ThBa_1159851
Level 3
Level 3
First like received First like given

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
 

0 Likes
lock attach
Attachments are accessible only for community members.
ThBa_1159851
Level 3
Level 3
First like received First like given

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

   

 

   

0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

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

0 Likes
Anonymous
Not applicable

Where is this "trim with" option? I'm having the same problem as the OP except I want to use either the WCO (32kHz) or ECO (24MHz) to drive my counter. I need my system to run at 48 MHz though and I don't see a way to derive 48 MHz from my ECO.

0 Likes

Can you elaborate on option number 3? How do I do this?

0 Likes