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: Michael Holzt
Subject: Re: [avrdude-dev] avrdude bitbang devices patch
Date: Tue, 2 Aug 2005 23:41:22 +0200
User-agent: Mutt/1.5.8i

> First of all, again a big "Thanks!" to Michael for that contribution.

You are welcome. After all it was only about two to three hours of work.
Having the uisp code for comparision (and reuse of the initialisation)
helped.

> > I'm curious - why did you remove the 'static' qualifier from all the
> > par_xx() functions in 'par.c'? 

I've got lot of complaints when compiling so in a hurry i just changed all
of them. I will fix this in a new patch which will also incorporate the new
code introduced by Joerg.

> > par_highpulsepin() (which looks like it was renamed from
> > par_pulsepin()).

Not exactly. The original pulsepin did flip the bit twice while making no
assumptions about the state in the first time. So it would either do low ->
high -> low or high -> low -> high. This was implemented by reading the bit,
inverting it and writing it. I could not do this with the serial code as for
example when using the ponyprog serial style programmer one of the lines to
flip is txd. It seems there is no way to readback txd.

However the original function was a bad idea anyway because in both cases
where it were used, it ended up to be low -> high -> low. So i did what made
sense to me: I renamed the function to be clear about which kind of pulse it
would do, and got rid of the readback (which also will slightly increase the
speed). 

> It appears the serial bit-banging is abysmally slow, in particular on
> FreeBSD.  

Bit-Banging is slow. When i wrote the code, i saw some possibilities to
speed it up just a little bit. I will probably make some research into 
that.

> $Id$ lines are missing on newly added files.

This is because i'm really unaware about the use and notion of these lines,
so i left them out hoping that another one would add them.

> There's a lot of trailing white space in all the files.

In my patch? Or in avrdude general? I did not knowingly put trailing white 
space into the code, but i copied much old code.

> All documentation updates are missing so far, even the basic comments
> in avrdude.conf.in are a bit sparse.
[...]
> 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.

I would prefer to get rid of that undocumented and confusing number use. I
think it would be much more understandable if we had something like 'reset =
~txd' (for e.g. a serial device) or 'sck = d1' (for e.g. a parallel device).
I think it should be easy to implement this in a backward compatible way
just by changing thd lexer to interpret a token like 'txd' as it would be
the number '3'.

> The missing capitalization makes things hard to read. 

Pardon me? I'm not sure what you are talking about.

> 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.

Agreed, that was what i noticed and mentioned above.


Thanks for your feedback. I think with some polishing and fixing some things
and making them better, the code can shortly go into avrdude and will add a
important functionality.

I'm not sure, but i believe that - unlike the parallel port code - the
serial bitbanging would also work on an USB attached serial port. This is
interesting as more and more systems - especially notebook computers - are
coming without serial and parallel interfaces. So this would mean that
parallel bitbanging will be dead sooner or later, while serial bitbanging
may remain as a choice for a ultracheap programmer.


Regards
Michael

-- 
      It's an insane world, but i'm proud to be a part of it. -- Bill Hicks




reply via email to

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