1 2 3 4 5 6 Previous Next 84 Replies Latest reply on Feb 22, 2013 7:07 AM by userc_38527 Go to original post
      • 75. Re: Simple PWM

        I started already,




        Don't worry too much with the comment, it's only a dummy project


        void GenerateCenterPosition( void ) {                /* Divide by eight function */
            PWM8_1_WritePulseWidth( 100 );                    /* set pulse width to generate a 50% duty cycle */

        • 76. Re: Simple PWM

          Sorry, I missed that.


          Did you try change the DCset() vlaue betwen 10 and 20? for ie 10 is the left, 15 is the middle, and 20 is the right positiom.

          • 77. Re: Simple PWM



            There's no response, servo is stall, just like video I have shown you guys

            • 78. Re: Simple PWM

              I tried to imitate the function :




              void rotate()
                   unsigned int i,count;                                 /* Delay10msTimes var */
                    unsigned char j;                                   /* LED var */
                           //rotate left every 45 degree begin
                                   for(i=0;i<50;i++)  // 10 equal to 5 degree





              but I can't see my LED blinks, anyone knows why ?



              • 79. Re: Simple PWM

                how can I do 90 and -90 degree ?



                • 80. Re: Simple PWM

                  The DC( ) sets duty cycle in percent, not angle. So you have to use datasheet of


                  servo to figure out what DC you need to get what angle. Nominally a servo runs


                  a PW of 1 - 2 mS in a 20 mS period, so




                  1 mS =~  - 90 =    5%    DC


                  1.5 mS =~   0 =    7.5% DC


                  2 mS =~ + 90 = 10%     DC




                  Are you still using Atmet UP to do this ?




                  Regards, Dana.

                  • 81. Re: Simple PWM

                     Do you have any tools to meansure the output of PSoC? 


                    Hoiw about 


                    while (1){ 


                    turn on P0_0;


                    delay 5 seconds;


                    turn off P0_0;


                    delay 5 seconds,



                    If you have a CRO, use the CRO to check what is the output level of P0_0.


                    If no CRO, then use a mutlimeter to see if the output does change. This should confirm if the output of PSoC is not dead and in the right drive mode. 

                    • 82. Re: Simple PWM

                      unfortunately I don't have osciloscope to see what happened here...


                      yes, I'm still using atmel, and still work well for me,


                      try to migrate to cypress but no luck until now...

                      • 83. Re: Simple PWM

                        HELLO I am new here i have a problem with my project


                        i have 5 servo (type  9g)  i want to control them by ADC in my Psoc 5lp card  (0 TO 180 ° )


                        the secound part of my project it to use UART data to controle another card Psoc 5lp (to controle a hand)


                        thnks and sorry for my English 



                        • 84. Re: Simple PWM

                          Welcome in the forum.


                          Not a good idea to hijack a 4 year old thread in the wrong forum. Better re-post in PSoC5 forum as a new thread. This will ensure that the right "Gurus" see your question.


                          I can assure you that your PSoC5 is able to control those servos.





                          1 2 3 4 5 6 Previous Next