Johnathan Corgan <[EMAIL PROTECTED]> wrote:
> I've spent the day hacking together an experimental implementation of
> serial programming via the FTDI FT232BM USB-to-serial converter bit bang
> mode. Mostly a success, so far.
> After familiarizing myself with the programmer_t abstraction and seeing
> how it is implemented in par.c and other files, I was able to create a
> new programmer type ('ftbb') and make a new programmer entry in
> avrdude.conf that uses it. I did consider first trying to fit into
> Michael Holtz' bit bang structure but there were more differences than
> similarities, so I went the new interface route.
> At the lowest level, there is a routine called ftbb_txrx() which sends
> and receives 8 bits over the bit bang bus of the FTD2XX.
> pgm->cmd builds on this and sends four bytes of a command and records
> the four bytes of the response.
> The other routines for open, close, enable, disable, initialize, erase,
> etc., are straightforward, making the right calls to the FTDI DLL.
> I am able to use the terminal mode successfully with an ATMega8 for
> everything I've tried so far. All the memory space read commands from
> the command line are working too.
> There does seem to be a subtle timing bug as I can do a chip erase from
> the terminal but not from the command line--the SPI bus falls out of
> sync and doesn't respond any further. I do have the usleep() call with
> the erase delay value in there, but maybe that's not where the problem lies.
> However--this implementation is *extremely slow*. It accomplishes about
> four commands per second, so reading 16 bytes of eeprom takes, for
> example, 4 seconds. This is due ultimately to requiring a USB packet
> per SCLK transition, with a 200ms or so fixed timeout inside the FTD2XX
> device driver DLL. (I know, Joerg warned about this--but stay with me.)
Learn about the latency timer inside the FT2232. I will encrease speed
substancial. Also try to send big chunks to the FT2232. This will encrease
speed too.
Bye
--
Uwe Bonnes [EMAIL PROTECTED]
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
_______________________________________________
avrdude-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avrdude-dev