Generating frequency

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

cross mob
lock attach
Attachments are accessible only for community members.
aliissa02
Level 4
Level 4
100 sign-ins 50 replies posted 5 likes given

Hello,

I am trying to generate an output frequency of 6 MHz using a PSOC 6 prototyping board but every time I measure the pin using an oscilloscope its not giving me the required frequency. I have attached the project. Can anyone help please?

Thank you

 

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Rakesh_Patrudu
Moderator
Moderator
Moderator
25 solutions authored 5 likes given 50 replies posted

Hi @aliissa02 ,


We have recreated the project on the same device that you are using i.e.; CYBLE-416045-02. We can obtain a 6Mhz output frequency. Please review the project file that I have included below.

Rakesh_Patrudu_0-1660807778725.png


Best Regards,

Rakesh

 

View solution in original post

0 Likes
6 Replies
lock attach
Attachments are accessible only for community members.
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

aliissa02,

You had some issues with your original code in main().

I made some simple changes with comments.

It now works.

 

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
aliissa02
Level 4
Level 4
100 sign-ins 50 replies posted 5 likes given

Hello,

 

Thanks for your help. I tried measuring the output pin and its not giving 6 MHz. Its only giving 1.5 KHz.

Thank you

0 Likes

aliissa02,

You are correct.  The output at pin P9.5 is 1.526KHz.

This is because YOU set the PWM Period0 to 4096u

Len_CONSULTRON_0-1660230178757.png

With an input clock of 6250KHz and the Period0 of 4096, your output is 6250KHz/4096 = 1.5258789KHz.

Simple math.

If you want an output of 6.25MHz I recommend the following changes:

Len_CONSULTRON_2-1660230536796.png

 

Len_CONSULTRON_1-1660230496141.png

 

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
aliissa02
Level 4
Level 4
100 sign-ins 50 replies posted 5 likes given

It is still not working!

0 Likes
lock attach
Attachments are accessible only for community members.
Rakesh_Patrudu
Moderator
Moderator
Moderator
25 solutions authored 5 likes given 50 replies posted

Hi @aliissa02 ,


We have recreated the project on the same device that you are using i.e.; CYBLE-416045-02. We can obtain a 6Mhz output frequency. Please review the project file that I have included below.

Rakesh_Patrudu_0-1660807778725.png


Best Regards,

Rakesh

 

0 Likes
aliissa02
Level 4
Level 4
100 sign-ins 50 replies posted 5 likes given

Its finally working. Thanks a lot!

0 Likes