2

Author Topic: PonyProg programming AVR STK serial  (Read 13897 times)

0 Members and 1 Guest are viewing this topic.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
PonyProg programming AVR STK serial
« on: February 28, 2007, 07:36:36 PM »
Probably the dumbest question I've ever asked, but Im struggling to figure this out . . .

I am trying to program an ATmega8 using PonyProg2000 and the AVR STK Serial Port Dongle Programmer.

Cant seem to find any help files anywhere . . .

So the question is, HOW!? I have AVR Studio and code that compiles with no errors, but not sure what to do after that . . . PonyProg is asking for a .e2p file, but I have no idea what that is . . .

In other news, I was extra dumb today and accidently swapped ground and power to my board . . . Im praying to the robot gods that the voltage regulator prevented me from frying my ATmega8 . . .

Offline trigger

  • Full Member
  • ***
  • Posts: 115
  • Helpful? 0
  • It's an op amp, not a gun part.
Re: PonyProg programming AVR STK serial
« Reply #1 on: February 28, 2007, 11:44:42 PM »
In other news, I was extra dumb today and accidently swapped ground and power to my board . . . Im praying to the robot gods that the voltage regulator prevented me from frying my ATmega8 . . .

Hmm...did you have a diode between your power supply and the regulator? I would think that would prevent negative voltages from frying your device.
There are 10 kinds of people in this world: those who can read binary, and those who can't.

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: PonyProg programming AVR STK serial
« Reply #2 on: March 01, 2007, 12:44:28 AM »
Sorry, I've only used avr-gcc and uisp wich only needs the hex files. maybe it's looking for .eep files though? I'm not quite sure what they do but ...... :-\

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: PonyProg programming AVR STK serial
« Reply #3 on: March 01, 2007, 03:44:42 AM »
have you tried the "Newbie's Guide To AVR Development" on http://www.avrfreaks.net/index.php?module=FreaksArticles&func=viewArticles ?
it talks you through getting started with AVR Studio.
i've never used AVR Studio though as i'm in the same boat as Jesse having only used avr-gcc and uisp so can't realy be much more help.

dunk.

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
Re: PonyProg programming AVR STK serial
« Reply #4 on: March 01, 2007, 06:20:00 AM »
Admin,

In my tutorial for connecting a PC to the Bioloid bus, I include a small section on how to do exactly that...

http://www.bioloid.info/tiki/tiki-index.php?page=pc+serial

In a nutshell:

You need to produce a .hex file, and load that into Ponyrog using "Open Device File". Plug it in, turn your AVR board on, and execute "Write All" from the Command menu.

You should always power down the AVR board when you are plugging in/unplugging the programmer.

- Jon

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: PonyProg programming AVR STK serial
« Reply #5 on: March 01, 2007, 03:46:31 PM »
Im having issues producing that darn .hex file . . . (the AVRfreaks article wasnt helpful as it doesnt talk about make files :()

Using AVR studio, I keep getting this red dot error:
make: *** No Rule to make target 'F:/Documents', needed by 'a2dtest.elf'. Stop.

Im using the test file a2dtest.c that came with AVRlib so its not any code of mine causing the problem . . . For the makefile I am using MFile (the yellow genie lamp thing) that comes with WinAVR to generate it.

I set the MCU to ATmega644, the Main file to a2dtest, and source C file to a2dtest.c in the makefile.

Thinking that AVR Studio has a bug that causes failure if a filename has a space in it (i.e. F:/Documents and Settings/FileName), I changed the folder to H:/Code/FileName and now just get a new error:

Makefile:531: *** multiple target patterns. Stop.

Im so confused ??? Any thoughts on what Im doing wrong?

attached is my make file

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
Re: PonyProg programming AVR STK serial
« Reply #6 on: March 01, 2007, 04:10:01 PM »
Admin,

Sorry, you've gone way past my level on that stuff. My brother (who is a big-time embedded C programmer) set up all the make stuff for me, and I just use what he gave me, and it works.

Try this link, it may help:

http://www.instructables.com/id/E5H5UDWB5UEUKIKV8V

- Jon

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: PonyProg programming AVR STK serial
« Reply #7 on: March 01, 2007, 06:33:09 PM »
If I could only count how many times Dave has saved me. :P

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: PonyProg programming AVR STK serial
« Reply #8 on: March 02, 2007, 03:01:43 PM »
I should report on my progress for solving this problem . . .

First, there is a problem with AVR Studio itself. There are three rules you must follow when linking to a make file:
1. Target name must equal project name.
2. Clean/rebuild support requires  "clean" target.
3. Makefile and target must exist in the same folder[/li][/list]

These were annoying pointless rules that I just didnt notice before . . .  :-\
For example, I always call my first file main.c, not the name of the project, '$50 Robot' . . . apparently they must be the same name. The make file must also exist in the same folder, meaning I cant have a master make file in a separate folder . . . blaaaahhhh. This is especially confusing cause AVR Studio allows you to locate the make file in other folders (why?!) . . .

The next problem I found was the makefile itself not getting along with AVRlib, and Im still trying to figure out why. I think its cause AVR Studio isnt allowing me to link to files in other folders . . .

Anyway, I found my really old AVR code from like 2 years ago and after working around these bugs I got it to compile. Finally! This gives me something to work with and to know Im not completely incompetent in making a darn .hex file :P

Lastly, within the last day or two ago, AVR Studio came out with a new version, AVR Studio v4.13:
http://www.atmel.com/dyn/resources/prod_documents/aStudio4b528.exe

It comes with a few new features, but doesnt fix the bugs Ive been having :-\
Starting to remember why I stopped using AVR the first time I tried them out . . . Oh well too late now!

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: PonyProg programming AVR STK serial
« Reply #9 on: March 03, 2007, 08:38:52 PM »
I think the issue is that you are doing AVR through Windows.

Gnu make files require no such nonsense...and linking the AVRlib files in is as simple as makeing a $AVRLIB path name and adjusting your make files. did you do this:
Code: [Select]
#include someAVRLibfile.hin the files where you used AVRLib? Then you need to do something like this in your make file:
Code: [Select]
SRC += avrlib/a2d.c
SRC += servo/servoT3.c
SRC += avrlib/rprintf.c
SRC += avrlib/uart2.c
SRC += avrlib/buffer.c
SRC += sonar/sonar.c
SRC += TWI-Slave/TWI_slave.c

ahem....<soapbox> try linux, you'll like it</soapbox>  :P


« Last Edit: March 03, 2007, 08:43:18 PM by JesseWelling »

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
Re: PonyProg programming AVR STK serial
« Reply #10 on: March 04, 2007, 06:02:49 AM »
I actually use make files for my AVR stuff, but (a) my brother set them up for me, and (b) I'm using Cygwin.

- Jon

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: PonyProg programming AVR STK serial
« Reply #11 on: March 10, 2007, 02:33:49 PM »
hmmmm still having problems with PonyProg . . .

I use the 'Write All' command but it just sits saying 'Writing...' without the progress bar going up. Im using the correct port because it gives me the Device missing or unknown device error if I use any other port or turn the power off.

I can successfully program the AVR using the AVR ISP programmer with no problems. But after when I try to use PonyProg, the robot stops doing anything, so I know its accessing the AVR.

Im using a USB to serial adaptor . . . any clue to how I can fix this problem?

This is the very very last step for my tutorial and Ill be done if I can solve this!

correction: Strangely, after I finished writing this post (like after 15 minutes), the progress bar went to 5% then 10%. Will it take 2 hours?!? Is this normal!? This is aweful painful!

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: PonyProg programming AVR STK serial
« Reply #12 on: March 10, 2007, 03:30:27 PM »
Ok it works!

However, it took an entire hour to upload the program!!!!!!!! pain!!!!!!!!!!!

Is there any way to speed up the PonyProg? Any way I can turn off the verification wait (which added like 30 more minutes)?

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
Re: PonyProg programming AVR STK serial
« Reply #13 on: March 10, 2007, 05:46:40 PM »
Admin,

According to this page:

http://www.lancos.com/e2p/ponyprog2000.html

...

After the Calibration you can choose the speed for every serial bus modifying the following parameters in the ponyprog.ini (.PonyProgrc under Linux) file:

    * I2CBusSpeed=NORMAL    affect 24Cxx eeprom and other I�CBus devices
    * SPIBusSpeed=NORMAL    affect AVR micro, AT89Sxx micro and 25xxx eeprom
    * MicroWireBusSpeed=NORMAL    affect 93Cxx eeprom
    * PICBusSpeed=NORMAL    affect PIC16x84 micro
    * SDEBusSpeed=NORMAL    affect SDE2506 eeprom

Every parameter can be assigned the value SLOW, NORMAL, FAST or TURBO.
Avoid to use the TURBO value because it means "no delay", and probably it doesn't work on your PC, especially with the I/O driver.
Just for example my PC (Pentium MMX 200MHz) run I�CBus at about 80Khz with NORMAL, and 110 Khz with FAST. Note that a lot of I�CBus devices don't work at speed above the 100KHz.

...

Seems to me you should look in your PonyProg.ini file, and see what SPIBusSpeed is set to...

- Jon

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: PonyProg programming AVR STK serial
« Reply #14 on: March 10, 2007, 06:51:02 PM »
:'(

So I change the .INI file so that it says:
SPIBusSpeed=FAST

I also change:
VerifyAfterWrite=NO
(because it took 45 minutes to do this last time)

So it programs after like 20 minutes (I think the same as with SPIBusSpeed=NORMAL). Still crazy slow!!! After it programs, my robot doesnt do anything. Just sits there. I try to reprogram it using PonyProg, it sits for like 5 minutes, then tells me its unable to connect to it.

So Im like ok . . . lets reprogram it using my AVR ISP programmer with AVR Studio (this way normally works and only takes like 30 seconds). Well it connects to the AVR, but refuses to program or read calibration bits or anything. I cant seem to program it, read from it, or even erase it anymore  :'(

It just says 'ISP Mode Error' but doesnt give me any useful information.

Did PonyProg (or I?) fry my ATmega8!? Any way to fix this?

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
Re: PonyProg programming AVR STK serial
« Reply #15 on: March 10, 2007, 07:03:10 PM »
Wow, that's really weird.

If your AVR ISP won't program it, then chances are something got toasted. Either that or you need to reboot your machine...

I'm sorry, I used PonyProg once to program my ATmega128, and after that I ended up getting an AVRISPmk2, which I have used pretty much exclusively since.

At this point, I have no idea what the problem could be...

- Jon

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: PonyProg programming AVR STK serial
« Reply #16 on: February 11, 2009, 11:31:06 PM »
I know I'm reviving a really dead topic, but I just wanted to let people know it was because you can't use a USB to serial adapter with PonyProg . . .

 


Get Your Ad Here

data_list