Bygg din egen AVRISP-mkII

PIC, AVR, Arduino, Raspberry Pi, Basic Stamp, PLC mm.
thepirateboy
EF Sponsor
Inlägg: 2108
Blev medlem: 27 augusti 2005, 20:57:58
Ort: Borlänge

Bygg din egen AVRISP-mkII

Inlägg av thepirateboy »

Hittade denna tråd på AVR-freaks om att bygga en egen AVRISP-mkII
http://www.avrfreaks.net/index.php?name ... ic&t=83281

En AVR med USB kan alltså göras om till en AVRISP-mkII "kopia".

Man får förstås inte med de kortslutningsskydd som finns i originalet men rent mjukvarumässigt ska den fungera nästintill likadant.

Eftersom jag har ett kort med AT90USB162 gjorde jag ett snabbt test. Körde in programmet via bootloader och efter omstart
dyker den som en AVRISP-mkII.

Kopplade upp enligt instruktioner och försökte progga en Atmega88 med AVR-studio. Fungerade på första försökte och den verkar
vara lika snabb som originalet.

Rekommenderas för den som vill ha en billig, AVR-studio kompatibel programmerare!

Bild
thepirateboy
EF Sponsor
Inlägg: 2108
Blev medlem: 27 augusti 2005, 20:57:58
Ort: Borlänge

Re: Bygg din egen AVRISP-mkII

Inlägg av thepirateboy »

För dom som inte kommer in på länken ovan klistrar jag in infon här

Kod: Markera allt

Freaks,

My latest and greatest side-project is now complete - that is, it's now usable. It's taken me a week and a half to do it, but I've developed the firmware to turn any Atmel USB AVR into an AVRISP-MKII. That's right, native USB!

What is it?

An AVRISP-MKII, obviously. Actually, it's a clone, but using entirely open source firmware rather than just ripping of Atmel's binaries from a real AVRISP-MKII.

Why AVRISP-MKII over AVR910 or other protocols?

Using the official AVRISP-MKII protocol means the programmer will integrate with AVRStudio seamlessly and exposes more features than the simpler AVR910 or similar counterparts.

Why AVRISP-MKII and not an AVRISP-MKI?

The AVRISP-MKII uses native USB drivers, and since I've written the code for my LUFA USB stack, it seemed like the logical thing to do. With later extensions, the native USB will allow for even better features than the real AVRISP-MKII, such as alternate modes of operation (e.g. USB-to-Serial, USB-to-SPI/I2C converter, bitbanger).

The AVRISP-MKII protocol is slightly better than the original's in that it requires less packet massaging and has more features like short-circuit and reversed-connector warnings. Unfortunately, neither of these are currently in the firmware, but I'll add them in the future.

What's the benefit?

Cheaper, if you go for the bare-bones approach or build it entirely yourself. Free if you've already got a USB AVR board around and want to re-use it as a second programmer.

Many people also are starting out with cheap ~$20 USB AVR boards, and want to try out other AVRs later. This gives their initial purpose some extra value outside its use as a general development board.

In the future, new firmware updates will give added functionality to the device. Adventurous programmers could also hack the firmware themselves to add features that they desire.

Caveats?

Since you build it yourself, you make it as cheap as you like. The simplest form would be something like the $20 Teensy, AVROpendous or Bumble-B boards, with no extra circuitry. Adding level converters, etc. would obviously add to the cost of the unit.

Currently, programming modes below 125KHz aren't supported, since I'm using the hardware SPI unit at this time. In theory, it can program with a SCK frequency of up to 4MHz for a USB AVR running at 8MHz, or 8MHz for a USB AVR running at 16MHz.

As mentioned above, currently there's no short circuit or reversed target detection, so be careful when hooking it up.

If used on an AVR with no ADC subsystem, VTARGET detection is disabled and the device will always report 5V.

This package contains an in-development version of my LUFA stack, which is NOT FIT FOR USE outside of this project. If you wish to try out the rest of the LUFA stack, please download it from the official project page instead.

How do I build it?

First, you need to download the attached package, and edit the makefile to suit your chosen USB AVR target. In the makefile, you can set the pins used for VTARGET detection and target RESET. Build the package by running a "make all" from the command line.

Program the HEX file into your chosen USB AVR. For this you can use another programmer that you have, or you can load it with Atmel's FLIP software via the USB bootloader which comes preloaded into every USB AVR.

See the included text file for target connection information. Ideally, you should build the project documentation using Doxygen, but it's still readable in its unprocessed form.

Feedback Appreciated

This is a first revision project, and is only a very minor part of my much larger LUFA USB stack for the USB AVRs. From the next official release, this side-project will be included to show off a practical application built with the library.

Please give feedback here, so I can improve the code!

- Dean 
Användarvisningsbild
E85
Inlägg: 1274
Blev medlem: 29 maj 2007, 16:24:19
Ort: Övik

Re: Bygg din egen AVRISP-mkII

Inlägg av E85 »

Verkar intressant men hur får man tag på en billig AT90USB i sverige?
thepirateboy
EF Sponsor
Inlägg: 2108
Blev medlem: 27 augusti 2005, 20:57:58
Ort: Borlänge

Re: Bygg din egen AVRISP-mkII

Inlägg av thepirateboy »

Lawicel har väl en del kort, dock inga riktigt billiga. Någon annan leverantör för privatpersoner känner jag inte till.

Jag har ett gäng AT90USB162-16AU som jag säljer för 30kr/st om någon är intresserad.
Användarvisningsbild
Gildebrand
Inlägg: 1108
Blev medlem: 8 maj 2009, 21:40:49
Ort: Falun

Re: Bygg din egen AVRISP-mkII

Inlägg av Gildebrand »

Hittar inte ritningarna :/
thepirateboy
EF Sponsor
Inlägg: 2108
Blev medlem: 27 augusti 2005, 20:57:58
Ort: Borlänge

Re: Bygg din egen AVRISP-mkII

Inlägg av thepirateboy »

Detta kan du följa, extern matning kan du skippa.

Hur du kopplar in den mot målprocessorn får du lista ut själv.

http://www.olimex.com/dev/images/AVR/AV ... 62-sch.gif
frejo
Inlägg: 496
Blev medlem: 21 april 2004, 21:43:01
Ort: Linköping

Re: Bygg din egen AVRISP-mkII

Inlägg av frejo »

Här kan man köpa devkit för AT90USB162:
http://www.lawicel-shop.se/shop/custom/ ... &refcode=f
Mindmapper
Inlägg: 6470
Blev medlem: 31 augusti 2006, 16:42:43
Ort: Jamtland

Re: Bygg din egen AVRISP-mkII

Inlägg av Mindmapper »

Nackdelen är väl att den kostar väl ungefär lika mycket som att köpa en programmerare.
Skriv svar