Newbie? Start here!

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 3

Stu's Sticky Stuff for Starting Students' Stupification, Edification, and Elucidation

Are you a complete newbie? Or maybe you've been programming PC's for years, but just got handed an AVR project. No matter what your learning level, here it is... :lol: Stu's Complete List O' Newbie Links!

How to ask a question:

First of all, learn how to ask questions the smart way. Please visit [url= site[/url] (There are translations into most languages, so not being able to read English is not an excuse.)

In particular, pay special attention to:
- [url= You Ask A Question[/url]
Of course if you follow all that advice and still cannot answer the question you have then of course feel free to start a thread about it here - or post onto the end of a related thread (IF it is relevant!).
- [url= Not To Ask[/url]
- [url= Stupid Question, Smart Question[/url]
- And, most importantly, [url= To Ask A Question[/url]

While you're at it, please read [url=, My "..." Doesn't Work![/url]

Where to ask that question:

You should not post a reply to this thread! Instead, if you have a question that is not answered in one of the tutorials below, ask in the appropriate AVR Freaks community. It is more likely that you will get a fast answer:

o AVR GCC forum - GCC specific questions, including WinAVR and Avr-libc (NOT AVRLib, the UART library - post those to the AVR forum)

o AVR studio 4 forum - AVR Studio problems, not compiler related.

o AVR forum - non-GCC specific questions, questions about commercial compilers and general questions about AVR processors and code for them

o General Electronics forum - Questions about electronics other than AVRs; Relays, thermocouples, LCDs, LEDS, FETs, PLLs, resistors, and stuff like that.

Posting your code with the question:

When you post code, you can make it easier to read by highlighting the code and then pressing the Code button on the submit page.

Your code
   will then

(assuming you put indents in your code)(Weirdness alert: The AVR Freaks site does not like printf formatting strings in the Code section (the percent sign gives it heartburn) - replace the percent sign with @ or * or just remove them, and let us know you did it)

Important Forum Search Tip:

When you are searching for some phrase in the forum and you want the search engine to use all of the terms, you need the "Advanced forum search" engine for this to work. Pressing the little "magnifying glass" icon in the frame to the left is not the Advanced forum search. Instead, go to the top of the page - there you will find a little tab "search forum". That is the Advanced Forum Search. Be sure to click on the "Search for all terms" button.

Now, let's get to the good stuff!! :D

Beginner sites/topics:

[url=]Arduino development board[/url] Arduino is a simple, cheap, and complete development board for AVR newbies with a large community support. Tools are easy to use, but are limiting for advanced applications.

Arduino newbies should also check out Smiley Micro's new book, [url= Arduino Workshop[/url]. He also sells a [url= with all the pieces you need for the projects in the book.

[url= From-Scratch AVR Tutorial[/url]

[url= to get started with microcontrollers - Part 1[/url]
[url= to get started with microcontrollers - Part 2[/url]

[url= Arnie Aardvark's AVR Aperçu[/url] - Chuck Baird frequently posts in this forum!

[url=]Book and Dev Kits: Smiley Micros[/url] - Smiley frequently posts on this forum!
In particular, check out [url='s Workshop[/url], a series of articles from Nuts and Volts

[url= Electronics - Beginning with everything[/url]

[url= USB Development Board - < $25[/url]

[url=]ZBasic microcontrollers, Basic programmed, AVRs inside[/url]

[url= Evil Mad Scientist page with tool pointers and lots of cool "small" projects you can build![/url]

Learning AVR Assembly:

[url='s Programming in AVR Assembly[/url]

[url=]A good site for learning both assembly and some electronics[/url]

[url= Instruction Set Document[/url]
(Users of the ATXmega series should also get the [url= XMEGA A Manual[/url] for more information on the architecture extensions.

[url= Architecture "schematic"[/url] (unofficial, of course)

And don't forget books!

[url= Programming Microcontrollers using Assembly Language (Chuck Baird)[/url]

Learning C:

[]AVR C tutorial[/url]

[url= Tutorial: C Made Easy[/url]

[url= C Programming Works[/url]

[url= C Programming Tutorial[/url]

[url= Tutorial on Pointers and Arrays in C[/url]

[url= tutorial[/url] and [url= Functions[/url]

[url= for writing efficient C/C++ code[/url]

And don't forget books!

[url= C Programming Language[/url] is essential and should be on every C programmer's shelf. An eBook version of this is available [url=

[url= Beginner's Guide To C[/url]

[url= Solid Code[/url] I personally recommend this. Lots of good tips.

[url= Programming for Microcontrollers Featuring ATMEL's AVR Butterfly and the free WinAVR Compiler[/url]

[url= and Customizing the AVR Microcontroller[/url]

[url= C Programming and the Atmel AVR[/url] Reputedly a good book, but it's expensive (> $75 used)

Again, check out [url=]Smiley's[/url] books.

Compilers, Simulators, IDEs for the AVR:

AVRStudio 4:
[url= Studio - IDE, Debugger, and Simulator(s) and Assembler[/url] free!
NOTE: AVRStudio does not include a C Compiler - see below.
(Using Windows 7/64 bit? Be sure to read alenze's response in [url= thread[/url])

AVRStudio 5.1:
[url= Studio - IDE, Debugger, and Simulator(s) and Assembler[/url] free!

AVRStudio 6:
[url= Studio - IDE, Debugger, and Simulator(s) and Assembler[/url] free!

[url=]W... - GCC (C/C++ Compiler), AVR-Libc, and other utilities, packed for Windows[/url] free!
(Running Linux? Be sure to use [url= AVR-GCC on Ubuntu[/url])
(Running 64-bit Vista or Windows 7? Check out [url= on Vista 64-bit[/url]
Looking for the latest pending/fixed bug list? [url= this out.[/url]

[url= Eclipse on Ubuntu[/url]

[url=]IAR Systems - commercial IDE and C/C++ Compiler for lots of processors (demo is free)[/url]
(Need to move IAR to GCC? Check out: [url= code from IAR to Avr-GCC[/url])

[url=]Image... - commercial C compiler (demo for 45 days is free)[/url]

[url=]CodeVi... AVR - commercial IDE and C/C++ compiler[/url]

[url= - Basic for AVR processors[/url]

[url=]HAPSIM - Nice AVR simulator with peripherals[/url] (requires AVR Studio) free!

[url=]VMLab - a cool IDE, Simulator, and Debugger; allows adding simulated peripherals[/url] free!


No matter what language you are going to program in, you will need to debug your code. I have been programming for close to 40 years, professionally for more than 30, and I constantly debug my code. Try reading the following for debugging hints:

[url= Practice Of Programming, Chapter 5, Debugging[/url]

Other Cool Toys:

Don't use HyperTerminal; that's like using stone knives and bear skins! Instead, check out:
[url='s Terminal - a very nice terminal emulator[/url] free!
[url=]Te... - a script-able terminal emulator (and what I use!)][/url] free!

[url= - Calculator of AVR-specific stuff[/url] free!

[url= Rate Calculator for ATXmega (Excel spreadsheet)[/url] free!

Need a gadget to sniff an I2C or SPI bus and talk back to your PC? Check out [url= Pirate[/url] (PIC based - :-P )
[url= has them for about $30.

Tutorials and Good Manual Entries:

The [url= Tutorials[/url] forum of contains a lot of stuff for you:

[url= Interfacing 101, a.k.a. Tips & Tricks[/url] Especially valuable for 3.3V-to-5V interfacing!

[url= [SOFT] WinAVR Beginner's Quick Start Guide for ATMEGA128[/url]

[url= [SOFT] Setting Up AVRStudio to use GCC[/url]

[url= [HARD] AVR Programming Methods[/url] - "Programming" here means loading your compiled code on to your AVR

[url= Recovering from a 'locked out' AVR[/url] How to recover if you have an ISP "accident" with the fuses

[url= [C] Bit manipulation (AKA "Programming 101 For Embedded Code")[/url]

[url= [C] Basic LEDs & Charlieplexing, mild beginner[/url] A good introduction to lighting LEDs (and using C) with your AVR

[url= [C] [GCC] How to define a pin as a variable[/url]

[url= [C] Modularizing C Code: Managing large projects[/url]

[url= Optimization and the importance of 'volatile' in GCC[/url] Get a deeper understanding of why breakpoints and watch windows don't always seem to work

[url= [C++] AVR C++ Micro How-To[/url]

[url= Newbie's Guide to AVR Interrupts[/url] If you want to use interrupts, start here!
[url= The traps when using interrupts[/url] An excellent introduction to interrupts!
[url= Handler Syntax, By Compiler[/url] (Look here if for compilers other than AVR-GCC (WinAVR))
(also check out [url= Manual: Interrupts[/url])

[url= [SOFT] Using the USART - Serial communications[/url]

[url= [SOFT] Using the USART - Interrupt driven serial comms[/url]

[url= [C] Newbie's Guide to AVR Timers[/url]
Also check out [url= [C] PWM for complete idiots[/url] PWM => Pulse Width Modulated, a method for generating an Analog signal from a Digital output.

[url= [C] Creating an RTC using an internal counter/timer[/url]

[url= [C] Using the EEPROM memory in AVR-GCC[/url]

[url= [C] GCC and the PROGMEM Attribute[/url] - how to store strings and constants in program flash instead of SRAM.

[url= [C] Newbie's Guide to the AVR Analog-to-Digital Converter (ADC)[/url]

[url= [C] Bootloader FAQ[/url] A "bootloader" is how you can download new programs into your AVR without the use of external programming hardware. You do have a "chicken and egg" problem, though: the bootloader must first be programmed into the AVR using hardware! (Exception: The AT90USB* parts have a bootloader programmed in at the factory)

[url= CRC and App Length to Hex files[/url]

[url= Note: Bidirectional SPI[/url]

[url= [C] AVRGCC: Monitoring Stack Usage[/url]

[url= Design Notes - lots of cool topics here![/url]

[url= with the Atmel JTAG-ICE mkII (video tutorial)[/url]

[url= [SOFT] How to install JTAGICE mkII on Windows 7 x64[/url] (Also works for Dragons!)

[url= to State Machines for Microprocessors[/url]

Good stuff from the AVR-Libc Manual:

[url= Manual: Index[/url]

[url= Manual: Frequently Asked Questions[/url]

[url= Manual: Memory, Malloc, and External SRAM[/url]

[url= Manual: Delay Routines[/url]

[url= Manual: Interrupts[/url]

[url= Manual: How to Build a Library[/url]

[url= Manual: Inline Assembler Cookbook Manual[/url]
[url= Manual: Mixing C and Assembly - Demo[/url]

[url= Manual: : Standard IO Facilities[/url]


The following are "libraries" of routines for talking with peripherals, both internal and external. They are not pre-compiled libraries (as many from the PC world are used to), but instead C source that must be included with your project and compiled. Still, they can be a great head-start on a difficult project.

[url= Stang's Procyon AVRlib[/url] (unsupported, but does lots of cool stuff. Last updated in 2005.)

[url= Fleury's Online AVR Software[/url] (also unsupported, includes LCD, UART and I2C (TWI) Master code, among other things. Last compiled on WinAVR 20060125)

Other good topics:

Note that Atmel's code for their app notes is written for the IAR compiler. If you are using GCC (WinAVR), check out [url= code from IAR to Avr-GCC[/url]

[url= and Feeding of the AVR Dragon[/url]

[url= Twiddling Hacks - different ways of doing different logical and arithmetic operations[/url]

[url= Math in C[/url] Wiki article: Fixed-point math - Q {number format}
[url= math library for the AVR[/url]

[url= to the "Volatile" Keyword[/url]

[url= Optimization flags - what they mean[/url]

[url= [ASM] Dirty Math Tricks: Adventures in Division by Ten[/url]

[url= Switch Debouncing[/url]
[url= Key Debounce Code[/url]

[url= and Feeding Of Watchdog Timers[/url]

[url= of all AVR processors[/url]

[url= MP3 with AVRs (warning: extra chip required)[/url]

[url=]... Kits - Tutorials and projects on all kinds of newbie subjects (plus some newbie kits)[/url]

[url=]Sylvain Bissonnette's Projects site - lots of neat projects![/url]

[url= [HARD] Gyros and Accelerometers: The Basics[/url]

A list of RTOS links for AVR processors:

First off, check out the RTOS list in the Tutorials section: [url= RTOS for AVR[/url]

All of the following are in the above tutorial

[url=]FreeRTOS: A Free RTOS for microcontrollers[/url]
Here's [url= for ATmega2560/1[/url]
Here's [url= for an ATXmega[/url]

[url=]AvrX: Real-Time Kernel for AVR processors[/url]

[url= Yet Another Atmel AVR Real-Time Operating System[/url]

[url= A tiny OS for small AVRs[/url]

[url= RTOS Kernel (for larger AVR processors >= mega128)[/url]

[url=]... Non-Preemptive Priority-based Multitask RTOS[/url]

[url= - good for smaller RAM, marked "beta"[/url]

[url=]Femto OS - GPL'ed RTOS, small but commercial folks beware[/url]

Advanced Topics:

[url= Scripts[/url]

[url= Hardware Random Number Generation[/url]

If you want to talk to many LEDs but are restricted in port pins, you may want to consider "Charlieplexing":
[url= DIY, How-To[/url]
[url= Reduced Pin-Count LED Display Multiplexing[/url]

[url= [C] Getting SD/MMC card working painlessly with FatFS[/url]
[url= to use MMC/SDC (Attaching SD cards through the SPI)[/url]
[url= File System Module for AVR[/url]

[url=]Open source Hardware and Software for AVR Ethernet[/url]

[url= Book: The Scientist and Engineer's Guide to Digital Signal Processing[/url]

[url= ADC-to-dB conversion algorithm (read whole thread)[/url]

[url= In A Nutshell - an introduction to USB[/url]
Also check out [url= (AKA MyUSB) - USB AVR Stack[/url] (this section needs you to log in)

[url=]ICU - International Components for Unicode - portable Unicode libraries[/url]

[url= routines for the AVR[/url] hand crafted and reported to be quite good.
Also check out [url='s Algorithm[/url]. For some cases, several calls to a Goertzel is cheaper than an FFT.

[url=http://www.danoneverythingelse.c...'s Simplest XML Parser (in C++)[/url]

Other pages with AVR links:

[url= Embedded Microcontroller Resources[/url]

The above tutorials may not answer all your questions, but they will allow you to get further faster. You'll be able to ask better questions!

That should hold ya for a while! :D

As always, if you have a question that is not answered in one of the tutorials above, ask in the appropriate AVRFreaks community.

Hope this helps!


PS: For lighter reading, here's [url="Real Programmers Don't Eat Quiche"[/url]. This is one of the summarized-and-updated versions of the full treatise [url=

Links last tested: 20100420

[cliff: I've made this "sticky" and locked it - if anyone wants to respond please start a new thread about this in AVR Forum]

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread [url= Start here![/url]