Wednesday, January 02, 2008

Getting started with Atmel ATMEGA8-16

I mentioned in a previous post that I've been interested in learning about the Atmel AVR microcontrollers.

To get started I purchased an already constructed Arduino board and had a good experience using it's USB/Serial programming from my Mac.

I don't feel satisfied until a controller board has been built from components, here's what I did.
  • Purchased an ATMEGA8-16 from the local Jaycar for AU$19.95
  • Built a minimal circuit based on the Arduino but without the USB stuff.
    • I kept the power LED and bypass capacitors but that's all
  • Built a simple PC Parallel port programmer based on this circuit (yes, just two resistors!)
  • On a Fedora 8 machine, did "yum install avr-gcc avr-libc avrdude"
  • Add your user to /etc/groups under the lp group so you can access the parallel port
  • I followed the excellent instructions by The Real Elliot here to get a sample program going and make a Makefile.
One thing that caught me for a while is that while plugged in to the programmer, the chip doesn't run. I'm sure I can fix that by adjusting the reset line or something.

I've also changed the fuses on a chip so that I now get "avrdude: AVR device not responding", still trying to figure out how to get out of that issue.. All good fun.

2 comments:

Anonymous said...

Hi Peter,
You said the chip doesn't run while it is plugged into the computer, do you mean you can't program it or you can program it but have to unplug the serial cable to get it to work?

Jim

Peter Marks said...

The programmer pulls the reset pin low during programming and sometimes I think it continues to stay low so the chip doesn't run after a burn.

However, it's intermittent for some reason. But yes, unplugging the programmer lets it run so it's just a bit annoying.

As I said, this is the absolutely simplest working programming cable so it's far from ideal.