[TriEmbed] Followup from monday's presentaiton
jonjwolfe at anibit.com
jonjwolfe at anibit.com
Wed Dec 16 10:09:20 CST 2015
Thanks to everyone who sat through my rambles Monday night.
As I mentioned in my presentation, minutes before heading to NCSU on
Monday, I "bricked" my Arduino UNO clone that I planned to use in my
demo.
I figured I give a little follow up and background to what happened.
I had planned to demonstrate debugging code from Atmel studio on the
Arduino board using the six pin header ICSP on the board and one or both
of my "DebugWire" capable Atmel programmers I have. The 6 pin header
supports 2 protocols that are built into the circuitry of most smaller 8
bit AVR chips, the "Debug Wire" protocol and the "ISP" (In-system
programming) protocol. These protocols are enabled/disabled via "fuses"
(non-volatile flags) on the chip. The ISP protocol is built on top of a
"SPI" setup and uses 4 of the 6 pins to program the memory, but does not
have support for debugging. The Debug Wire protocol only uses one pin of
the header (it re-purposes the reset line) and supports uploading code
and debugging, but is slower, and is also undocumented by Atmel, which
is one reason none of the open source and cloned programming hardware
supports it).
The "Debug-Wire" and "ISP" modes on the AVR chip are mutually-exclusive.
When the Debug Wire interface is turned on via a fuse, the ISP circuitry
is disabled. This is normally not a problem because the Debug Wire
protocol has commands for disabling itself, and restoring the ISP
functionality.
My problem arose because on my Arduino clone, like many of Arduino and
clone designs, the reset line had been attached to a capacitor that
allows the USB-serial device on the Arduino to reset the chip. That
capacitor interferes with the Debug Wire protocol on the reset line,
leaving the chip with no way to restore ISP functionality. The
work-around is to de-solder, or cut the trace to the capacitor. The
problem with that is now you interfere with the original Arduino
functionality. The Arduino IDE will be unable to reset the chip, meaning
every time you want to upload code via the Arduino IDE, you will have to
manually press the reset button on the board.
It would be nice if the Arduino boards included a jumper to disconnect
the cap from the reset line, but I get that the could add cost to the
board for supporting something that might be viewed as an obscure use
case.
If I had not waited until the last minute, I could have figured this out
by the presentation time, and had been a little better prepared. Sorry
about that.
Incidentally, the Arduino Mega, which uses the ATmega 2561, does not
suffer from this issue, mainly because it does it does not support the
Debug Wire protocol, it uses JTAG, like most of the other larger 8-bit
AVRs, to do debugging. The JTAG circuitry is not connected to the 6 pin
ICSP header pins, but uses a different set of pins on the 2561, which
you can connect to individually on the Arduino Mega to debug it (This is
unverified by me, but I believe it to be true).
--Jon
More information about the TriEmbed
mailing list