3 Replies Latest reply on May 5, 2015 10:59 AM by DaKn_263916

    Swap PWM period


      I'm trying to do the layout in which the LED will glow with 2 different frequencies.
      I am using  function PWM_SetPeriodSwap () but it has no effect.

      How to turn PWM perio and period_buf?

        • 1. Re: Swap PWM period

          You have to check off the swap capability and enter the swap values.










          Note you can do the switch in HW by enabling the switch input and feeding


          it with a switch signal.




          Regards, Dana

          • 2. Re: Swap PWM period

            I want to use the API and by  software modify the parameters.




                CyGlobalIntEnable;  /* Uncomment this line to enable global interrupts. */

                    if(counter ==5)


            Why is this simple code does not work?

            • 3. Re: Swap PWM period

              Two questions -




              1) Did you check the properties to allow the swap capability ?




              2) Can you set a breakpoint and hit it on the swap instruction ?


              Eg. are you getting into the if statement test on counter ?




              3) Where do you reset counter variable after doing swap, otherwise


              you will keep repeating the swap commands ?




              You also have to have the compare checked.












              Regards, Dana.