PSoC 5LP and PWM block

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

cross mob
Anonymous
Not applicable

Hi,

   

I am using a PWM block for my project. Using the configuration tool, I have set my compare value parameter as Greater. Is there any line of code using which I change this parameter to any of the other values.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Oops. I am extremely sorry for overlooking something as obvious as that. It was a mistake from my part. But thanks a lot for helping to point out my error.

   

I have posted another query on IDAC8. But I haven't received any responses to it yet, Would you be kind enough to have a look at it?

   

 

   

***************************Another Issue*********************

   

I could get the function as a suggestion in the intellisense. But now I am confused as to what I should give as parameter. I tried passing the parameter 'PWM__1_PWM__LESS_THAN' similar to 'PWM__B_PWM__LESS_THAN' as shown in the datasheet. The only change I made is I renamed PWM__B to PWM__1. Is it right?

   

Please help me rectify my mistake. I have attached the project.

   

************************************Issue Solved***************************************

   

On further reading reading, I was able to find the solution to my query. Thanks for providing me with the support.

View solution in original post

0 Likes
7 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum!

   

Look into PWM datasheet for PWM_SetCompareMode() API.

   

 

   

Happy coding

   

Bob

0 Likes
Anonymous
Not applicable

Hi Bob,

   

Thank you for the reply.

   

We already tried that function. But we are getting an error. Please have a look at the screenshots.

   

 

   

   

   

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

In your call to PSFB_PWM_SetCompareMode you did not specify a parameter. Please look into the PWM datasheet, it is just a mouseclick to open it.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi Bob,

   

I did look into the PWM datasheet before I posted this query here. When I start typing the name of the PWM block, the intellisense shows a list of all the functions associated with the PWM block. Except for the function to change the compare mode. And this error is displayed not because we didn't specify the parameter, but because this function isn't available with the PWM block. I can show you the screenshot of all the PWM functions suggested by the intellisense if you wish to see it.

   

I did check out the basics of PWM from the datasheet before I decided to seek help from the forum. Please advise.

0 Likes

Screenshots will not reveal all information.

   

Can you please post your complete project, 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.

   

**** Just found it: ****

   

You did not set the compare mode to "Firmware control" and initially set to "Greater" in software.

   

 

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Oops. I am extremely sorry for overlooking something as obvious as that. It was a mistake from my part. But thanks a lot for helping to point out my error.

   

I have posted another query on IDAC8. But I haven't received any responses to it yet, Would you be kind enough to have a look at it?

   

 

   

***************************Another Issue*********************

   

I could get the function as a suggestion in the intellisense. But now I am confused as to what I should give as parameter. I tried passing the parameter 'PWM__1_PWM__LESS_THAN' similar to 'PWM__B_PWM__LESS_THAN' as shown in the datasheet. The only change I made is I renamed PWM__B to PWM__1. Is it right?

   

Please help me rectify my mistake. I have attached the project.

   

************************************Issue Solved***************************************

   

On further reading reading, I was able to find the solution to my query. Thanks for providing me with the support.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The question was for the compare mode and not for the compare value. (greater, less than...).

   

 

   

Bob

0 Likes