Society of Robots - Robot Forum

Software => Software => Topic started by: cclif on November 06, 2011, 12:38:17 PM

Title: Programming $50 Robot
Post by: cclif on November 06, 2011, 12:38:17 PM
To start off, I've done searches and can't find exactly what I need to answer my question. Maybe I'm just stupid but hey, I tried!

I've built the "brain" of the $50 robot and I am ready to program it. I bought the AVRISP mkII and downloaded studio 5 since it was the newest version and was immediately lost upon starting the program, since it looks nothing like studio 4 (which is what is covered in the tutorial). I then decided to just download studio 4 and go with the tutorial, but it wouldn't connect to the robot. I have the two green lights on the mkII so I tried to search for that solution, and from what I understand, the newer mkII's don't play well with studio 4. THEN I thought id be a sneaky snake and just use ponyprog2000 to circumvent the entire problem, but that doesn't want to connect either.

So now I come to you with a slew of questions, but only one needs to be answered and I don't care which one. Just save my robochild.

Is there a way to apply the source files provided in the tutorial to studio 5? The biggest problem is the lack of a handy dandy sidebar where I can easily import the source and header files, but really the whole program is a mystery to me.

Is there some other way to use studio 4? Meaning, am I overlooking a simple fix to get it to connect to my robot? Again, I have two steady green lights but it will not connect and I can't Adjust the ISP frequency in "disconnected mode".

Or is there some easy way to make ponyprog work for me? I followed the steps for it in the tutorial and got the error message that was predicted but none of the troubleshooting steps that were provided were able to resolve the issue.
Title: Re: Programming $50 Robot
Post by: cclif on December 06, 2011, 11:09:51 AM
bumpalumpadump
Title: Re: Programming $50 Robot
Post by: newInRobotics on December 06, 2011, 04:36:12 PM
Hi fella  :)

Hopefully, this will be useful for You.

1. Create New Project in AVR Studio 5 using microcontroller name of Your choice.
(http://a6.sphotos.ak.fbcdn.net/hphotos-ak-snc7/383141_302124453154273_100000701616919_960743_622867107_n.jpg)
(http://a7.sphotos.ak.fbcdn.net/hphotos-ak-ash4/380552_302124486487603_100000701616919_960744_1649420361_n.jpg)
(http://a1.sphotos.ak.fbcdn.net/hphotos-ak-ash4/390034_302124496487602_100000701616919_960745_1790456636_n.jpg)

2. Go to project location in Your computer.
(http://a3.sphotos.ak.fbcdn.net/hphotos-ak-snc7/378476_302127126487339_100000701616919_960746_1095014808_n.jpg)

3. Find includes folder and put all dependency (library) files into it.

4. Copy content of main file (the one that contains main function) to main (nameOfYOurProject.c) file of Your newly created project. It can be found in the same folder as includes and Debug directories.

5. Reload Studio 5 and reopen Your project.

6. Adjust top of the document (includes section) as required - putting all filenames found in includes folder used before.
(http://a7.sphotos.ak.fbcdn.net/hphotos-ak-ash4/391070_302134673153251_100000701616919_960773_301312850_n.jpg)

7. Build Your project and hope for no error messages  ;D
(http://a1.sphotos.ak.fbcdn.net/hphotos-ak-ash4/377854_302137063153012_100000701616919_960801_225969836_n.jpg)

8. Plug Your programmer to the robot and to the computer.

9. Hit AVR Programming button.
(http://a5.sphotos.ak.fbcdn.net/hphotos-ak-snc7/388304_302139636486088_100000701616919_960803_1565963238_n.jpg)

10. Select Tool, Device, Interface and hit Apply. Click Read (Device ID) and Read (Target Voltage). If You get Device ID and Voltage - Your setup is OK.
(http://a5.sphotos.ak.fbcdn.net/hphotos-ak-ash4/384046_302142826485769_100000701616919_960808_1697736398_n.jpg)

11. Go to Memories and put .hex file location into Flash field.
(http://a3.sphotos.ak.fbcdn.net/hphotos-ak-ash4/387548_302144433152275_100000701616919_960809_725960988_n.jpg)

12. Hit Program.
(http://a2.sphotos.ak.fbcdn.net/hphotos-ak-snc7/393551_302145129818872_100000701616919_960811_796203534_n.jpg)


Anyhow, it works every time. Hope it works for You too  ;)