NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » Servo not responding.
January 05, 2010 by Solorbob |
I found a project that uses a servo, so I thought I would hook one up to my nerdkit to see what I could learn. I used the same setup as the LED example with the servo control going to MCU pin #16. Servo was plugged into the 5v Vcc and Gnd. I tried both the servo squirter code as well as the example code that lcruz007 posted back in October. The servo just pulsed in one direction and "ba" kept writing to the HyperTerminal screen with each pulse. I will try again to see if I get the same results. Thanks, Shawn |
---|---|
January 05, 2010 by hevans (NerdKits Staff) |
Hi Solorbob, "ba" coming over the serial port means your chip is restarting. The bootloader sends "b" when it is about to run the bootloader, then "a" when it is about to run the application. Most likely you have a low battery, or something misswired, such that when the motor attempts to turn the voltage drops and the chip resets. This ends sending "ba" again. Hope that helps. Humberto |
January 05, 2010 by Solorbob |
Thanks Humberto, I did find that I had to keep wiggling my Vcc wire going to the voltage reg to get it to accept the code upload. I bet that is the problem. I'll solder a wire to it and try again. |
January 05, 2010 by Solorbob |
I adding a piece of wire to the battery clip leads which took care of the problem. Thank you very much. |
January 05, 2010 by Farmerjoecoledge |
Would one of you kind gentlemen please give me a quick rundown on hyperterminal and connecting to the mcu. The one I got is only good for phones?? thx |
January 06, 2010 by Solorbob |
I found the info on the hyperterm in the servo squirter project. Here is the link http://www.nerdkits.com/videos/servosquirter/ |
November 16, 2010 by kapkunal |
Hi, i am working on a robotic arm project. i tried to rotate the servo, but it didnt rotate. plz tel me what prescalar should i take..as the clock frequency is 14745600. i have EXI 312f servo. also plz tel me can i change the crystal to change the clock frequency. i used the following program:
also tel me if this is correct?? |
November 16, 2010 by hevans (NerdKits Staff) |
Hi kapkunal, Please take a little time and go over the protocol for talking to servos again, and how we do that with the PWM out put on the chip. The video tutorial for the servo squirter is a great place to start. Particularly focus on how we have both a TOP value which is set by OCR1A to set the 20ms repeat rate. We then use OCR2B to actually do the PWM output, and create a 1-2ms pulse. You are going to want to leave OCR1A alone, and vary OCR2B to change the position of your servo. You also definitely also want to add some delays in your code between the positions so the servo has time to get to the next position. If I were you I would use an LED on the PWM output at first to make sure you have the PWM output correct before putting your servo into the loop. Humberto |
Please log in to post a reply.
Did you know that Pulse Width Modulation (PWM) can be used to control the speed of a motor digitally? Learn more...
|