Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: mantale1 on January 22, 2011, 12:54:21 PM

Title: AVR RISP mkII Programmer problems, $50 bot
Post by: mantale1 on January 22, 2011, 12:54:21 PM
hi all,

This is the first time I'm trying to program the $50 bot and I'm having some issues with the programmer. when I connect the programmer to the usb port in the computer a green LED comes on, and when I connect the programmer to the 6 male pins another green LED comes on so I guess this means there aren't problems with the connection. when I go to upload the code, I get an error saying


"A problem occurred while executing this command. Make sure you are using the correct programming method. Current method is ISP. See command output for more info..."

It then gives me some tips about checking the ISP programming frequency. 


In the command output I'm seeing this message:
"Setting mode and device parameters...OK!
Entering programming mode...FAILED!
Leaving programming mode...OK!"

it then exits programming mode.

I've tried adjusting the ISP frequency of the programmer but that hasn't worked :-[.

Any ideas?
Also, what is the clock frequency of the atmega8?

Thanks
Title: Re: AVR RISP mkII Programmer problems, $50 bot
Post by: walkercreations on January 22, 2011, 02:02:46 PM
Make sure you read this tutorial. It really helped me. The key is setting the chip to the proper frequency which this tutorial tells you is 125.0kHz

AVR MKII (AVR ISP2) Programmer Tutorial (http://www.societyofrobots.com/member_tutorials/node/290)
Title: Re: AVR RISP mkII Programmer problems, $50 bot
Post by: mantale1 on January 22, 2011, 04:46:28 PM
That was the default setting, and i tried other frequencies and went back to that one and it still wasn't working. When you select the source files for the "flash", "EEPROM" and "ELF" what file(s) did you put there? :-\. Any other ideas for what I could try?
Title: Re: AVR RISP mkII Programmer problems, $50 bot
Post by: walkercreations on January 22, 2011, 05:15:59 PM
I used the hold_servo.hex file that Admin provided. Which ATMega are you using? I personally am currently using the ATMega8. On the MAIN tab in AVR Studio I have ATMega8 selected as my device and ISP as my programming mode. On the SETTINGS tab I selected the 125 kHz speed. With that done, on the MAIN tab you should be able to press the Read Signature button and it should work with no errors.

Now go to the PROGRAM tab and under Flash, select the program you want to program into your MCU. Once the program is listed in the Input HEX File search box, press Program and watch the progress bar and message window at the bottom.

I followed the tutorial that I posted the link for and everything works as advertised. I actually spent about 45 minutes just loading and erasing the hold_servo.hex program just out of amazement that I actually got everything working with little to no problem. My next goal is to write or find a program that will manipulate the LED on the board. I'm looking for a good tutorial on writing a program from scratch so I can learn more about the language and functions associated with the $50 robot.
Title: Re: AVR RISP mkII Programmer problems, $50 bot
Post by: mantale1 on January 22, 2011, 06:11:50 PM
I used the hold_servo.hex file that Admin provided. Which ATMega are you using? I personally am currently using the ATMega8. On the MAIN tab in AVR Studio I have ATMega8 selected as my device and ISP as my programming mode. On the SETTINGS tab I selected the 125 kHz speed. With that done, on the MAIN tab you should be able to press the Read Signature button and it should work with no errors.

Now go to the PROGRAM tab and under Flash, select the program you want to program into your MCU. Once the program is listed in the Input HEX File search box, press Program and watch the progress bar and message window at the bottom.

I followed the tutorial that I posted the link for and everything works as advertised. I actually spent about 45 minutes just loading and erasing the hold_servo.hex program just out of amazement that I actually got everything working with little to no problem. My next goal is to write or find a program that will manipulate the LED on the board. I'm looking for a good tutorial on writing a program from scratch so I can learn more about the language and functions associated with the $50 robot.

I am also using the ATmega8. Where did you upload the hold_servo.hex file? When I click read signature I also see the same error that says "Enter programming mode...FAILED!"
Title: Re: AVR RISP mkII Programmer problems, $50 bot
Post by: walkercreations on January 22, 2011, 06:17:03 PM
I uploaded it using the Flash section of the Program tab. If you are unable to get it working by tomorrow, I will try to make a quick video and post it on my YouTube channel going through the steps and showing the program working on my MCU. I'm at work right now so won't be able to do anything till later tonight when I get off or first thing in the morning.
Title: Re: AVR RISP mkII Programmer problems, $50 bot
Post by: mantale1 on January 22, 2011, 07:16:23 PM
Ok so I couldn't find the hold_servo.hex file you were talking about so I uploaded the Photovore_v1.hex to the flash. That's the complied code that came from what was on the tutorial (at this point I don't want to mess around with the source code, I just want to see the bot working). Now I have another problem, which is after I uploaded the Photovore_v1.hex to the flash, nothing is happening. Any idea as to what this is?
Title: Re: AVR RISP mkII Programmer problems, $50 bot
Post by: walkercreations on January 22, 2011, 07:29:01 PM
That is the program that controls your light sensors once you build them and attach them to your MCU. The hold_servo.hex is listed in the tutorial here - http://www.societyofrobots.com/downloads/hold_servo.hex (http://www.societyofrobots.com/downloads/hold_servo.hex)
Title: Re: AVR RISP mkII Programmer problems, $50 bot
Post by: mantale1 on January 24, 2011, 08:18:27 PM
Ok, I uploaded the hold_servo.hex file to the flash but nothing is happening. :-\. I'm really confused. Do I need to upload a file to "EEPROM"?
Title: Re: AVR RISP mkII Programmer problems, $50 bot
Post by: mantale1 on January 24, 2011, 08:20:26 PM
I also hear the servos twitching at times, even after I disconnect the programmer. Could that be a wiring/connection issue?
Title: Re: AVR RISP mkII Programmer problems, $50 bot
Post by: walkercreations on January 25, 2011, 12:05:29 AM
Here is a video I made before you said you were able to load the photovore program...

Programming the $50 Robot for the first time (http://www.youtube.com/watch?v=Cv2hV9wZm8w#)

If you still have problems after watching that, then I would be willing to bet something is wrong with your MCU somewhere. Probably a crossed or missed connection maybe or you have the servos hooked up in the wrong place.