go away spammer

Author Topic: AVRISP mkII connection problem- $50 robot  (Read 6558 times)

0 Members and 1 Guest are viewing this topic.

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
AVRISP mkII connection problem- $50 robot
« 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

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #2 on: February 14, 2009, 10:43:18 AM »
Thank you much.... just what I needed to find out my PCB was not right :(

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #3 on: February 14, 2009, 05:08:50 PM »
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

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #4 on: February 15, 2009, 10:24:15 AM »
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

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: AVRISP mkII connection problem- $50 robot
« Reply #5 on: February 15, 2009, 11:51:21 AM »
what microcontroller are you using?
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #6 on: February 15, 2009, 12:16:28 PM »
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.

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: AVRISP mkII connection problem- $50 robot
« Reply #7 on: February 15, 2009, 12:35:08 PM »
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) ?
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #8 on: February 15, 2009, 12:55:24 PM »
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.

« Last Edit: February 15, 2009, 01:03:45 PM by RiffRaff »

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: AVRISP mkII connection problem- $50 robot
« Reply #9 on: February 15, 2009, 01:15:26 PM »
you set the frequency and then you have to press Write
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #10 on: February 15, 2009, 01:18:47 PM »
Doh!  Thanks... it works!

And really, thanks for keeping an eye on this thread.

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #11 on: February 15, 2009, 01:21:34 PM »
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?

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: AVRISP mkII connection problem- $50 robot
« Reply #12 on: February 15, 2009, 01:46:36 PM »
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
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #13 on: February 15, 2009, 01:55:31 PM »
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

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #14 on: February 18, 2009, 09:43:47 AM »
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

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: AVRISP mkII connection problem- $50 robot
« Reply #15 on: February 18, 2009, 10:05:56 AM »
is the ISP frequency correct, did you select the correct microcontroller to program within the program tab.
Go through my tutorial one more time
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #16 on: February 18, 2009, 10:33:23 AM »
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?

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: AVRISP mkII connection problem- $50 robot
« Reply #17 on: February 18, 2009, 10:36:58 AM »
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?
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #18 on: February 18, 2009, 10:41:59 AM »
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...

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #19 on: February 18, 2009, 11:05:29 AM »
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

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #20 on: February 18, 2009, 11:09:38 AM »
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.

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #21 on: February 18, 2009, 11:15:49 AM »
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.

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #22 on: February 18, 2009, 11:22:10 AM »
ahhh, I'm getting only 4.2 volts... could this be the problem?

charging another set of batteries now.

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #23 on: February 18, 2009, 02:33:53 PM »
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....

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #24 on: February 18, 2009, 02:36:09 PM »
could it be that i damaged my sensors when I had them switched with the servos?
« Last Edit: February 18, 2009, 02:37:07 PM by RiffRaff »

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #25 on: February 18, 2009, 03:44:18 PM »
ok, cool.  so now I've got my bot moving forward, but ignoring light  ???

Offline householdutensils

  • Full Member
  • ***
  • Posts: 72
  • Helpful? 2
Re: AVRISP mkII connection problem- $50 robot
« Reply #26 on: February 18, 2009, 03:56:18 PM »
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.

Offline RiffRaffTopic starter

  • Full Member
  • ***
  • Posts: 59
  • Helpful? 0
Re: AVRISP mkII connection problem- $50 robot
« Reply #27 on: February 19, 2009, 08:16:12 PM »
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

 


Get Your Ad Here

data_list