avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avrdude-dev] avrdude bitbang devices patch


From: Joerg Wunsch
Subject: Re: [avrdude-dev] avrdude bitbang devices patch
Date: Tue, 2 Aug 2005 22:50:24 +0200
User-agent: Mutt/1.4.2.1i

As Brian Dean wrote:

> > As promised, i finished a new version of my patch. It can be found
> > at http://kju.de/misc/bitbang.diff.

First of all, again a big "Thanks!" to Michael for that contribution.
I think it's one of the more frequently requested items this code is
going to add now.  I guess if I eventually start to clone the JTAG ICE
mkII code for the mkI, we've covered any programmer on earth that is
in active use for the AVR.

> I'm curious - why did you remove the 'static' qualifier from all the
> par_xx() functions in 'par.c'?  Looks like the only functions that
> need to be external are par_setpin(), par_getpin(), and
> par_highpulsepin() (which looks like it was renamed from
> par_pulsepin()).

[I'll leave that question open here.]

> Otherwise, I think this looks good and should provide another useful
> programmer definition for folks.  You should add your name to the
> copyright in the files you have contributed.  See the copyright
> header for stk500v2.c for an example.

...as well as bumping the copyright year in any file that has been
touched, something that's quite often forgotten.

I've build the patched AVRDUDE on several systems, namely FreeBSD (4.x
and 5.x), Linux (2.6.x, AMD64 platform), and eventually also Win32
(see below).  It all works fine, though I've been pulling some of my
few hairs out until I noticed that a Linux-i386 binary simply didn't
work as expected on Linux-amd64, as apparently one of the ioctls (the
one to set/clear the break status) isn't implemented in the 32-bit
compat module.  Sigh.  A native rebuild on the amd64 system then
worked.  I've also verified the parport bit-banging adapter on my
"kitchentable" system (see below), and as Michael already noticed with
the STK200, that one continues to work fine.

Some random remarks and suggestions below.

Here are some timing values, taken for a full read of an ATmega128's
ROM on my kitchentable Toshiba Libretto 70ct (120 MHz Pentium):

Programmer  time [s]
ponyser          433
alf              182
stk500            41
jtag2fast         26

It appears the serial bit-banging is abysmally slow, in particular on
FreeBSD.  It's almost as slow on my 900 MHz Athlon desktop system, but
it seemed to be quite fast on the Linux system I've been testing (but
I've only got an ATmega16 there).

serbb_open() declares "int flags" inside function.  This breaks
compilation of a non-C99-aware compiler (as on my Libretto).  Better
declare that at the beginning of the function.

$Id$ lines are missing on newly added files.

Per the standard, C preprocessor command must start with the pound
sign in column 1 (but space might follow between the pound sign and
the command itself).

There's a lot of trailing white space in all the files.  I suggest
that new files should be stripped of it before entering the
repository.

All documentation updates are missing so far, even the basic comments
in avrdude.conf.in are a bit sparse.

The missing capitalization makes things hard to read.  I'd like to
avoid it for anything that is meant to be for public consumption
(avrdude.conf.in, documentation).

I've made a stab at implementing the meat of serbb_win32.c, basically
based on the documentation found on msdn.microsoft.com.  The result
has proven to work in a MinGW installation I've got access to at work.
The only point I don't understand, I didn't find any mention of the
DCD line in MSDN at all.  Does anybody know whether MS_RLSD_ON is the
Microsoft name for DCD, or is that something completely different?

Regarding the slowness of the serial bit-banging in FreeBSD, I think
the serbb_posix.c implementation could benefit from a locally cached
line status for all the output lines.  I've implemented it that way in
serbb_win32.c, but didn't touch serbb_posix.c yet.

The offset 7 for inverted IO lines in serbb was neither documented
nor very intuitive.  I thought a bit about it, and came to the
conclusion that a tilde before the pin number might be a more
comprehensible declaration.  The attached patch implements that.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

Attachment: serbb_win32.c
Description: Text document

Attachment: negatediff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]