[En-Nut-Discussion] RE: PWM

Raul Valle rvl180 at hotmail.com
Sun Aug 6 21:47:56 CEST 2006


Curtis thanks for  the reply:

The thing is the channels available are not enough, there are more servos to control......they are going to be controlled by a command sent to them from the computer .... any idea in how to achieve to control all the servos not affecting program please let me know... I appriciate the help./

---------------------------------------------------
Raul Valle wrote:
> hi to all:
> can someone give me an idea on how to make a servo function on ethernut1.3 .
> The one i did i dont know exactly why is not working . here is the code:
> pos++;
>        sbi(PORTE,2);         
>        for(i=0;i<pos;i++){
>         NutSleep(.02);
>        }
>    
>        cbi(PORTE,2);
>        for(b=0;i<(1500-pos);b++){    
>         NutSleep(.02);

Is there a particular reason you're avoiding using the hardware PWM?  They'd be 
much simpler, more accurate, and would take no CPU time once set up.

Of course, if they're all already in use, or you have to use a pin they can't 
control, I'll understand.

--
Curtis Maloney
cmaloney at cardgate.net




More information about the En-Nut-Discussion mailing list