This page contains links and notes regarding development with the AVR MCUs. The notes are centered around the midsized MegaAVR devices.
Contents:
One-shot timer library
BDMicro - Simple Threads
AvrX Real Time Kernel
Arduino and TWI/I2C
AVR Interrupts
AVR221: Discrete PID controller on tinyAVR and megaAVR devices
I took the easy way out and purchased an AVR STK programmer from SparkFun PGM-00013 $12.95 which is a Olimex AVR-PG2. This is the AVR ISP with SI-Prog circuit from the PonyProg website. There are no current limit resistors or impedence matching. Cross my fingers it works and that I don't short out my parallel port! To program a ATMEGA part on a bread board I need to connect a crystal and power supply as shown on the PonyProg SI-Prog pages.
Contents:
Table of contents
General AVR Reference Sites
- AVR Freaks
- Psychogenic AVR Tutorials - Very good with lots of detail
- WebRing - AVR Hub
AVR Software References
Bourbon Street Software - AVR libraries including a preemptive threading libraryOne-shot timer library
BDMicro - Simple Threads
AvrX Real Time Kernel
Arduino and TWI/I2C
AVR Interrupts
AVR221: Discrete PID controller on tinyAVR and megaAVR devices
AVR Device Programming
Programmers make my head spin. Not because I don't understand them, but because there are dozens and all of them have various limitations. To be real honest I don't see much value in building or buying a more complex ISP programmer outside of the Atmel AVRISP mkII; the Atmel version is too low cost for others to compete. I think I will build a simple avrdude based LPT programmer to get started and then purchase the Atmel ISP. But who knows.Full featured Programmers
- Atmel AVRISP mkII - In System Programmer; $34 @ DigiKey
- Atmel ATSTK500 - Starter kit and development system; $79 @ DigiKey
Simple Breadboard Programmers
There are many examples of programmers available. For parallel port there are buffered and un-bufferred approaches. It may be important that a buffered version include current limiting resistors and cable impedance matching otherwise the buffer is too fast, causing ringing, and can source enough current to damage a parallel port. There is a tutorial thread on AVR Freaks that implies that the buffer might do more harm than good.- AVR Programmer - Very simple and serial port based; uses PonyProg
- ELM AVR Programmers - Good device compatibility chart; See the LPT ISP
- Protected PPPD - stk200 compatible; recommended on AVR Freaks
I took the easy way out and purchased an AVR STK programmer from SparkFun PGM-00013 $12.95 which is a Olimex AVR-PG2. This is the AVR ISP with SI-Prog circuit from the PonyProg website. There are no current limit resistors or impedence matching. Cross my fingers it works and that I don't short out my parallel port! To program a ATMEGA part on a bread board I need to connect a crystal and power supply as shown on the PonyProg SI-Prog pages.
Programming Software
AVR SW Development
There are as many AVR development environments as there are AVR developers. I personally find this really frustrating as I get started, but that is the down side of a large user community. I really don't want to waste my time with an overly simple development environment that will ultimately not support more complex tasks. Here are my notes as I start looking at the environments:IDE
I really like Eclipse. I use it for other Java and C++ development. I plan to start with Eclipse and see if it meets my needs.- Eclipse C++ AVR Plugin
- Using Eclipse as IDE for WinAVR compiler - Short tutorial
- WinAVR
Tool Chain
The entire gnu tool chain is included with WinAVR. Even if I use Eclipse, I will still install WinAVR to get the tool chain. Eventually, though, I might need to build the tool chain myself, under cygwin?, if I need a recent fix; it seems that WinAVR stays fairly far behind some of the tools.- Developing for the Atmel AVR Microcontroller on Linux - Compiling the tool chain
- Psychogenic: Let's build a toolchain
Compiler
- GNU Compiler Collection
- Psychogenic: Makefile Template - makefile tutorial and template
- Psychogenic: AVR-GCC Programming Guide
Debugging
Atmel has some good options for real-time debugging, but I don't want to spend several hundred dollars right now. I think I can debug with LEDs and a serial interface for now.- simulavr
- gdb - GNU Debugger
- Psychogenic: Simulating and Debugging AVR programs - Tutorial
Boot Loaders
OptiBoot - Used on recent ArduinoOS Environments
I really don't see me doing much with an AVR that will not ultimately need some type of concurrency even if it is just a couple of processes. Further I really don't want to write custom concurrency handling for every project. I plan to go with a slightly more complex (and less efficient) general OS even for simple projects. This fits my "cookie cutter" software reuse methodology (i.e. all project implement concurrency the same way so someone only needs to learn it one time). Contiki is my first choice since I need it for the FreakZ Zigbee stack anyway. Below are some that I'm considering:- FreeRTOS - Good MegaAVR support; uIP port
- Contiki - Used by FreekZ Zigbe Stack; Includes uIP
- AvrX Real Time Kernel - Good option if the others are too big and slow
- Processing - Processing is not really for the device but rather a programing and execution environment for the PC that can be used to create PC interfaces to the microcontroller devices. An example of this technique is the Arduino Scope.
Libraries
- AVR libc
- binutils Source
- Procyon AVRlib - Careful it is GPL and so is your application if you use it
Last wiki comments