It turned out that one operation in avrdude's serbb_posix.c is taking very long. It is the setting of the TXD line via:
Code: Select all
switch ( pin )
{
case 3: /* txd */
r = ioctl(pgm->fd.ifd, value ? TIOCSBRK : TIOCCBRK, 0);
...
return 0;
I decided not to investigate the issue further (maybe somebody else will) but to try a workaround instead. I reconnected the AVR so that TXD would be used for the RESET pin of the device (it is not flipped often, so the 250ms do not hurt) and to connect RTS to the MOSI pin instead (thus switching RXD and RTS). Of course the lines have to be switched in the corresponding programmer section in avrdude.conf as well (or better make a new programmer entry for the modified setup). There is one kludge I ran into because I was experimenting with different avrdude versions - the numbering of the lines in avrdude.conf changed from version 5.1 to 5.2. From 5.2 on the numbers correspond to the numbers on the 9pin Sub-D PC connector, previously this was not the case.
Before this modification I had
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 2.29s
avrdude: Device signature = 0x1e9007
...
avrdude: writing flash (108 bytes):
Writing | ################################################## | 100% 205.29s
avrdude: 108 bytes of flash written
and afterwards:
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.20s
avrdude: Device signature = 0x1e9007
...
avrdude: writing flash (108 bytes):
Writing | ################################################## | 100% 8.12s
avrdude: 108 bytes of flash written
so I am now a perfectly happy perfectly normal slow USB serial AVR programmer user.
As a final note, I am using the ladyada recommended Mac OS X driver for the PL2303 chip (http://sourceforge.net/projects/osx-pl2303) and (now) an unmodified avrdude 5.6 (the newest 5.8 worked as well, as the modified 5.1 from http://ladyada.net/make/minipov3/software.html#macosx). And I do not know whether this problem is specific to the PL2303, the driver, Mac OS X, 10.5 or whatever - it probably is.