NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » AVRISP-MKII Clone

October 31, 2013
by Noter
Noter's Avatar

I stumbled on this AVRISP-MKII Clone earlier this evening and since I had an extra at90usb162 in the parts box I decided to give it a try. Took a few hours and lots of searching to finally get it working on my ubuntu 12.04 box and I was about to give up but gave it one more reboot and that did it, everything fell into place and avrdude started working with it. This MKII clone is incredible, downloads a 7278 byte hex file in 0.47 seconds. Then verifies it in another 0.21 seconds - that's really fast! And the best news is it's a TPI and PDI programmer too although I haven't tried those yet. The TQFP is the MKII clone and the DIP is the target. The MKII has a 16mhz crystal ... not much to it on the hardware side.

pic

November 01, 2013
by esoderberg
esoderberg's Avatar

That is an impressive bit of work for one evening. If my MKII craps out on me I just may have to try this out as well, although I suspect it'll probably take me more like a week.

November 01, 2013
by BobaMosfet
BobaMosfet's Avatar

Noter-

That's really nice! Elegant. I normally program AT THE 2.0Mhz rate with my AVRisp MkII, and find it plenty fast. I'm curious what speeds other people are using.

BM

November 01, 2013
by Noter
Noter's Avatar

Since I'm new at the mkII I don't know the rate it actually used but I had -B0.1 on the command which would be 10mhz so I think it ran at whatever the max rate is.

TPI wasn't working for me so after trying everything I could think of I hooked up the logic analyzer and after a while found the problem. About the first thing I do with an ATTiny10 is disable the reset so I can use the pin for normal IO which means I have to program with HV (12v) on the pin. And to get the 12v I use a MAX662 which as I now know takes about 800us to rise to 12v. But the mkII was only waiting 1us and was well into transmitting when the ATTiny10 came to life as can be seen in this analyzer screen capture. The rising line is the scope on the reset pin, Ch4 is mkII xmit clock, Ch2 is mkII xmit data, Ch3 is tiny10 data rcv/xmit, and it looks like the tiny starts listening when the reset pin is about 7 volts. The good news is the fix was pretty simple. Had to wade thru the mkII code a bit and then just change the delay from 1us to 1ms.

TPI setup -

TPI

Next is PDI for the xmega. I expect it will go easy compared to the TPI.

November 01, 2013
by BobaMosfet
BobaMosfet's Avatar

Noter-

I've not gotten to play with the ATTiny10 yet, although it's on my list. Is there a fuse like on other Atmel chips for a delay after startup (so the oscillator can settle)?

BM

November 02, 2013
by Noter
Noter's Avatar

The ATTiny10 has only one fuse and only three settings - ClockOut, WatchdogON, and ResetDisable. It starts with an internal 8Mhz/8 clock or 1Mhz so whatever delay after startup is fixed. Then from code you can change to 8Mhz, use the watchdog timer at 128Khz, or switch to an external clock.

November 05, 2013
by Noter
Noter's Avatar

Here's the mkII clone hooked up with an xmegaE via PDI and it downloads the xmega hex file quickly with a 250K baud setting. I was surprised to find there is no voltage level conversion between the pins on the mkII (at90usb162 at 5v) and the PDI pins on the xmega even though the xmega is powered at 3.3v via the LDO regulator in the center of the breadboard. The mkII Rx/Tx pins are tied via a couple of 220 resistors to make the PDI-Data line to the xmega.

The open source AVRISP-MKII clone seems to work very well for SPI, TPI, and PDI programming protocols so I've decided build a couple of these and retire all my old AVR910 based nerdkit programmers. I also built and used the open source usbasp programmer (http://www.fischl.de/usbasp/) to program the at90usb162 with the mkII clone hex and it works well too.

xmega

Post a Reply

Please log in to post a reply.

Did you know that signed numbers need to be sign-extended when chaging variable sizes? Learn more...