cancel
Showing results forĀ
Did you mean:Ā

# PSoC 5, 3 & 1 MCU

New Contributor II

## Problem to generate Clock Frequncy ?

How Can i Generate 7Mhz Clock Frequncy to the timer or pwm in a psoc 5LP?

i Was taking the direct clock to the output pin but in a oscilloscope the output are not perfect or good ?

How Can i resolve this problem?

1 Solution
Honored Contributor II

## Re: Problem to generate Clock Frequncy ?

In the Design Wide Resources->Clocks, please set the PLL clock to multiples of 7 MHz (as shown on the picture), for example 49MHz.

Now to get 7 MHz clock, please set the clock divider to 7 (or simply set it to 7 MHz). Now the output will be 7 MHz. This will produce fixed 7 MHz clock.

/odissey1

25 Replies
Moderator

## Re: Problem to generate Clock Frequncy ?

When the clock is given directly to the output pin, you should be seeing the exact clock frequency you have set as output. In case you have set tolerance in the clock block, you should see the output in the range as shown below:

For 7Mhz the output might range will be between 6.65MHz - 7.35MHz. If you unchecked the tolerance, you should see a more accurate 7MHz.

From the looks of it, seems like you might have changed some settings in the clocks or the divider values. So, it would be great if you could share your project here so that I can have a look. Also, let me know what frequency you are observing, a screenshot of the oscilloscope output would be great.

Regards,

Dheeraj D Kamath

Honored Contributor II

## Re: Problem to generate Clock Frequncy ?

What does it mean ''not perfect' - frequency is off?

The clock divider is an integer number, so to get 7MHz, the Master clock must be any of 77MHz, 70MHz, 63MHz, 56MHz, 49MHz, ... In the clocks section set PLL to one of those values.

/odissey1

New Contributor II

## Re: Problem to generate Clock Frequncy ?

i was trying everything in a clock.

whenever i was put the 7 mhz clock on to the output pin i was just give it the 6MHz or 8MHz frequency but i was never take it the 7mhz frequency .

i was also tryed to the timer and pwm but same problem is occur .

actually i want to  generate the different different frequency  on a single output pin.

below i was attached the output of the CRO to the 7mhz clock.@Problem to generate Clock Frequncy ?

Honored Contributor II

## Re: Problem to generate Clock Frequncy ?

In the Design Wide Resources->Clocks, please set the PLL clock to multiples of 7 MHz (as shown on the picture), for example 49MHz.

Now to get 7 MHz clock, please set the clock divider to 7 (or simply set it to 7 MHz). Now the output will be 7 MHz. This will produce fixed 7 MHz clock.

/odissey1

New Contributor II

## Re: Problem to generate Clock Frequncy ?

thank you so much for helping me.

Honored Contributor II

## Re: Problem to generate Clock Frequncy ?

It is not possible to get finely tunable frequency around 7 MHz using standard Timer or PWM, due to high granularity of the divider. For example, with MASTER_CLK=70 MHz, and dividers 9, 10 or 11 the output frequency will be accordingly:  7.777 MHz, 7.0 MHz or 6.363 MHz.

One way to get fine-tuned output is to utilize DDS approach. You can try using either DDS24 or DDS32 components for that:

/odissey1

New Contributor II

## Re: Problem to generate Clock Frequncy ?

ok. i will try this.

and by the way thanks.

New Contributor II

## Re: Problem to generate Clock Frequncy ?

Thanks Guys for Helping me

it means a lot.

now i am generated the 7 mhz frequency but this shape is not good .

i am wanted the square wave 7mhz output.

best regards

sagar

Expert II

## Re: Problem to generate Clock Frequncy ?

The output is usually a square wave. Check the schematic of the board you are using whether there is a cap on the pin for buffering. Looks a bit as if so. Which Board are you using and which port your output is sent to? How is the pin configured??

Can you please post your complete project or a shortened version that shows the error so that we all can have a look at all of your settings. To do so, use

Creator->File->Create Workspace Bundle (minimal)

and attach the resulting file.

Bob

New Contributor II

## Re: Problem to generate Clock Frequncy ?

HELLO i am configuring the output pin as a pull up and and this pin is directly connected to clock this clock is 49mhz master clock and divider by 7 i am taking the 7 mhz output but not the sharp value or graph is not an squre wave.

Anonymous
Not applicable

## Re: Problem to generate Clock Frequncy ?

Hi,

You need to set the pin drive mode to "strong".

-Rajiv

New Contributor II

## Re: Problem to generate Clock Frequncy ?

i was already done this.nothing change it will happen.and i am using lp05 kit.

New Contributor II

## Re: Problem to generate Clock Frequncy ?

could you indicate the used pin of your PSoC5LP?

could you indicate the development kit used? CY8CKIT-050 / CY8CKIT-059 / other

With the cypress doc (schema, ...) we can be sure you haven't external capacitor or resistor for this pin.

Robin.

New Contributor II

## Re: Problem to generate Clock Frequncy ?

Hello,

i am using the CY8CKIT-050 and port0pin0 i.e.P0[0].

Best regards

seggi.

New Contributor II

## Re: Problem to generate Clock Frequncy ?

hi,

This pin seems a correct one (without external component). cf schema in attachment

Do you have the same issue for an other pin? => in this case may be it's your probe.

yours,

Robin.

New Contributor II

## Re: Problem to generate Clock Frequncy ?

Yes , i Has Same Problem On other pin also.

Best Regards,

Sagar

Honored Contributor II

## Re: Problem to generate Clock Frequncy ?

Er. Sagarkayash,

50 ns risetime, observed on the picture provided is typical for poor oscilloscope probes (like ones that could be found on EBay for \$10/pair. (BTW do you have 100MHz or 60MHz Tek scope?).

To see better pulse shape you need better probe. The easy way is to make your own probe. For 1MOhm input and simple 1.5' lengh RG176 cable I see approx. 10ns risetime. With 50 OHm loading resistor and 4.95k serial resistor at the tip I get 1/20 probe with 3ns risetime. See e.g:

https://www.edn.com/design/test-and-measurement/4458644/Build-your-own-oscilloscope-probes-for-power...

/odissey1

New Contributor II

## Re: Problem to generate Clock Frequncy ?

Hello ,

i am  already Checking On A TEK 100Mhz Scope .

so i think not a problem of scope .

Expert II

## Re: Problem to generate Clock Frequncy ?

Using a different probe and different cable?

Bob

New Contributor II

## Re: Problem to generate Clock Frequncy ?

Hello,

Yes i was already checking to the different probe and cable too.

Best regards

sagar

Anonymous
Not applicable

## Re: Problem to generate Clock Frequncy ?

Sagar,

In the scope screenshot, voltage per division is being shown as 20V and the signal peak touches 2.5 divisions. This indicates probe is in 1x mode and in the oscilloscope probe settings, it is set as 10x.

Can you set the probe in 10x and take the screenshot?

-Rajiv

New Contributor II

## Re: Problem to generate Clock Frequncy ?

Now you can see it the Screenshot of 10x probe Cable.

Best Regards

sagar.

Moderator

## Re: Problem to generate Clock Frequncy ?

Did you try adjusting the compensating capacitor on the probe? Please provide the details of your oscilloscope and the probe you are using.

Regards,

Dheeraj

Anonymous
Not applicable