This schematic shows the AVR ATmega1284P-PU circuit as it was built on the test board in its own minimal circuit. The ATmega1284 is using an external crystal oscillator. According to Atmel, this is an upgrade to the ATmega32, but has 128k of flash, 16kB of SRAM, and 4kB of EEPROM. It is more versatile, having pin change interrupts, a second USART, and a higher maximum system clock of 20 MHz. They cost marginally less than their predecessors. The ATmega1284P is the largest of the series, in terms of memory. It is also the biggest that comes in a DIP package.
There is an ExpressPCB design file for a full 40-pin AVR development board, with schematics, that supports the ATmega16, ATmega32, ATmega164, ATmega324, ATmega644 and ATmega1284 microcontrollers in the 40-pin DIP (-P) package. If you want to change the analog reference from Vcc to an internally generated value, please read the datasheet. You can fry the part by changing the setting while the pin is hooked to Vcc.
Here you can find the current ATmega1284 datasheet
The pinout also applies to the ATmega164P-PU, ATmega324P-PU, and ATmega644P-PU