7 Replies Latest reply on Jul 4, 2016 10:34 AM by JoMe_264151

    PSoC 5LP and PWM block



      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.

        • 1. Re: PSoC 5LP and PWM block

          Welcome in the forum!


          Look into PWM datasheet for PWM_SetCompareMode() API.




          Happy coding



          • 2. Re: PSoC 5LP and PWM block

            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.






            • 3. Re: PSoC 5LP and PWM block

              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.





              • 4. Re: PSoC 5LP and PWM block

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





                • 5. Re: PSoC 5LP and PWM block

                  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.

                  • 6. Re: PSoC 5LP and PWM block

                    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.







                    • 7. Re: PSoC 5LP and PWM block

                      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.