I have spent a lot of time trying to figure this one out but just I can’t come up with something.
The problem is that I’m working on a robot arm (it uses 5 servos) and last week I had all the servos moving correctly, but when I tested it again last thursday it just wouldn’t do anything. Also, I’m testing the exact same code I had before but still no response, every now and then when I turn in the power supply for the servos and then execute the code, the servos would move, but that is very randomly. I have checked the connections from the microcontroller (ATmega16) to the servos, also I have checked the voltage and current supplied (5V and 6Amps respectively), and finally I have checked the pulse that I’m sending (which is the exact same as last week when it actually worked.
Im getting REALLY frustrated about this…any help will be greatly appreciated.
Also, the way I’m sending the pulses is something like this:
PORTD=0xFF; //Sets all PORTD high (just for testing purposes to see that all the pins were working)
delay_us(550); //Maintain the high status for the desired duty cycle
PORTD=0x00; //Clears all of PORTD
delay_us(19450); //Maintains the clear status for the remaining of the 20ms
I know this is not the best way to do it but I’m kind of short in time and this is a very straight forward way of doing it, and if it worked fine once, what could have happened that it’s not working anymore?