Society of Robots - Robot Forum
General Misc => Misc => Topic started by: RiffRaff on February 13, 2009, 09:52:43 AM
-
Greetings,
I thought I'd start here first just in case it's a noobie thing that everybody should know...
I've got my PCB soldered and it doesn't smoke. Yay!
I'm going to modify the servos now, and when trying to upload the .hex file to my controller, I assume I have to connect to it first (obviously I've loaded the software onto my computer- running XP btw), but when I try to connect I get 'Connect failed- Select AVR programmer'.
Any ideas as to what step I'm leaving out? A quick glance at the docs sheds no light, but I'll continue to search for the answer as I await your response.
This project has been a blast so far... I've left my fully assembled RoboPhilo just hanging, waiting for me to fine tune it and teach it some new moves :)
Riff
-
http://narobo.com/articles/avrmkII.html
-
Thank you much.... just what I needed to find out my PCB was not right :(
-
Success! I have green lights!
I'm going to stop now since it is Valentine's day and my wife has been very patient with me :)
Tomorrow, I will modify the servos and see how far I get before needing to ask for more help ;)
Riff
-
Ok, I didn't get far :(
I can get the programmer to 'erase device', so I assume that means I'm talking to the microcontroller.
I'm trying to program Admin's 'hold_servo_hex.hex file.
I get:
Reading FLASH input file.. OK
Setting mode and device parameters.. OK!
Entering programming mode.. OK!
Erasing device.. OK!
Programming FLASH .. OK!
Reading FLASH .. FAILED!
Leaving programming mode.. FAILED!
I have a steady amber, or orange led on the programmer after the attempts.
The programmer wants to use 1.049 kHZ for ISP freq, but I've tried 125 kHZ and even 100 HZ.
Any ideas or suggestions for where I should look for info?
Thanks,
Riff
-
what microcontroller are you using?
-
I'm using the $50 microcontroller with the ATMEGA8-16.
When I power it up while connected to the ASP programmer I get the green light, and the software seems to think it can erase the memory, so I am assuming that my work was good.
-
I'm using the $50 microcontroller with the ATMEGA8-16.
When I power it up while connected to the ASP programmer I get the green light, and the software seems to think it can erase the memory, so I am assuming that my work was good.
So does it work when you try to program at a really low frequency ( below 125khz) ?
-
No. Interestingly, although I have no idea why, it defaults to 1.049 kHZ and I even tried 100HZ.
AVR Studio says it programs FLASH, but fails upon attempting to read the FLASH.
-
you set the frequency and then you have to press Write
-
Doh! Thanks... it works!
And really, thanks for keeping an eye on this thread.
-
ok, now I've uploaded the .hex file for zeroing and holding my servo, should I have a led light on the pcb now? Is there something else I need to do to get the microcontroller to actually send the command to the servo?
-
ok, now I've uploaded the .hex file for zeroing and holding my servo, should I have a led light on the pcb now?
nope
plug in your servo and see if it works
-
Man, I'm having a Homer Simpson day! I was plugged into port 5, not port 1. Yeah.... it works. I'm going to modify the servos now.
I should be able to handle this on my own....:D
-
Ok, so I got my servos modified, finished my chasis, put it all together and downloaded & compiled the photovore_v1 code as intructed in the programming section of the $50 robot tutorial, but when I went to upload it to the robot, I got:
Reading FLASH input file.. OK
Setting mode and device parameters.. OK!
Entering programming mode.. FAILED!
Leaving programming mode.. OK!
emphasis mine ???
Any ideas?
Thanks,
Riff
-
is the ISP frequency correct, did you select the correct microcontroller to program within the program tab.
Go through my tutorial one more time
-
Huh... the atmega8 had backed out of the socket... i've got it in and the programmer seems to have done it's job, but the robot isn't doing anything....
Sorry to be such a noob, reallly.... but what now?
-
plugged in your servo backwards?
Try some sample code to turn on the LED , to verify that the microcontroller works. Did you set the fuses to be 1mhz internal?
-
This is what the programmer tells me now:
Reading FLASH input file.. OK
Setting mode and device parameters.. OK!
Entering programming mode.. OK!
Erasing device.. OK!
Programming FLASH .. OK!
Reading FLASH .. OK!
FLASH contents is equal to file.. OK
Leaving programming mode.. OK!
That means everything is ok, right? So my bot should be trying to run off the table?
I feel like I should be chasing my bot around with the camcorder...
-
well i did have my sensors and servos swapped :o
but it's straight now..... you know even when I modified my servos the led didn't light up
i just erased and reprogrammed the bot and still nothing, but the AVR thinks it's programming the microcontroller
-
Well, I just told the AVR to verify and it says that FLASH equals the file, and one of the servos started bumping about once a second.
-
plugged in your servo backwards?
Try some sample code to turn on the LED , to verify that the microcontroller works. Did you set the fuses to be 1mhz internal?
I didn't change the fuses, but it was set:
boot flash section size=1024
brownout detection level 2.7
int RC Osc. 1MHZ startup time 6CK +64ms
the above setting were enabled.
-
ahhh, I'm getting only 4.2 volts... could this be the problem?
charging another set of batteries now.
-
Ok, with fresh batteries, the AVR seems to program and verify just fine, servos twitch during upload and then nothing.
Surely I've overlooked something commonly overlooked....
-
could it be that i damaged my sensors when I had them switched with the servos?
-
ok, cool. so now I've got my bot moving forward, but ignoring light ???
-
If you're unsure if your sensors are damaged, connect it to the mcus regulated power rail and the ground rail, then measure the Vout on your sensor with a multimeter in different light conditions to ensure that your sensor is operating correctly.
-
After our house flooded, I lost track of my multimeter.... so I got another one. Man, they are really cheap these days.
I found the problem: a short between hot and ground in the sensor inputs. Sloppy soldering. Gotta work tonight, but I'll fix it tomorrow.
And the photoresistors are fine :)
Rifff