[chbot] Atmel Programmers

Charles Manning cdhmanning at gmail.com
Thu Oct 20 23:37:18 BST 2011


On Thu, Oct 20, 2011 at 10:56 PM, Volker Kuhlmann
<list0570 at paradise.net.nz> wrote:
> On Wed 19 Oct 2011 11:36:58 NZDT +1300, Jasper Mackenzie wrote:
>
>>   At the last meeting I was talking to a few of you about programmers as I
>> need to move away from the wonderful butterfly to more wonderful things
>> like attiny's...
>
> I posted on programmers semi-recently. Basically I don't see a market
> for them. AVRs are programmed over their ISP interface, which looks to
> me like it's conceptually pretty close to SPI. You can use any Arduino
> for this, burn the boot loader sketch from the IDE menu onto the
> Arduino, hook up your target CPU and you've got your STK500 compatible
> programmer. If you use the Arduino boot loader afterwards, you only need
> to do this once. I wouldn't make a PCB for that. Small Arduinos are
> cheap, so it depends on how many hours you want to spend to save $20.
>
>> Synco said he was using a usbprog which does seem like a very complete
>> programmer. My questions with this programmer are:
>>   a) can it do 1-wire debug - I couldn't find anything on the the usbprog
>> website to suggest so. If not, is there a DIY programmer that does?
>
> No and no. Atmel's debugWIRE is proprietary, specs are not available,
> not even under NDA. It works by bit-banging the reset line. It's only
> used for debugging, not for programming. The ...CN JTAG adapter from a
> Chinese manufacturer James mentioned supposedly does debugWIRE. They
> don't answer emails though and there's no good supplier. The other cheap
> box that does it is Atmel's Dragon. What they don't tell you is that it
> will only work with avrstudio (or whatever it's called) under 'doze.
> That's because those JTAG etc adapters contain no software, only pin
> drivers, voltage level converters and some such, so all the control
> happens from some software that knows the details of debugWIRE. Needless
> to say, there's no Linux version available.
>
> JTAG adapters are also used for programming, but to buy one just for
> that would be silly. You're out of luck again on the small AVRs - only
> the ones in the Arduino Megas have JTAG interfaces, on the smaller ones
> there aren't enough pins to go round and there's debugWIRE only. It
> won't program your chips anyway.
>
>>   b) How in the heck as a total C n00b do I use the jtag etc. meaningfully?
>
> The usually successful n00b approach with anything is one step at a
> time... :-)
> C and JTAG are two different things. If you don't learn to program in C
> you will not become happy with microcontrollers (unless maybe you
> restrict yourself to the really big ones - tip: the attinys are not
> it...). I find C++ an improvement over C. A few things are different,
> and a few don't apply to microcontrollers - like exceptions and
> templates (which you can't/don't want to use).
>
> If you're that new to microcontrollers you seriously should start with
> one of the Arduinos and its bootloader. Plug it into your USB and be
> done. The whole Arduino environment is superb for quick starts, though
> the IDE in the long run isn't quite professional enough. No debugging
> though, other than by what's known as the printf() method, but that does
> go a long way.
>
> You don't buy a JTAG adapter just for programming, it's a waste. If you
> do get one, don't get any from anyone who also sells software, they're
> almost always proprietary rubbish. Good suppliers are Amontec and
> Olimex. Make sure you get a hispeed one (480MBit/s), from what I've
> gathered so far the 12Mbit/s ones drag you down too much. The only
> open-hardware adapter I've seen is the Flyswatter, unfortunately it's a
> slow one. It'll work, but probably not comfortably enough. You need
> openOCD for that, which I'm about to try. I'm still getting the eclipse
> AVR plugin to work, it's pretty buggy (the plugin, not eclipse). My goal
> is to have this working for ARMs and possibly PIC32 too.
>

Volker

The speed you need for ARM JTAGing will depend very much on the
devices you are programming/debugging.

If you're working with micros with built in flash (ie. smaller parts)
then you really don't need high speed. High speed is a bit more
important if you are working with large images (eg. using JTAG to
debug a Linux kernel on an omap).

OpenOCD works great with a wide variety of programmers. I have used
the FTDI-based devices (eg. Amontec JTAGKey Tiny).

The only real difference between this and the FlySwatter is that the
Flyswatter supports a wider voltage range.

These devices can shift approx 0.5Mbytes per second (depending on
device) so loading a  debug image on a smaller ARM is sub-second and
stepping, debugging etc is instantaneous.

The FTDI-based devices can also be used to do Atmel AVR programming
using AVRDude. That means one programmer can do multiple functions.



More information about the Chchrobotics mailing list