Loading...
 

AVR Development

This page contains links and notes regarding development with the AVR MCUs. The notes are centered around the midsized MegaAVR devices.

Contents:


General AVR Reference Sites

AVR Software References

Bourbon Street Software - AVR libraries including a preemptive threading library
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

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.

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.


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.

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.

Compiler

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.

Boot Loaders

OptiBoot - Used on recent Arduino

OS 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:

Libraries


Contributors to this page: michael .
Page last modified on Sunday 12 of February, 2012 12:43:26 CST by michael.