On 03/06/13 17:32, pozz wrote:
> I see there are three AVR Studio versions: 4, 5 and 6. Which one to
> use?
> I don't understand if a free C compiler is present in all of those
> versions or only for AVR Studio 6. Anyway I see there is a AVR 8-bit
> toolchain for Windows: could it be used in AVR Studio 4 too?
> I have an old JTAGICE debugger clone with RS232 interface only. I
> think only AVR Studio 4 supports this old debugger. Is it correct?

The "free C compiler" you are talking about is avr-gcc, which is the free "gcc" compiler targeted to the AVR, along with a matching libraries. The main "gcc" is written by volunteers and supporting companies, and is entirely free. The AVR port is also mainly volunteer work, but Atmel provides some support and backing for it. It is free software - you can download the source and compile it yourself. Atmel also provides packages with pre-built binaries, which is much more
convenient for most users.

I don't use AVR Studio much myself (it's windows-only, and version 5 onwards are based on MS Visual Studio instead of the industry standard IDE). So hopefully someone will correct me if I get the details wrong...

AVR Studio 5 onwards come with the avr-gcc toolchain. Each release of Studio has the latest Atmel release of the toolchain. AVR Studio 4 did not come with the toolchain, but it has convenient support for using avr-gcc. In those days, Atmel did not make its own releases of avr-gcc, so the common choice (on Windows) was the "WinAVR" packaging of avr-gcc.

If you need to use AVR Studio 4 to have support for your debugger, there should be no problem using it together with the latest "command-line" avr-gcc toolchain from Atmel. I very occasionally use AVR Studio 4 myself for debugging, though I never use it as an IDE or editor.

It is also perfectly possible to use the free debugger "gdb" for debugging with the AVR. You can use the latest version of Eclipse as your IDE and debugger interface, compile with avr-gcc (using Atmel's
packages if you like), and connecting to your jtag debugger using avarice. However, if you are new to this sort of thing and don't have someone nearby to help, then I'd recommend AVR Studio first.

Protostack many AVR tutorials and development boards on this site site consacré aux microcontrôleurs Atmel et à l'électronique numérique is pretty good for avr questions

newbie question; how to load code to chip?

  • The simplest way to get started is to use the SP12 interface: It's just a couple of resistors, some wire, a DB-25 connector for the printer port, and five connctions to the target system. With the SP12 software you can program the chip in your breadboard, after developing the software using AVR Studio.
    The AVRISP gadget is probably the best way for you to go.
    Building your own might be a bit cheaper (if you already have most ofthe parts) but $30 buys the assurance that the programmer and the
    programming software talk to each other and that the programmer itselfis assembled correctly.
    The AVRISP comes with two programming cables: a 2x5 and a 2x3. The 2x3cable is the same one that is used on the STK500. In fact, the STK500
    can be jumpered so that it can also be used to program parts on a separate breadboard using either of the two cables.
    For typical AVRISP in-system programming on a "real" circuit board, the 2x3 or 2x5 ribbon cables would plug into a 0.1"-center pin header. As
    you probably noticed, this won't work with the usual breadboard. What I do is use a cable that has a DIP-plug on one end and a 2x5 socket on the
    AVRISP end. The DIP-plug fits across the "valley" on the breadboard so the signals are separated.
    You could use individual jumper wires that plug between the breadboard sockets and the sockets on the ARVISP programming cable. That is OK but
    is also one more place where wiring errors can creep in...
    Note that it is recommended that the AVRISP *not* be plugged into or removed from the target board when the target board is energized.
    As far as the circuit needed, just match the corresponding pin-labels between the AVRISP termination plug and the pins on the AVR chip:
                                                      VCC .----.
             VCC             .----------------------------o    |
              .              |     .-----.                |    |
              |              |  VCC|     | MOSI      MOSI |    |
              '------o-------o-----o     o----------------o    |
                     |             |     |                |    |
                     |          GND|     | MISO      MISO |    |
                    .-.      .-----o     o----------------o    |
                    | |      |     |     |                |    |
                10K | |     ===    |     | SCK        SCK |    |
                    '-'     GND    |     o----------------o    |
                     |             |     |                |    |
                     |         RST*|     |           RST* |    |
                     '-------o-----o     |      .---------o    |
                             |     |     |      |         |    |
                             |     |     |      |     GND |    |
                             |     |     |      |      .--o ISP|
                             |     |     |      |      |  '----'
                             |     |     |      |      |
                             |     |     |      |      |
                             |     |     |      |      |
                             |     |     |      |      |
                             |     |     |      |      |
                             |     |     |      |     ===
                             |     |     |      |     GND
                             |     | AVR |      |
                             |     '-----'      |
                             |                  |
    (created by AACircuit v1.28 beta 10/06/04

    I probably have a profile very similar to your's (sofware guy wanted to learn more about digital electronic), and I bought a low-cost developement board that would:

    - allow me to become familiar with the AVR architecture without having to buy expansive programmers or even worse for me, having to build my own programmer...

    - use what I would learn to build my own system from scratch, using my development board to program the AVR.

    I ended up buying an AT90S2313 based board for $19.90: - I guess STK500 is around $100 ??? -

    The board came with a Windows application that would program the AVR on the board with the content of an Intel Hex file produced by avr-gcc or arv-as.

    I now have two boards working, the development one, and the one I built from scratch and am very proud of ;-).

    The AT90S2313 was good enough for me, but you can probably use the same approach and with an ATMega for $32.00:

    At the time I bought my board, programming software was only available for Windows 9x, which was not a problem for me since I had a multiple boot installation.

    (Using Windows 2000 drivers for making parallel port available to old DOS/Win9x software did not work for me)

    You may have to check with the vendor in order to know they have a new version of the software if you don't have a Windows 9x system available

    The following article does contain a lot of very valuable information for starting programming an AVR in C:

    Have a look at: this will give the schematics and software to build your own, plus a large explanation of the steps taken. un programmateur ISP ( In-System Programmer) Buttonbox2 atmel AVR AT90S2313 and AT90S8515 cpu

    ICC-AVR Demo z.B. at Embedded tools that make the difference™
    Universal thyristor driver using an ATMega163 ATMEL AVR microcontroller

    Nimm einen kleinen AVR Microcontroller und die beiden Application Notes:

    AVR243: Matrix Keyboard Decoder (11 pages, updated 01/03)
    AVR313: Interfacing the PCAT Keyboard (13 pages, updated 5/02)


    und bastel Dir einen passenden Tastaturcontroller. Wenn Du mal ins BIOS mußt, nützt Dir der Linux-Kerneltreiber nichts, und X11 will auch noch angepaßt werden.

    > Hi - does anyone have any experience with the SP12 programmer: - It looks pretty simple.
    Can it program most AVRs? Thanks!

    I've been using it for years, it works very well. I've used it on the 1200,
    2313 and 8515.

    Avr Projects Equipment:
    try and Tutoriel AVR ; Exemple de gestion d'une horloge DCF-77 avec une AT90S2313.

    Avec un programme de moniteur comme AVRMON-STK200 /tu peux debugger sur le l'Interface - ISP

    Add USB to your Product in 10 min.
    The World's Largest Range of Atmel/AVR & PICmicro Hardware and Software

    Das stimmt für moderne Compiler nicht mehr unbedingt. Vor allem dann, wenn diese Compiler - wie heute üblich - optimieren können.

    Beispiel: Ich habe mit dem CC5X eine Kleinst-Applikation in C für den PIC12C672 (2k RAM, 128byte ROM, kein Stackzugriff möglich) geschrieben. Dieser Compiler gibt das Compiat wahlweise auch in Assembler aus. Beim Studieren des in Assembler compilierten Ergebnisses habe ich gestaunt, daß der Compiler manches effizienter macht als ich es in Assembler hätte machen können - und dabei meinte ich bisher, mich beim PIC in Assembler brauchbar auszukennen.
    Aber ich habe vom Compiler sogar noch den einen oder anderen Trick gelernt. :-))
    Allerdings auch manchen Schnitzer des Compilers, der in der benutzten Freewareversion nicht so hoch optimiert, in zeitkritischen Schleifen ausbügeln müssen.

    In der Tat können Compiler die Binaries nahezu genauso effektiv (klein/schnel) wie Assembler compilieren - mit hohem Optimierungs- Grad sogar so effektiv, daß ein "normaler Mensch" sich weigern würde, den vom Compiler erzeugten Spaghetti-Code wirklich von Hand selbst in Assembler zu programmieren.

    Man darf diese C-Programme nicht verwechseln mit den unsäglichen Windows-Applikationen für den PC, wo riesige Libraries gelinkt werden und die dadurch langsam, groß und fehlerträchtig sind, daß jeder Assemblerprogrammierer (zu Recht) spottet, er könne mit einem 10tel der Codegröße die gleiche Funktionen hinbekommen...

    Damit ich aber nicht nur sinnlos herumlabere, hier noch ein paar Links für den Urspungsfrager:

    Für den AVR (der AT90S2313 z.B. dürfte passen) gibt es den (kostenlosen) C-Compiler "AVR-GCC", erhältlich auf:
    Als Entwicklungsumgebung empfiehlt sich das "AVR-Studio"
    (ebenfalls kostenlos).
    Ein passendes Programmiergerät wäre z.B. das SP12:
    Einführungen zum AVR-GCC finden sich u.a. auf: und
    Und für diejenigen, die Inline-Assembler im AVR-GCC nicht scheuen (beim AVR-GCC ist das wirklich nur was für harte Männer;-)

    extrem kleinen uC

    Der Atmel 2313 ist sehr klein ... hat aber leider keinen ADC wenn ich mich recht erinnere . Ein externer ADC ist aber auch nicht sooooo gross. Wenn alles in SMD gekauft wird, ist das sehr platzsparend siehe Stichwort Goldwaver in Google.

    Einen C Compiler gibt es auch. AVR Gcc bei z.B. Oder den CodeVision AVR Compiler von

    Auf meiner Webseite findest du ebenfalls Infos zu LCD programmierung ....

    Viel Spass

    Schon mal was vom AVR-Studio gehört? Eine bessere IDE für AVR-Programme kann ich mir nicht vorstellen. So wird's gemacht: Programmierer läßt sich selber bauen: - Eine Gehäuse welches auch auf Lochrasterplatinen angelötet werden > kann (DIL, PLCC). Ja, Dil 40pol oder kleiner je nach Typ. > - Soll nicht all zu teuer sein (max 20 euro). - Einfach erhältlich (bei Rei**elt oder so). Für 20 Euro bekommst Du locker den ATmega163 mit 16kb Flash, das reicht schon für recht große Projekte aus.

    check the schematics are on the web ATMEL PROGRAMMER

    I Think this simple ISP programmer will do the trick:

    T6963C LCD Library for AVR : Go to then click on the Academy tag. Go to "users own projects" and do a search for T6963C it turns up two projects!

    AVR starting tips:

    You can find a lot at, especially the instruction set for AVR assembly language and a nice collection of appnotes.
    You might also try They have a tutorial for beginners as well as some documented projects (a DCF clock for example). Nombreux liens pour le Atmel AVR entre autres microcontrôleurs AVRX AvrX Real Time Kernel Microcontroller board using the Atmel AVR AT90S8535 AVR controller LCD display routines AVR Resource Page AVR-Tutorial Hier findet ihr eine Schritt-für-Schritt-Anleitung zur Assemblerprogrammierung von AVR-Mikrocontrollern AVR-GCC Eine Installationsanleitung für den kostenlosen C-Compiler AVR-GCC Free AVR programmer Free AVR programmer

    links from: schematics at: AVR programmers
    AVR Programmer

    Retour à la page d'accueil

    6 juin, 2013

    Email :