[En-Nut-Discussion] ethernut--pwm
Michael Jones
Michael.e.Jones at web.de
Thu Aug 3 23:38:14 CEST 2006
Hi,
I think you have got a few problems to solve here. The first being that
NutSleep(...) does not take a float (well not that I am aware off) so that
.02 turns into 0. The second being that you can't use NutSleep(...) to
generate deterministic time slices as NutSleep(...) will pass control to
another thread and will only return when that thread (and/or others) yields
CPU time back to your thread by itself calling NutSleep(...) or similar
functions.
What exactly are you trying to implement?
Depending on the actually method you are using to control the servo there
are different solutions. Are you using an ADC? Then you might want to use an
ADC completion interrupt handler which then decides if and which direction
the motor is supposed to run.
Regards,
Michael
-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Raul Valle
Sent: Thursday, August 03, 2006 11:16 PM
To: en-nut-discussion at egnite.de
Subject: [En-Nut-Discussion] ethernut--pwm
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);
_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
More information about the En-Nut-Discussion
mailing list