Getting Started with the Botgoodies AM128 Development Board
AM128 Rev.0 Feb. 2002
What you need in addition to the AM128 development board:
- A 7 - 30 volt DC power supply with a center positive jack
- An ISP or JTAG programmer. ISP programmers available are the Atmel STK500, the Atmel AVR - ISP, home-built parallel port programmer. Requires a six pin interface.
- A serial cable (9 pin Dsub M x 9 pin Dsub F is ideal).
- Spare RS-232 serial port, ideally good for up to 115K Baud.
Documentation AvailableRefer to the accompanying CD for schematic, header pin-out, additional reference material on the ATMEGA128.
Take a look at Atmels web page (www.atmel.com) and AVRFreaks (www.avrfreaks.com) for lots of information.
Start it Up!
The AM128 is shipped with a test program in flash. As soon as you connect power, the red LED should begin to flash. Connect the RS-232 port to your PC and run a terminal program, such as HyperTerminal, with a setting of 19200 Baud, 8-N-1, no flow control. You should see a series of numbers going past. Reset the board to see the start up message. You can control the LED flash speed with the + and - keys, and change the print mode with the space bar.
Now What?
You'll want to get your programmer talking to the board. I am assuming that you are using an ISP programmer (the board is not yet tested with the JTAG interface) with AVR Studio as your interface software. Connect your ISP programmer to the six pin header on the board. Be sure pin 1 of your programmer is connected to pin 1 on the board (identified with a dot). With power on the board, run the programmer in AVR Studio. It should pop up indicating it is communicating with an AVR device. Change the device to ATMEGA128. Read the Signature under the "Advanced" tab and it should say "Signature matches device type" if all is well.
If this is working you can now download programs to the AVR flash.
Programming
You need to decide what language and dialect you are going to program your AVR with. I am assuming that if you are using a high end device like the ATMEGA128 that you are not going to program in assembly language. The majority of AVR programmers use C, a few use basic. I am partial to C myself and know little of the AVR Basics, so I will concentrate on C.
You will require a compiler, basically a program that takes C code and produces an AVR machine readable file. There are several compilers available. GCC is a public domain, free, compiler that works very well. This is what I use. The latest GCC port (Version 3.2) directly supports the ATMEGA128. There are commercial compilers available from Imagecraft and from Codevision that will likely be easier to use if you're starting out.
I have included a few GCC sample files on the CD.
If you are new to programming you need to do some research. Go to www.AVRFreaks.com and look around. I noticed an article discussing the various C compilers. There are forums that discuss most aspects of using AVR micros. You'll need to learn C. Get a copy of Kernighan and Ritchies "The C Programming Language" and dig in. C is a great language for microcontrollers. It has a bit of a learning curve but its worth the effort.
What can I do with it?
I designed the AM128 board for use as a robotics controller. I use two 32 pin wire-wrap female headers on the main circuit board to connect my AM128 and use wire wrap techniques to connect to sensors, motor controllers, microphones, compasses, RF wireless devices, etc.
You can also use breadboard connectors to connect to a breadboard for testing a simple design.
So you can see, the board can be used as a test board for the 128 chip or it can be used as a standalone controller board in a finished product.
AM128 Design Features
- Atmel ATMEGA128-16AC microcontroller
- 14.7456 MHz crystal in socket for easy replacement.
- 32.768 KHz oscillator for use as RTC. The two inputs are wired to the main headers and can be used as regular I/O if you remove the crystal.
- Reset button
- RS-232 interface good to 250 KBaud using a MAX221, with receive jumper disconnect, D-Sub 9 pin female connector. Since the ISP programming interface uses the UART0 lines there could be interference with the ISP programmer by whatever is connected to the RS-232 interface. Remove the jumper to prevent this.
- ISP interface - 6 pin for programming - standard Atmel pin-out.
- JTAG interface - 10 pin for programming / debugging (not yet tested - need feedback!)
- 78M05 regulator, good for 500 mA at 5 volts with 7 to 30 volts input, or feed external regulated 5 VDC power via either 32 pin header.
- Power jack (2.0 mm pin, center positive) - plug a 7 to 30V DC wall wart directly into the board
- Power LED - green
- Power disconnect jumper for board current draw testing
- Run LED connected to PD5 - Red
- Ground test point
- Proper analog supply with inductor and capacitor filtration
- Spare 28 TSSO surface mount device pattern
- Two 32 pin headers on 1.5" spacing connecting most CPU pins.
- Above board header pin extensions for attaching scope probes, jumpers and wire wrapping.
- Board dimensions 1.75" x 2.85"
The board is shipped with the following fuse settings:ATMEGA103 compatibility mode - off
JTAG interface - off
Boot flash section size - 4096
Brown out detection level - 4 Volts (actually 4.5 if you read the ATMEGA128 documentation)
Brown out detection - enabled
External Crystal/Resonator High Frequency, Start up time 16K Clk + 0The board does not include a microprocessor supervisor IC as the board has built-in brown-out protection. There is provision on the board for a 3 pin TI TL7757CLP or equivalent.
Troubleshooting
- Be careful changing the fuses. There are settings that won't allow you to startup again.
- The boards are fully tested before shipping. If you can't get anything talking it's probably the interface to the board. Check the pinouts on your interface cable.
- Be careful with the header pins - don't set the board on a metal surface, for instance as you could create a short that could damage the board.
- It is important to get to a stable development environment. Microcontroller development systems are complex and there are many places that can cause unexpected results. Get an environment that works and then stick with it. Only change one thing at a time.
- Have a simple test program that you can download to see if the basics are working. Then move on from there.
- Is the micro alive: can the ISP interface to it? Is there 5V power? Try another crystal. Is your ISP programmer working - do you have other devices to try it with?
- The AVR chips are pretty tough. I haven't ruined one yet and I have a bad track record with electronics. It's most likely something else.