Search code examples
atmelattiny

Recommend Attiny85 compiler/IDE


I need to compile C project for Attiny85 but not sure which compiler to use - free if possible. Is Atmel Studio a good choice?


Solution

  • Complier

    Free and the best compiler for AVR is AVR-GCC (in Windows it's called WinAVR).

    It supports ATTiny85 (here is the list of supported devices).

    So you just need to pass this option to compiler:

    -mmcu=attiny85
    

    You can look here for Makefile example.

    Flashing software

    To upload your firmware to ATTiny85 chip, you can use AVRDude program. It's free and most popular application for flashing AVR chips. See this for usage example.

    IDE

    As for IDE, there are plenty of them out there, but IMHO two best choices would be:

    1. Vim: if you prefer console applications. Especially good for Linux. I would recommend to use next plugins: cscope, CTags, OmniCompletion, NerdTree. Still, if you don't know vim yet, it would take a lot of time to learn it and configure it properly (I'm personally using vim).
    2. Eclipse: if you prefer GUI applications. It's very flexible, free, cross-platform and extremely powerful. It's very easy to configure Eclipse for AVR development (to use AVR-GCC and AVRDude). There is Eclipse plugin for AVR. And you also can find a lot of tutorials in web about how to use Eclipse for AVR development.

    If you are novice, I'd say -- go with Eclipse.

    Debugger

    For debugger I would recommend GDB. GDB is free and very powerful debugger software. It's easy to integrate GDB into Eclipse

    Also you will need AVaRICE to connect GDB with JTAG.

    Note

    All software I mentioned is free, cross-platform and actually being used for professional embedded development, so you can use it without second thoughts. Actually, it's almost single choice you have out there, except for IDE (still, my colleagues at work use mostly Vim and Eclipse, 50/50, so I think there is not much choice here as well).

    Another good thing is that it's very easy to migrate to another MCU (from AVR) if you stick to software I listed above. E.g., for MSP430 there is similar GCC toolchain and similar flash software, and GDB of course. So you can just configure Eclipse to use msp430-gcc instead of avr-gcc and develop for MSP430.