installing the Arduino bootloader on an Atmega8 with Pony Serial

I have a number of old Atmega8s gathering dust that I'd like to use as I2C-reachable dedicated keyboard scanners (since this always uses a lot of pins). The problem is that I want to use my old Pony Serial programmer to install a bootloader. I'm having problems getting my Arduino IDE (version 1.6.5) to install the bootloader using Pony Serial. I've put this in my boards.txt file:

atmega8noxtal.name=ATmega8-noxtal @8MHz

atmega8noxtal.upload.protocol=stk500 atmega8noxtal.upload.maximum_size=7168 atmega8noxtal.upload.speed=38400

atmega8noxtal.bootloader.low_fuses=0xe4 atmega8noxtal.bootloader.high_fuses=0xc4 atmega8noxtal.bootloader.path=atmega8_noxtal atmega8noxtal.bootloader.file=ATmega8noxtal.hex atmega8noxtal.bootloader.unlock_bits=0x3F atmega8noxtal.bootloader.lock_bits=0x0F

atmega8noxtal.build.mcu=atmega8 atmega8noxtal.build.f_cpu=8000000L atmega8noxtal.build.core=arduino

speculative:

atmega8noxtal.bootloader.tool=avrdude atmega8noxtal.bootloader.programmer=ponyser atmega8noxtal.bootloader.protocol=ponyser atmega8noxtal.bootloader.communication=com4 atmega8noxtal.bootloader.connection=com4 atmega8noxtal.bootloader.port=com4 atmega8noxtal.bootloader.com=com4 atmega8noxtal.bootloader.serial.port=com4

(note the speculative part!!), but no matter what I put in there, Arduino insists on using the stk500 protocol through USB, not the Pony Serial through com4. Mind you, PonySer and Com4 work great when I just issue Avrdude commands manually in a shell window. Why won't the Arduino IDE pick up my configuration from boards.txt? What am I doing wrong? Thanks!

Select the ponyserial programmer from tools -> programmers. I don't think that programmer is supported by default, though, so you'd need to add appropriate entries to... I think programmers.txt

Or you could just bootload from commandline with avrdude. There are other issues with bootloading the atmega8 on 1.6.x because it doesn't have an extended fuse...

Also, the ponyserial programmer looks like something like the FTDI-ISP hack, where they get the extra pins from the control lines on standard serial, and it's agonizingly slow. Why not just get a $3 USB ASP isp programmer on ebay? They're fast, they work, they're supported by the IDE, they have a handy windows GUI (which you can use to manually bootload chips), and they're available for the price of a latte including shipping.

that was helpful! i forgot about the arduino programmer menu. now, though, it insists on talking on port com1 -- i guess i have to find where ponyser is configged. too bad it just can't look at boards.txt or the current serial setting of the IDE.

this is now what it is trying to do on my windows 7 system:

C:\Program Files (x86)\arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega8 -cponyser {program.extra_params} -e -Ulock:w:0x3F:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:0xc4:m -Ulfuse:w:0xe4:m

ok i modified my programmers.txt to include this:

pony.name=Ponyserial pony.communication=com4 pony.protocol=ponyser pony.speed=19200

but now the IDE gets jacked up with this error:

avrdude: ser_open(): can't open device "com1": The system cannot find the file specified.

I don't know where that com1 is coming from; it is nowhere in boards.txt or programmers.txt

How, in programmers.txt, do I tell the IDE which com port to use? I'm sure this information will be very valuable for people arriving on this page from Google searches.

As for why i use ponyser instead of a USB programmer: it's because i have a board i created back in 2008 that has a 28 pin socket with pins attached to a switch. In one position, the switch connects a serial cable to the Atmega's RX & TX pins, allowing me to use an Atmega chip in that 28 pin socket as an Arduino. In the other position, the switch allows the Atmega to be connected to the serial port via a Pony Serial interface, allowing me to install bootloaders or do AVRDude stuff directly. This system works great (even if it's slow, a bootloader is a small piece of code) and I would love to have it work for my Atmega8s with an 8MHz no-crystal bootloader.

Why don't you use ponyprog GUI?

mart256: Why don't you use ponyprog GUI?

I don't know what that is. I just want to use the Arduino IDE -- which seems like it should be configurable to do what I want to do. I already can get AVRDude to work correctly from the command line, but in this case I'm not sure how to translate that boards.txt fuse info into an AVRDude instruction. I'm sure I could figure it out, but last time I tried to figure out a fuse setting I bricked an Atmega32. So I'm understandably gun-shy.

So wait, does this mean there is no way to tell the IDE which com port to use when burning a bootloader? Hmm, well, I think I just found the answer to that question: no. You have to use the PROGRAMMERNAME.program.extra_params setting in boards.txt. This allows you to pass anything you want to AVRDude. Good to know!! So the ponyser block in my boards.txt now looks like this:

pony.name=Ponyserial pony.communication=com4 pony.protocol=ponyser pony.speed=19200 pony.program.extra_params=-Pcom4

And it almost works -- just have to get ride of an efuse setting, which, as mentioned above, does not exist on the Atmega8.

In my experience it uses the serial port selected in the port menu...

DrAzzy: In my experience it uses the serial port selected in the port menu...

It may have done that in some version of the IDE, but it ignores that setting when flashing the bootloader in IDE version 1.6.5.

As far as I can tell, 1.6.5 is not going to be able to program bootloaders onto ATmega8 without significant changes "somewhere." You'd be better off learning how to use avrdude directory, or the ponyprog GUI.

(The big problem is this: "-Uefuse:w:{bootloader.extended_fuses}:m" - 1.6.4 doesn't understand that some chips don't have "extended" fuses.)

bigfun: I don't know what that is. I just want to use the Arduino IDE -- which seems like it should be configurable to do what I want to do. I already can get AVRDude to work correctly from the command line, but in this case I'm not sure how to translate that boards.txt fuse info into an AVRDude instruction. I'm sure I could figure it out, but last time I tried to figure out a fuse setting I bricked an Atmega32. So I'm understandably gun-shy.

Ponyprog gui is the original interface for the ponyserial. I even googled it.

http://www.lancos.com/ppwin95.html

mart256: Ponyprog gui is the original interface for the ponyserial. I even googled it.

http://www.lancos.com/ppwin95.html

that's awesome, and it's outstanding that you know how to bend google to your will, but, as i said, i was hoping to use the arduino ide.

the m8 efuse error can be quickly suppressed by just commenting that entry in platform.txt. then put back in if needed. or the more involved method of creating a new core as drazzy suggested in the other thread a few days ago.

as far as ponyprog i used it for a short time some years ago but switched to avrdude as the lesser of two evils. pony took around 35 min to flash the same chip dude took about 4 sec. winders dont like some of its serial bits wiggled. at least not very fast. maybe its better now. the dos version was very fast but still a crummy flashing utility.