Confusion in PWM function call

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

cross mob
Mrinal
Level 4
Level 4
First solution authored 50 replies posted 25 replies posted

Hello

I have used PSoC 4 and 5 and the APIs are very clear.

I am trying to use  PWM in PSOC6 (instance name PWM_1) and the functions available for say changing compare values are:

PWM_1_SetCompare0()

Cy_TCPWM_PWM_SetCompare0()

Which one to use? What's the difference?

Also, the PDL reference does not mention PWM_1_Start(), but it's available in the dropdown list when typing in functions. Where can I find the list of all APIs.

I am beginning with PSOC-6 but have used PSOC-4 and 5 for a long time.

Please help.

Thank you

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

> PWM_1_SetCompare0()

> Cy_TCPWM_PWM_SetCompare0()

> Which one to use? What's the difference?

I think that the difference came from the fact that PSoC 6 is/are using PDL.

Cy_TCPWM_PWM_SetCompare0() is native expression of PDL.

 

Usage of PDL should be found in

C:\Program Files (x86)\Cypress\PDL\<version>\doc

For example

C:\Program Files (x86)\Cypress\PDL\3.1.3\doc

 

But for the compatibility with PSoC 4, PSoC 5LP,  expression(s) like

PWM_1_SetCompare0()

are also provided.

 

But from my experience, the compatibility functions don't seem to be complete

so often we have to use PDL style expression.

 

I wrote the following sample for the beginner, and it also includes the sample use of PWM

so I wonder if it can be some hint for you.

(I re-read my code, and found that I was using mostly the compatibility functions...)

https://community.cypress.com/t5/Code-Examples/MCU-Tester-a-Swiss-Army-Knife-for-PSoC-CY8CKIT-062-BL...

 

moto

 

View solution in original post

3 Replies
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

> PWM_1_SetCompare0()

> Cy_TCPWM_PWM_SetCompare0()

> Which one to use? What's the difference?

I think that the difference came from the fact that PSoC 6 is/are using PDL.

Cy_TCPWM_PWM_SetCompare0() is native expression of PDL.

 

Usage of PDL should be found in

C:\Program Files (x86)\Cypress\PDL\<version>\doc

For example

C:\Program Files (x86)\Cypress\PDL\3.1.3\doc

 

But for the compatibility with PSoC 4, PSoC 5LP,  expression(s) like

PWM_1_SetCompare0()

are also provided.

 

But from my experience, the compatibility functions don't seem to be complete

so often we have to use PDL style expression.

 

I wrote the following sample for the beginner, and it also includes the sample use of PWM

so I wonder if it can be some hint for you.

(I re-read my code, and found that I was using mostly the compatibility functions...)

https://community.cypress.com/t5/Code-Examples/MCU-Tester-a-Swiss-Army-Knife-for-PSoC-CY8CKIT-062-BL...

 

moto

 

Mrinal
Level 4
Level 4
First solution authored 50 replies posted 25 replies posted

Thank you for the reply.

Do you also have an idea as to which compatibility functions are supported? Any document that mentions the list of all the supported compatibility function will be helpful.

Thank you

0 Likes
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @Mrinal

Please check the <component_name>.h file to see the different component APIs that are available to you for a component. 

You can also refer to Using the PSoC Creator Component API section in PDL User Guide which explains the differences between the PDL APIs and the Component APIs.

Thanks and Regards,
Rakshith M B
0 Likes