nikhilsigma
Full Member level 2
- Joined
- Jun 19, 2010
- Messages
- 142
- Helped
- 17
- Reputation
- 34
- Reaction score
- 16
- Trophy points
- 1,298
- Location
- Delhi, India
- Activity points
- 2,584
Guy i am trying to make my servo RKI-1210 work, but it's NOT working......
i am sending control pulses at 50Hz i.e. a pulse every 20ms...
the pulse widths are as follows :
-90degrees : 1.5ms
normal position : 2ms
+90degrees : 2.4ms
i get these from others discussions on internet, and thus NOT sure that these are right or not !! :-(
here is the code i am using for ATmega32
#include <avr/io.h>
#define F_CPU 1000000UL // 1MHz
#include <util/delay.h>
int main(void)
{
DDRB=0xFF;
PORTB=0xFF;
int i,j,k;
while(1)
{
for(i=0; i<1000; i++) // for -90degrees, pulse of 1.5ms pulse
{
PORTB=0xFF;
_delay_us(1500);
PORTB=0;
_delay_us(18500);
}
for(j=0; j<1000; j++) // for normal position, 2ms pulse
{
PORTB=0xFF;
_delay_us(2000);
PORTB=0;
_delay_us(18000);
}
for(k=0; k<2000; k++) // for +90 degrees, 2.4ms pulse
{
PORTB=0xFF;
_delay_us(2400);
PORTB=0;
_delay_ms(17600);
}
}
}
and the motor has not moved even 1degree !! he he.... :-(
PLEASE HELP !!
Hardware connection :
RED Wire : 5V
Brown Wire : Ground
Orange wire : PORTB.4 of atmega32
PLEASE HELP !!
i am sending control pulses at 50Hz i.e. a pulse every 20ms...
the pulse widths are as follows :
-90degrees : 1.5ms
normal position : 2ms
+90degrees : 2.4ms
i get these from others discussions on internet, and thus NOT sure that these are right or not !! :-(
here is the code i am using for ATmega32
#include <avr/io.h>
#define F_CPU 1000000UL // 1MHz
#include <util/delay.h>
int main(void)
{
DDRB=0xFF;
PORTB=0xFF;
int i,j,k;
while(1)
{
for(i=0; i<1000; i++) // for -90degrees, pulse of 1.5ms pulse
{
PORTB=0xFF;
_delay_us(1500);
PORTB=0;
_delay_us(18500);
}
for(j=0; j<1000; j++) // for normal position, 2ms pulse
{
PORTB=0xFF;
_delay_us(2000);
PORTB=0;
_delay_us(18000);
}
for(k=0; k<2000; k++) // for +90 degrees, 2.4ms pulse
{
PORTB=0xFF;
_delay_us(2400);
PORTB=0;
_delay_ms(17600);
}
}
}
and the motor has not moved even 1degree !! he he.... :-(
PLEASE HELP !!
Hardware connection :
RED Wire : 5V
Brown Wire : Ground
Orange wire : PORTB.4 of atmega32
PLEASE HELP !!