Results 1 to 8 of 8

Thread: What library for use with an ATmega168?

  1. What library for use with an ATmega168?

    Our local club is currently defining a kit based on a bare (28-pin DIP package) ATmega168. (We like the idea of cutting our teeth on a $2.50 chip rather than even a $20 controller board.) We're programming them with AVR-GCC (on a mixture of Mac, Windows, and Linux boxes). I've gotten to the blinky-light stage and am ready to take it further.

    So I'm looking around for a decent library to avoid reinventing the wheel when it comes to essentials like PWM, servo control, serial ports, I2C, etc. I've found three decent-looking possibilities:

    1. Procyon AVRlib. But note that the link here doesn't seem to be to the author's original site; that one is down, and discussions I've found here and there seem to indicate that this library is no longer being maintained, and may not compile cleanly with recent versions of AVR-GCC.

    2. Orangutan-lib. Looks perfect, except that we're using just the bare chip, not the Orangutan. How much grief is that going to cause me? (Keep in mind that I'm a newbie at embedded development, and may not understand what seems like a simple and obvious problem to you guys.)

    3. Pololu AVR C/C++ library. Looks very recent and well-documented, but also seems very Orangutan/3pi specific, and doesn't seem to include any servo functions or serial communications.

    So... what would you recommend in my situation?

    Thanks,
    - Joe

  2. #2
    Join Date
    May 2008
    Posts
    2,228
    Images
    155
    Rep Power
    132

    Re: What library for use with an ATmega168?

    You could also use the Arduino environment... just burn the bootloader on your chip and provide a level-shifted serial port:

    www.arduino.cc

    -Fergs

  3. #3
    Join Date
    Apr 2008
    Location
    Sacramento, CA, USA Area
    Posts
    5,341
    Rep Power
    182

    Re: What library for use with an ATmega168?

    Yupppers - that was going to be my suggestion too, Fergs. That also opens-up the "processing" language as well.
    I Void Warranties´┐Ż

  4. Re: What library for use with an ATmega168?

    Yes, I should have mentioned that we're aware of Arduino, but our current goal is to work directly in C.

    Any suggestions on C libraries for that?

    Thanks,
    - Joe

  5. #5
    Join Date
    May 2008
    Posts
    2,228
    Images
    155
    Rep Power
    132

    Re: What library for use with an ATmega168?

    Another option (not really a library though), is to reuse code from the Seattle Robotics Workshop program:

    http://seattlerobotics.org/WorkshopRobot/index.php

    -Fergs

  6. Re: What library for use with an ATmega168?

    I can't tell you what general purpose library to use, but I can show you this: http://www.obdev.at/products/avrusb/index.htm

    That is basically a firmware library that allows you to make a fully functioning USB device out of an atmega and a couple cheap RC components. I used this and an atmega168 to make a USB (rather than serial) microcontroller for my robot. There are a bunch of community examples, and you can check to see what other kinds of general atmega libraries they're using. If you have any other questions, ask away and I will try to answer them

  7. Re: What library for use with an ATmega168?

    My brother Dave has a pretty good environment set up for programming ATmegas in general. I use 168's with it all the time.

    http://svn.hylands.org/

    It also has library code for ARM-level devices, and a lot of the code is shared.

    Delays, Timers, UARTs, A/D, PWM, Servos, LCD, etc.
    "The best way to predict the future is to invent it." - Alan Kay, inventor of Smalltalk

  8. Re: What library for use with an ATmega168?

    You know, I forgot to mention this before... but rather than using the Arduino and its environment, if you want to work in direct C like I do, sometimes I'll take a piece of code from the arduino library and hack it a little bit (like servo libraries or whatever) to make it work with my code. This is kind of nice because there's a lot of reusable code in those files.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) CAD library of servos and standard parts?
    By milw in forum Robotics General Discussion
    Replies: 2
    Last Post: 07-21-2008, 09:04 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •