Amigo represents my noodlings using Atmel AVR ATmegas, the AVR tool chain, Arduino, FreeRTOS, AVR Studio 5.1, the AVRISP mkII in-system programmer, and the AVR ONE! JTAG debugger.
- AVR ATmegas are eight-bit microcontrollers made by Atmel. Specifically I'm using ATmega328P and ATmega2560 microcontrollers.
- The AVR tool chain that I'm using includes the GNU GCC AVR C and C++ cross compilers, the AVR C library, and Eclipse with the AVR plug in.
- Arduino, an open-source electronics prototyping platform that allows you do inexpensively bring digital control, sensing, and complex behavior to your own hardware projects. Arduino includes an IDE and a library that makes it easy to write C++ code for its tiny Atmel microcontroller. And I do mean tiny: Arduino Uno, the current reference board, has thirty-two kilobytes of flash for executable code and just two kilobytes of static ram (SRAM) for data. But you'll be surprised what you can do in that amount of space. If you have your own small projects that could use a microcontroller, or if you want to teach embedded development to someone for the first time, this is the platform for you. I'm using two Arduino Uno boards, a Freetronics EtherTen Uno-clone, an Arduino Mega ADK, and two Freetronics EtherMega Mega-clones.
- FreeRTOS is a popular and widely-used open source (albeit non-GNU-compatible licensed) real-time operating system that has been ported to over thirty-one microcontrollers.
- AVR Studio is Atmel's integrated development environment for the AVRs, based on Microsoft's Visual Studio (so unfortunately it's a Windows-only tool). It supports both the AVRISP mkII in-system programmer and the AVR ONE! JTAG debugger, both of which I have.
My goals for this project boil down to these.
- Find an economical hardware and software platform on which to teach embedded and real-time software development, one that supports a gradual learning curve, accomodating beginners needing a gentle introduction and experienced developers who need to learn the advanced concepts used in commercial environments.
- Demonstrate that the object oriented software techniques, patterns, and architectures that I have seen evolve for embedded software development over the past two decades can be applied to small microcontrollers, especially those lacking a memory management unit, with limited memory and storage resources, and having low power consumption so that they might be used in battery or solar powered applications.
Amigo includes the following collateral.
- Amigo wraps an object-oriented C++ API around FreeRTOS that implements classes like Queue, Task, MutexSemaphore, PeriodicTimer, and the like.
- Amigo implements interrupt-driven device drivers with asynchronous APIs to the AVR USART (serial), SPI, and analog-to-digital converter (ADC) controllers.
- Amigo implements General Purpose I/O (GPIO) and Pulse Width Modulation (PWM) APIs.
- Amigo supports for the WizNET W5100 Ethernet/IP chip using the interrupt-driven SPI driver; the unit test illustrates how to do client and server internet connections.
- Amigo implements utilities on top of the FreeRTOS and device driver layers that simplify many common embedded programming chores.
- Amigo includes a main program unit test suite that verifies many of its features and illustrates how to use them with working examples.
- Amigo is extensively documented using Doxygen which can be used to convert the in-line API documentation to web pages, man pages, or a printable manual.
- Amigo's unit test suite has been run on a Freetronics EtherMega2560 board, and (with no changes) an Arduino Mega ADK board with an Ethernet Shield.
- (A minimal unit test but still multiasking using FreeRTOS has been ported and run to a Freetronics EtherTen board using the ATmega328p but I can't recommend it.)
- Amigo includes an optional modified version of the stk500v2 bootloader for the ATmega2560 that disables the watchdog timer (WDT) in its run-time initialization.
Amigo is licensed with the same modified Lesser GNU Public License as Desperado in order to make it easy to incorporated into embedded applications. FreeRTOS, with which Amigo must be statically linked, has it's own open source but non-GNU license.
Amigo can be found on GitHub here.
Here are some articles that my alter-ego Chip Overclock has written about Amigo, Arduino, and compatible hardware:
- Getting to Hello World with Arduino
- Pulse-Width Modulation with Arduino
- Can what you don't know hurt you?
- Remote Sensing with Arduino
- Another Tragic Victim of Electrostatic Discharge
- Wireless Remote Sensing with Arduino and Zigbee
- Arduino Data Types
- Arduino to Android on BeagleBoard via Zigbee
- Thinking Small with Arduino
- Power over Ethernet with Arduino
- Advanced Embedded C++ Development with Arduino
- Advanced Embedded C++ Development with Arduino II
- Hidden Variables: Arduino and AVR Microcontrollers
- Sunshine On My Arduino Makes Me Happy
- Getting from Power Up to Running Main in Arduino
- Small Town Big City
- Hitting a Moving Target While Flying Solo
- Learning By Doing
- All the Interesting Problems Are Scalability Problems