Prototype Board for Atmel Mega32
Introduction
This page describes a prototype board for the Atmel Mega32 (PDIP) MCU. It includes
a power supply, crystal clock, RS232 interface and generous bypass capacitors.
A six-pin header allows flash memory programming from an STK500 or Atmel Dragon. All port pins are brought out to a single row of vias on 0.1 inch centers. A single 36 connection SIP machine-pin plug could be used to attach ths row to another board or to a solderless breadboard. All 32 port pins, plus Vcc, Aref and ground, are available. A separate interface is provided for serial communication.
The board layout is shown below. The ExpressPCB design file for v7/2008 is here and requires a free software download to modify or to order directly from expressPCB.
Construction suggestions:
- Study the photos below carefully. There are more photos of very similar (but older) boards near the end of the page.

- Generally mount the thinnest components first because the tall components get in the way of soldering flat components.
- First, solder all capacitors and resistors on the board.
See Hints
and Tips for prototyping with Surface Mount Devices, particularly the
pdf. Also good is SMT101.
- Note that there are two 1.0 uf capacitors. The rest are 0.1 uf.
- Add the regulator, power switch and power plug.
- If you are going to hardwire a battery to the board, then don't mount
the power plug.
- You could add a remote power switch, rather than mount one on the board.
- The power switch should lay flat, it should not be on edge (see photos).
- Test the power supply. Vcc should be 5 volts +/-0.05 volts.
Note that this board (unlike the STK500) requires 9-12 volts, DC, with positive on the power connector center pin. Applying negative voltage on the center pin will instantly destroy the regulator. You could protect yourself from yourself by cutting the trace between the positive power input and the switch and replacing it with a 1N4001 diode. If you use a remote on/off switch you could put the diode in the wires leading to the switch.
- Add the MCU socket and programming header. Always use a socket for the MCU.
- Add the 16 MHz crystal.
- You can add an (optional) reset button by connecting a normally-open pushbutton
between the two smll vias to the right of the programming header. When you close
the pushbutton, you short the RESET pin to ground.
- If you need serial communication add the RS232 driver socket, transmit/receive jumpers, and 9-pin RS232 connector (these double the cost of the board). Always use a socket for the MAX233 level shifter.
- I strongly suggest adding the LED and jumper for debugging. Toggling port pin D.2 will flash the LED to let you know that the MCU is running. If the LED is added, then this program will test the whole system. If the programmer throws a
fail to program flash error, then see the next bullet below for a fix.
- Some Mega32s are being shipped with the internal clock activated and set to 1 MHz. The symptom will be a
Failure to program flash error. To program these MCUs in Codevision you must:
- From the main Codevision window: Choose menu
Tools...Chip Programmer.
- In the resulting dialog box:
- set cpu clock to 1 MHz
- uncheck all fuse bits
- choose menu
Program...Fuse Bits
- set cpu clock back to 16 MHz
- close chip programmer dialog box
- The normal make/program dialog should now work.
- MCU clock fuzes:
- UNCHECK the clock select Fuze bits in the the "Project...Configure..AfterMake"
dialog window.
This is the same as you have been using for the STK-500.
- Setting the CKOPT fuze bit may make it easier to get a strong, stable
clock running, but uses more power.
- The A/D converter reference voltage, Aref, can be set (Bits 7:6
of ADMUX) to either 5.00 volts or 2.56 volts. You do not need to connect the Aref pin externally, unless you want to use some custom reference voltage.
- Test the MCU programming and execution by blinking the LED. You can flash
the chip from the STK500 as shown in the picture below.
- When attaching devices to the MCU, remember that port pins B.5, B.6 and
B.7 are used by the programmer.
If you drive these pins from an external source (such as the LCD display),
the chip will not program!

Parts list (Digikey part numbers):
- MEGA32-16PC Atmel microcontroller
- MAX233CPP dual RS232 interface.
- A2100-ND RS232 connector socket
- LM340LAZ-5.0 regulator
- CTX077 16 MHz crystal
- Switch SPDT surface mount AYZ0102AGRL 401-1001-1-ND
- 2.1 mm power plug CP-002A-ND
- 9 volt battery clip 84-6k-ND
- All resistors and capacitors are 1206 surface-mount packages
Other useful part numbers:
- SIP machine pin plug (m-m) Digikey ED2064-ND
- SIP machine pin socket (f-m) Jameco 78642: All Electronics SIP-30
- Single row header plug (m-m) Digikey WM6436-ND: All Electronics SHR-40
- Dual row header plug (m-m) Jameco 203888: All Electronics DHS-40
- Dual row header socket (f) Digikey 929975-01-36-ND
- Single row header socket (f) Digikey 929974-01-36-ND
- Radio Shack and Futurlec (Proto777) have good, cheap solder boards
- Flat flex 2-pin cable Digikey a9bba-0204f-nd
- 10k trimpots Digikey 3386f-103-nd
- Digikey custom cable connector (10 pin header socket to 14 pin DIP plug) RCC-1602-ND
- SparkFun has F-F jumpers (one SKU#: PRT-08430 and two wire SKU#: PRT-08614) and 2x5 IDC cables SKU#: PRT-08535.
ECE476 parts checkist
- RCA cables
- power supplies
- spools wire (at least 5 colors)
- solder stations -- solder/irons/magnifiers/glasses/lights
- two wire connectors
- 2x16 lcds -- about 30
- 9 v battery/clips
- electrial tape
- duct tape
- 40 pin sockets
- alligator clips/RSR
- white board/RSR
- 16 MHz crystals
- solder boards/RSR
- red/green/yel LED
- lm358
- 4001 diodes
- 2n3904/3906
- 4N35
- 22 pf caps
- 10k trimpots
- small screwdrivers
- wire stripers
- pliers
- rs232 straight-thru 6ft
Old versions
The ExpressPCB design file for v3/2006 is here and requires a free software download to modify or to order directly from expressPCB.
.
Images of the Revision 2 board (Spring 2005). The Rev2 board has solder mask, silk screen
and slightly improved placement of lettering. It also has one more connection
to port pin D7.



Images of the Revision 1 prototype board with MCU and RS232 interface mounted.



Copyright 2006- Cornell University