[En-Nut-Discussion] ethernut--pwm

Curtis Maloney cmaloney at cardgate.net
Fri Aug 4 07:38:41 CEST 2006


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