Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: richard mackie on December 15, 2007, 03:45:40 PM

Title: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 15, 2007, 03:45:40 PM
alright guys well I have been trying to program this  myself for 2 days and cannot figure out what is wrong. Maybe some one can help a little I am attaching a picture of my now ugly circuit board(thanks to the desoldering and resoldering over and over again).

I think I may have fried the atmega8 is there a way to check this?
I did buy an extra but it is the atmega128

(lol as i was checking my info i realized that i had the atmega128 on my board and not the atmega8)

i went to try and upload the hex file using pony, turned the power on my bot on and the seros moved a little (which it had never done before) but it still did not work
I am sure that i am using the correct serial port

anyone can help it would be very appreciated
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: Admin on December 15, 2007, 04:44:38 PM
Quote
(lol as i was checking my info i realized that i had the atmega128 on my board and not the atmega8)
lol, the program won't work with the 128, you'd have to modify a bunch of stuff in code.

now assuming you are using the ATmega8, first:
http://www.societyofrobots.com/robot_faq.shtml#circuit_debug

Can you tell us more about the error you are getting? Or does it program without error, but nothing happens?
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 15, 2007, 05:22:23 PM
well i rechecked all the voltages and i am pretty sure that i do not have any shorts so i retried programming it (with the atmega8 in)  ;D but now the servos did not "jump" does this mean the atmega8 is fried? it is recieving 5v the servos bus is recieving ~6

when i plug the servos in however the voltage goes to crap in the whole curcuit
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: Admin on December 15, 2007, 07:38:51 PM
Servos naturally jump when you first give them power, such as turning the circuit on.

Quote
when i plug the servos in however the voltage goes to crap in the whole curcuit
I suspect your power source is the problem. Bad voltage will prevent it from being programmed.

Can you tell me more about your battery(s)? Is your battery fully charged?

Try programming it without the servos plugged in, too.
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: Trumpkin on December 15, 2007, 08:10:18 PM
On the bottom left of your Programmer header one of the pins is connected directly to the Atmega chip  Is it supposed to be like that?
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 15, 2007, 11:09:36 PM
thanks for all the help guys

i already tried without the servos
 
i am not positive about the battery being fully charged but i suspected that was the problem I plugged the board directly into the wall charger (at the time when the atmega128 was in) and i had the chip set to auto detect but since i did not change the makefile that is probably why it didnt not work then

so the battery is charged and i will try to program it again

as for the pin i just did not feel like soldering another wire when i could just use the otherwise used area of breadboard but thanks for taking the time to look at my picture

my question now is when do i know if a chip is fried

once again thanks for both of your help and if you have any other input ill be checking back here quite often and btw admin this whole site is amazing i was looking into getting into robotics for quite sometime but this is by far the best site out there couldnt imagine building one without SoR

Title: Re: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 15, 2007, 11:21:32 PM
well i tried to program it again and well the battery is good and voltage seems good unless i am checking it wrong

servo bus is a little higher than 6v
regulated voltage is slightly higher than 5v

ive used the ground in multiple places and the ground is fine
 :( just dont know what to do im sure ill think of it

also avrstudio does not work on my laptop so i have to keep using my brother desktop so can i use programmers notepad i remember in the tutorial the admin was opposed to it but i had to use it on my avr butterfly
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: airman00 on December 15, 2007, 11:31:21 PM
Make a basic program to light an LED or something

then work your way up and try to debug each part of Admin's program
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 16, 2007, 12:33:08 AM
airman i dont think you understand my problem. im having trouble sending my program to the chip, not with the actual programming
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: robonoob on December 16, 2007, 03:40:15 AM
airman i dont think you understand my problem. im having trouble sending my program to the chip, not with the actual programming
yea we understand ur problem but make the LED blinking programme and try to send this to your chip then if it works ur chip isn't fried and everything is right... then try to make some code with the servos and if this works too then it should be all right...
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: airman00 on December 16, 2007, 05:04:29 AM
I understand the blinking program is to test the chip . Exactly like robonoob said.   ;)
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 16, 2007, 10:13:06 AM
o ok i understand what you both mean ill give it a try that makes alot of sense actually thank you both
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: robonoob on December 16, 2007, 10:40:59 AM
o ok i understand what you both mean ill give it a try that makes alot of sense actually thank you both
no problem...
by the way richard i like ur robot-s design :)
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: Admin on December 16, 2007, 10:42:23 AM
Quote
i went to try and upload the hex file using pony . . . also avrstudio does not work on my laptop so i have to keep using my brother desktop
Wait, which programmer are you using (cheap one or expensive one), and which software are you using (ponyprog or AVR Studio)?

The cheap programmer must be used with PonyProg, and the expensive programmer must be used with AVR Studio.
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: HDL_CinC_Dragon on December 16, 2007, 11:54:29 AM
One thing that I did when I was making my robot was I had accidentally reversed my programming headers pins because for what ever reason when I flipped my board over, I forgot to flip it over in my head too so I began to solder my wires backwards :P make sure your connections are all 100% correct. I checked multiple times but missed that error many times >_<
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 16, 2007, 01:17:19 PM
I have the cheaper programmer and I am using pony to try and program it. I mentioned avr studio because I want to know if i can compile the code some other way(because avr studio doesnt work on my laptop) maybe with programers notepad.

ive checked my connections again and im pretty sure they are correct

here is the battery i bought http://www.lynxmotion.com/Product.aspx?productID=331&CategoryID=48 (http://www.lynxmotion.com/Product.aspx?productID=331&CategoryID=48)
it is 6v 1600 mah

the charger i bought was just an ac-dc adapter http://www.radioshack.com/sm-regulated-and-filtered-6vdc-300ma-adapter--pi-2552557.html (http://www.radioshack.com/sm-regulated-and-filtered-6vdc-300ma-adapter--pi-2552557.html)
it is 6v 300ma

so to charge is i just do 1600/300= ~5 hours 20 mins right?

im going to keep trying until i get it thanks to all and thanks for the comment on my design robonoob

Title: Re: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 16, 2007, 02:10:11 PM
jsut a little more info
i recharged my battery in last night for about 5 hours and today i plugged it in to the circuit and the battery voltage drops significantly to around 5 volts in only a few minutes does this mean there is a short somewhere?
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: Admin on December 16, 2007, 03:58:26 PM
Quote
i recharged my battery in last night for about 5 hours and today i plugged it in to the circuit and the battery voltage drops significantly to around 5 volts in only a few minutes does this mean there is a short somewhere?
hmmmm this means that either the battery is not fully charged, or that there is a short.

can you measure the charger output voltage with a multimeter? (just in case its not giving out a good voltage)

try charging the battery for more like 10 hours.

what error is ponyprog giving you?
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 16, 2007, 04:13:13 PM
ive checked the charger voltage and it is just under 7 volts but i will try charging it for longer is there anyways it could hurt the battery if i left it overnight? and the error pony is giving me is the same you described in the tutorial the error 24
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: airman00 on December 16, 2007, 04:21:00 PM
http://forum.sparkfun.com/viewtopic.php?t=5598 (http://forum.sparkfun.com/viewtopic.php?t=5598)

There are a couple of solutions on that post


It wouldn't break the battery since it is trickle charging  - it wouldn't really be 5 hours then
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 16, 2007, 11:45:32 PM
Well guys I got it working!!!  ;D kind of at least the LED came on and the scanning servo moved so both are good signs at least i have something right
what i ended up doing is just pulling out a new prototyping board (the kind where everything is removable and involves no soldering) so tomorrow i get to play with code  ;D im just extremely happy to see some sort of results
thanks to everyone who helped me and ill post some pics tomorrow

Title: Re: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 17, 2007, 03:31:17 PM
i think the atmega8 is fried
 it completely goes crazy when i turn the bot on  :-\
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: Admin on December 17, 2007, 04:02:38 PM
Quote
it completely goes crazy when i turn the bot on
when you say crazy, you mean like murderous frenzy kind of crazy? or help me im having seizures crazy? ;D

Quote
i think the atmega8 is fried
on the bright side, you now have a good excuse to get an ATmega168 upgrade (http://www.societyofrobots.com/step_by_step_atmega168_swapout.shtml)
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 17, 2007, 11:55:06 PM
ya i already ordered a a few more atmega8s for the moment i think ill be able to use them in future projects for a while..... or i just have quite a few more chips to fry before i find the error in my ways

Title: Re: $50 dollar robot problem programming (with pictures)
Post by: robonoob on December 18, 2007, 07:56:35 AM
ya i already ordered a a few more atmega8s for the moment i think ill be able to use them in future projects for a while..... or i just have quite a few more chips to fry before i find the error in my ways


why didnt u order atmega168?
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 18, 2007, 11:17:54 AM
honestly i just did not think too much
i guess at least if i fry the ones ill have saved a whole 2 dollars  ;D
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: Trumpkin on December 18, 2007, 12:12:04 PM
plz tell me what you did to get it to work!
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: richard mackie on December 18, 2007, 03:39:17 PM
well trumpkin, i wouldn't call it working i just redid it without all the soldering so I'm guessing there was a short somewhere and without all the soldering its pretty easy to keep it clean and short free :) you can buy smaller boards but i already had this one
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: Trumpkin on December 19, 2007, 09:24:20 AM
Yeah I guess Ill just do it on a breadboard too 
Title: Re: $50 dollar robot problem programming (with pictures)
Post by: Trumpkin on December 19, 2007, 09:30:17 AM
If you can, can you please post a picture of the whole breadboard circuit so I can be more Lazy? ;D