Simple PWM

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

cross mob
Anonymous
Not applicable

Guys,

   

 

   

Anyone know how to create a pulse for PWM, on a simple way ?

   

thanks

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

In the parameters window of PWM8 user module, set the "compare out" as Row0_Output0. Then, click on LUT on that row and click on the buffer which connects to GlobalOutEven4 (GOE 4). Then click on globalOutEven4 line and select the "pin" as P0[4].

   

Please see attached PDF file for example. 

   

 

   

-Rajiv Badiger 

View solution in original post

0 Likes
84 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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.

0 Likes
Anonymous
Not applicable

 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. 

0 Likes
Anonymous
Not applicable

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...

0 Likes
Anonymous
Not applicable

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 

   

   

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

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.

   

 

   

Bob

0 Likes