avrdude-dev
[Top][All Lists]
Advanced

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

Re: [avrdude-dev] suggest a "programmer"?


From: Nicholas Flowers
Subject: Re: [avrdude-dev] suggest a "programmer"?
Date: Thu, 25 Feb 2016 00:09:41 -0500

Apologies for spam, but also for posterity:

The other problem I encountered was how to reset the target.  Completely
unhelpful thread at http://forum.arduino.cc/index.php?topic=381306.0.

Problem is: pin D7 on the U2 is a) connected to RESET via a capacitor, and
b) connected to ground by a 1K resistor.  What this means is, you can't
hold the target chip in reset.  My first attempt was to solder D7 to RESET
(bypassing the capacitor), but this didn't work because of the resistor (b)
(meaning, the chip would stay in reset... unless you drive it all the
time... but this would mean a short if you pushed the reset button on the
board, or other consequences).

Anyway, the way I got it to work: there are four pins brought out to JP5,
but without headers.  On the mega, these are pins B4..7.  Solder headers
into the holes, and use one of those as a "reset" driver.  Ignore D7.
Bonus: this leaves you with three extra pins to use however you like (flow
control?).

On Wed, Feb 24, 2016 at 11:55 PM, Nicholas Flowers <address@hidden>
wrote:

> For posterity: usbtiny works fine/great.  You only need to implement three
> commands: "powerup" (drive the SPI pins and reset the target), "powerdown"
> (release everything) and "spi" (bitbang a 4-byte SPI to the target).  There
> are other commands intended to speed things up (reading pages of data at a
> time), but even if you stall those, it falls back to those three and works
> fine.  I've tested writing fuses and flash (not eeprom, but surely works
> fine also).
>
> In addition, as discussed above, this requires no endpoints beyond the
> default endpoint 0.
>
> The only downside (so far): and thanks to David Sainty for pointing this
> out: is that it requires sudo to operate.  I'm not sure why this is, I'm
> guessing endpoint 0 messages require root, other endpoints don't?  (Which
> is why you don't need to sudo a normal ISP, because it is running over bulk
> endpoints).  I'm not sure why this would be.
>
> One thing I'm puzzled by is why the Arduino guys didn't do it this way (or
> analogously) to begin with.  If you have an onboard chip that can
> reset/program, why mess around with bootloaders and timeouts?
>
> Thanks to all for advice.
>
> On Sun, Feb 21, 2016 at 5:47 PM, Nicholas Flowers <address@hidden>
> wrote:
>
>>
>>> > ACM: requires 3 endpoints (2 data, and interrupt for line status).
>>> > Actually, as far as I understand the spec, the interrupt is supposed
>>> to be
>>> > optional, but the linux driver at least demands it.
>>>
>>> All drivers I have seen require the interrupt endpoint, even though
>>> it's pointless (pun intended :).
>>>
>>
>> Ha!  I just tried setting the ACM notification descriptor endpoint to
>> something I can't address anyway... seems to work just fine.  (I don't know
>> how the AVR reacts when it is pinged for data on an endpoint it can't even
>> reach... NAK?  STALL?  Let it timeout?)  The cdc-acm driver looks like it
>> does nothing with the notifications other than increment some counters you
>> can query via ioctl.
>>
>> So I guess it is possible to do ACM+Atmel if one is content with never
>> knowing whether you experienced an overrun.
>>
>> Regards,
>> Nick.
>>
>
>


reply via email to

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