Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Jdog on November 22, 2008, 11:24:26 PM

Title: $50 robot servo/mcu help
Post by: Jdog on November 22, 2008, 11:24:26 PM
PLEASE HELP! I have no idea what's going on. I finally completed my microcontroller a few days ago and got it working. I uploaded the holdservo program to it so I could modify the servos, and it worked. After I modified them I uploaded the provided photovore code to it. I plugged both of my modified servos into it and only 1 of them worked, but that one worked perfectly. It turns out I messed up one of the servos when I tried modifying it. So I ordered another servo. When it arrived I put the holdservo program back on the controller and modified it. Then I put the photovore program on it again. Now when I plug everything in and turn it on the motors turn a little bit and then stop. This happens everytime I turn it on and off.
Title: Re: $50 robot servo/mcu help
Post by: Jdog on November 22, 2008, 11:25:36 PM
Also, now I just tried to reprogram it thinking that sometthing might have gone wrong when it uploaded the program, and now the computer doesn't even recognize it.
Title: Re: $50 robot servo/mcu help
Post by: szhang on November 22, 2008, 11:27:53 PM
Sounds like the uC is dead... Though it is possible you just wrote a bad fuse value.

Do you have a spare microcontroller?
Title: Re: $50 robot servo/mcu help
Post by: Jdog on November 22, 2008, 11:33:08 PM
I do, and I tried plugging that one in and connecting it to the computer, and it still doesn't recognize it.
Title: Re: $50 robot servo/mcu help
Post by: szhang on November 22, 2008, 11:44:36 PM
you sure your ICSP pins are all connected correctly?  Is the power connected correctly?  You might also try restarting the computer, I remember a couple of times where my AVR programmer stopped working until I restarted.
Title: Re: $50 robot servo/mcu help
Post by: Jdog on November 22, 2008, 11:53:11 PM
My pins are connected correctly and so is my power. I just restarted my computer and it still isn't recognizing it. I also checked the voltages and they're good too.
Title: Re: $50 robot servo/mcu help
Post by: pomprocker on November 23, 2008, 12:29:15 AM
after you program the robot...do you turn off the robot. unplug the programmer from the robot mcu, and then power cycle the robot?
Title: Re: $50 robot servo/mcu help
Post by: Jdog on November 23, 2008, 01:28:51 AM
what does power cycle mean
Title: Re: $50 robot servo/mcu help
Post by: Jdog on November 23, 2008, 10:36:16 AM
I'm guessing it's the microcontroller, so I'm going to get a new one of those. Does it make sense to get the better one for the extra dollar.
Title: Re: $50 robot servo/mcu help
Post by: airman00 on November 23, 2008, 10:40:46 AM
what does power cycle mean


turn the board on , then turn it off, then turn it on
Title: Re: $50 robot servo/mcu help
Post by: Admin on November 28, 2008, 12:51:32 AM
Check the battery voltage.

Also, using a multimeter, check the pin to the servo that wasn't working properly for a disconnect.
Title: Re: $50 robot servo/mcu help
Post by: Jdog on December 02, 2008, 03:58:09 PM
Everything is working except now when I try to write the program on the Atmega168 after it said it wrote it and verified it it says write failed
Title: Re: $50 robot servo/mcu help
Post by: airman00 on December 02, 2008, 04:08:36 PM
check to make sure microcontroller is firmly in its socket , double check connections, and check voltage
Title: Re: $50 robot servo/mcu help
Post by: Jdog on December 03, 2008, 04:38:36 PM
I did that and it still isn't working, do i need a different program for the 168?
Title: Re: $50 robot servo/mcu help
Post by: pomprocker on December 08, 2008, 04:28:26 PM
there might be a "ghost" short somewhere
Title: Re: $50 robot servo/mcu help
Post by: Admin on December 10, 2008, 04:40:36 AM
Upload this hex file and let us know if you still get the error:
http://www.societyofrobots.com/robotforum/index.php?action=dlattach;topic=5932.0;attach=2153

If you still get an error, that means you wired something improperly or set up ponyprog improperly.

If you don't get the error, that means you compiled your .hex improperly.
Title: Re: $50 robot servo/mcu help
Post by: Webbot on December 10, 2008, 11:09:22 AM
When you re-compiled the program for the ATMega168 did you remember to change the makefile to say your are using an ATMega168 rather than a ATMega8 ?
Title: Re: $50 robot servo/mcu help
Post by: Jdog on December 10, 2008, 05:57:33 PM
Yes. And I changed the timer in the Sor_utils