[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avrdude-dev] avrftdi TPI support
From: |
Hannes Weisbach |
Subject: |
Re: [avrdude-dev] avrftdi TPI support |
Date: |
Mon, 6 May 2013 15:04:47 +0200 |
Am 03.05.2013 um 12:12 schrieb Hannes Weisbach:
>
> Am 02.05.2013 um 13:40 schrieb Hannes Weisbach:
>
>> Hello,
>>
>> as of SVN r1156, avrftdi now supports TPI (and I hope I didn't break
>> anything else in the process). I tested TPI support with all configurations
>> in the cartesian product {Win7 x64, Ubuntu Linux 12.04.2, OS X 10.6.8} x
>> {FT2232D, FT4232H} x {ATtiny10} (Thanks go to Joerg for providing the
>> ATtiny). Bug reports as well as success reports are welcome.
> I just had a look around and I noticed that all 'dumb' programmers
> (avrfdi_tpi.c, bitbang.c, usbasp.c)supporting TPI implement stuff like
> *_tpi_chip_erase() and
> *_tpi_program_enable() (setting guard time, sending skey, reading
> identification and status register)
> all for themselves. This is not necessary, since the two functions can be
> programmed by using only pgm->cmd_tpi() callbacks.
So, SVN r1166 provides avr_tpi_chip_erase(), r1167 avr_tpi_program_enable() and
in r1168 avrftdi makes use of these functions.
> So my idea is to add to the PROGRAMMER structure:
> - tpi_guard_time field
> - tpi_break() function
This was not necessary. The guard time is supplied as parameter to the
function. Therefore, the programmer cannot just set pgm->chip_erase to
avr_tpi_chip_erase(), but call it from a dedicated function.
tpi_break() is not needed, because if something went wrong it is retried and
eventually the code just fails. As I see it, for dumb programmers like avrftdi
it is not possible to discern if the part is in error mode, anyway.
Thus, the PROGRAMMER structure is unchanged.
> and implement avr_tpi_chip_erase() and avr_tpi_program_enable() globally in
> avr.c.
>
> avr_tpi_program_enable() can be called from every programmer after providing
> 16 init clock cycles.
> A programmer can set pgm->chip_erase() to avr_tpi_chip_erase(), if it wishes
> to do so.
> I think this way we can stay compatible to 'smart' and future programmers and
> reduce code duplication at the same time.
I have updated usbasp.c and bitbang.c. Because I don't have either one of those
programmers I provide the changes as patch files, so they can be tested and
applied if everything works.
Best regards,
Hannes
bitbang_tpi.patch
Description: Binary data
usbasp_tpi.patch
Description: Binary data
Re: [avrdude-dev] avrftdi TPI support, Ing. Daniel Rozsnyó, 2013/05/05
Re: [avrdude-dev] avrftdi TPI support, René Liebscher, 2013/05/05