Project info for Orangutan WinAVR Library

Share This Created 3 Jan 2007 at 19:53 UTC by tbenedict, last modified 27 Apr 2007 at 22:31 UTC by tbenedict.



Pololu Robotics sells a neat line of controllers: Orangutan, Baby Orangutan, and Orangutan X2. I bought a Baby-O, which uses an Atmel ATMega168 as a processor, but had mixed luck finding example code for it. Later I bought an Orangutan, which also uses an Atmel ATMega168, but had even less luck finding example code that let me take advantage of the Orangutan's hardware. Back in the day I built one of Fred Martin's 68HC11 Miniboards. You could download a copy of a free version of ICC for it off of Fred's FTP site as well as a neat little library with enough commands to get you going: digital I/O, analog input, and code to control four DC motors in PWM mode with fifteen speeds in each direction. I can't say I ever built anything earth-shattering with it, but I can say the lack was with me, not with the tools Fred provided. That's more or less what I wanted for the Orangutan, but couldn't find it. Oh, code existed, all right. But because the Orangutans had evolved over time some of the earlier code wouldn't build right out of the box, other code made assumptions about clock speed that weren't valid (earlier Orangutans ran slower), and some of the code was under-commented and cryptic. So this project is my effort to provide people like me, who have never picked up an AVR or an Orangutan in their lives, with the tools they need to get going. As an added benefit, it'll also make my life easier down the road as I develop more applications for the Orangutan family of controllers. The library is written for AVR Studio with WinAVR as a backend compiler. It should be able to compile on any GCC-AVR installation, though, including installations on OS X and Linux (though I have not tested this and have no plans to do so at this time.) It's written specifically for the Orangutan and Baby Orangutan with code for the Orangutan X2 coming as soon as I can afford to pick one up. It's a work in progress, but it's available for download now. As new bits of the library are written, I'm also adding single-file examples that use just that bit of hardware or software. Not strictly necessary if you're using the library (hey, it's easier to do lcd_init(); lcd_string("Hello!"); than it is to read through the example file for the LCD), but for anyone who's got a similar device who wants to port the library or rip out the bits they're interested in, the examples may have some utility. I'm still gathering resources for writing the library. Additions to my bookshelf over the last few weeks include the ATMega168 datasheet as well as "Programming Microcontrollers in C" by Joe Pardue. Right now the command list for the library is pretty sparse. As I make my way through my new references, the command set will expand. The Subversion source tree is available on Sourceforge, as are packaged releases. The current rev, released 03/06/2007, is 0.2. Please let me know if you find the library useful, and what features you'd like to see. And if you build anything with your Orangutan, please post it to the Pololu forums! 27 April 2007 Update - I finally ordered a bunch of I2C and SPI hardware to do testing and development with. I've got my RS-232 level shifters in-hand, so I hope the last two "to be done" components of the library can be finished in the next couple of weeks. SPI is of particular importance because it looks like the new X2 controller will make a fair bit of use of the SPI interface. so it's important to have it ready and tested prior to X2 release. The code is also ready for another cleanup pass on the code and the comments to try to make it more readable. I picked up a nice tutorial off of AVR Freaks that has some good tips for making readable, rememberable code. It looks easy enough to try it out and see where Orangutan-lib stands. The next rev of Orangutan-lib (0.3) is going to have a new class of code: extensions. These are snippets that depend on another subsystem in order to function (like the QTI sensor code relies on the analog.c/.h code, Devantech sonar code relies on I2C, etc.) With the new SPI and I2C hardware coming in, I hope to go ahead and write the extensions for those devices, whether or not anyone else finds them useful. These will include an RTC, a digital port expander (same one that's used on the Mark III), a dual output DAC, all sorts of fun goodies. The next release should be good. Tom

License: GPL

This project has the following developers:

Share this page