cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Erka_3237036
New Contributor II

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?

0 Likes
1 Solution
odissey1
Honored Contributor II

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

PSoC5_Clock 7MHz_PLL 49MHz.png

PSoC5_Clock 7MHz.png

View solution in original post

0 Likes
25 Replies
DheerajK_81
Moderator
Moderator

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:

forum5.PNG

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.

Looking forward to your reply.

Regards,

Dheeraj D Kamath

0 Likes
odissey1
Honored Contributor II

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

0 Likes
Erka_3237036
New Contributor II

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.20180623_100005.jpg@Problem to generate Clock Frequncy ?

0 Likes
odissey1
Honored Contributor II

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

PSoC5_Clock 7MHz_PLL 49MHz.png

PSoC5_Clock 7MHz.png

View solution in original post

0 Likes
Erka_3237036
New Contributor II

thank you so much for helping me.

0 Likes
odissey1
Honored Contributor II

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:

DDS24: 24-bit DDS arbitrary frequency generator component

/odissey1

0 Likes
Erka_3237036
New Contributor II

ok. i will try this.

and by the way thanks.

0 Likes
Erka_3237036
New Contributor II

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

0 Likes
Bob_Marlowe
Expert II

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

0 Likes
Erka_3237036
New Contributor II

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.

0 Likes
Anonymous
Not applicable

Hi,

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

-Rajiv

0 Likes
Erka_3237036
New Contributor II

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

0 Likes
RoBO_1287886
New Contributor II

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.

0 Likes
Erka_3237036
New Contributor II

Hello,

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

Thanks For Answer.

Best regards

seggi.

0 Likes
RoBO_1287886
New Contributor II

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.

0 Likes
Erka_3237036
New Contributor II

Yes , i Has Same Problem On other pin also.

Best Regards,

Sagar

0 Likes
odissey1
Honored Contributor II

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

0 Likes
Erka_3237036
New Contributor II

Hello ,

i am  already Checking On A TEK 100Mhz Scope .

so i think not a problem of scope .

0 Likes
Bob_Marlowe
Expert II

Using a different probe and different cable?

Bob

0 Likes
Erka_3237036
New Contributor II

Hello,

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

Best regards

sagar

0 Likes
Anonymous
Not applicable

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

0 Likes
Erka_3237036
New Contributor II

IMG-20180702-WA0001.jpg

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

Best Regards

sagar.

0 Likes
DheerajK_81
Moderator
Moderator

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

0 Likes
Anonymous
Not applicable

It could also be a oscilloscope probe issue. Use the probe in 10x mode. You can also try adjusting the probe compensation.

-Rajiv

0 Likes
Erka_3237036
New Contributor II

i was also try this nothing change will be happen.

0 Likes