Announcements

Curious on how you can apply PSoC™ 6 to Smart Home Appliances? Register for the ASEAN Smart Home Appliance Webinar here to find out how.

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

PSoC™ 6 Forum Discussions

aliissa02
Level 3
5 likes given 25 replies posted 50 sign-ins
Level 3

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
Rakesh_Patrudu
Moderator
Moderator 50 sign-ins 5 solutions authored 10 replies posted
Moderator

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
Len_CONSULTRON
Level 9
1000 replies posted 750 replies posted 500 likes received
Level 9

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 3
5 likes given 25 replies posted 50 sign-ins
Level 3

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
Len_CONSULTRON
Level 9
1000 replies posted 750 replies posted 500 likes received
Level 9

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 3
5 likes given 25 replies posted 50 sign-ins
Level 3

It is still not working!

0 Likes
Rakesh_Patrudu
Moderator
Moderator 50 sign-ins 5 solutions authored 10 replies posted
Moderator

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 3
5 likes given 25 replies posted 50 sign-ins
Level 3

Its finally working. Thanks a lot!

0 Likes