– 131 Powerful Instructions – Most Single-clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation
– Up to 20 MIPS Throughput at 20 MHz
– On-chip 2-cycle Multiplier
• High Endurance Non-volatile Memory segments
– 16/32/64/128K Bytes of In-System Self-programmable Flash program memory
– Write/Erase Cycles: 10,000 Flash/ 100,000 EEPROM
– Data retention: 20 years at 85°C/ 100 years at 25°C
– Optional Boot Code Section with Independent Lock Bits
In-System Programming by On-chip Boot Program
True Read-While-Write Operation
– Programming Lock for Software Security
• JTAG (IEEE std. 1149.1 Compliant) Interface
– Boundary-scan Capabilities According to the JTAG Standard
– Extensive On-chip Debug Support
– Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG Interface
• Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Mode
– Real Time Counter with Separate Oscillator
– Six PWM Channels
– 8-channel, 10-bit ADC
Differential mode with selectable gain at 1x, 10x or 200x
– Byte-oriented Two-wire Serial Interface
– Two Programmable Serial USART
– Master/Slave SPI Serial Interface
– Programmable Watchdog Timer with Separate On-chip Oscillator
– On-chip Analog Comparator
– Interrupt and Wake-up on Pin Change
• Special Microcontroller Features
– Power-on Reset and Programmable Brown-out Detection
– Internal Calibrated RC Oscillator
– External and Internal Interrupt Sources
– Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby and
1.1Pinout - PDIP/TQFP/VQFN/QFN/MLF for ATmega164PA/324PA/644PA/1284P
Figure 1-1.Pinout
8152GS–AVR–11/09
Note:The large center pad underneath the VQFN/QFN/MLF package should be soldered to ground on
the board to ensure good mechanical stability.
2
ATmega164PA/324PA/644PA/1284P
Top viewBottom view
A1
B1
A2
B2
A3
B3
A4
B4
A5
B5
A6
A18
B15
A17
B14
A16
B13
A15
B12
A14
B11
A13
A12
B10
A11
B9
A10
B8A9 B7A8 B6
A7
A24
B20
A23
B19
A22
B18
A21
B17
A20
B16
A19
A18
B15
A17
B14
A16
B13
A15
B12
A14
B11
A13
A1
B1
A2
B2
A3
B3
A4
B4
A5
B5
A6
A19
B16
A20
B17
A21
B18
A22
B19
A23
B20
A24
1.2Pinout - DRQFN for ATmega164PA/324PA/644PA
Figure 1-2.DRQFN - Pinout
Table 1-1.DRQFN - Pinout
A1PB5A7PD3A13PC4A19PA 3
B1PB6B6PD4B11PC5B16PA 2
A2PB7A8PD5A14PC6A20PA 1
B2RESET
A3VCCA9PD7A15AVC CA21VCC
B3GNDB8VCCB13GNDB18GND
A4XTAL2A10GNDA16AREFA22PB0
B4XTAL1B9PC0B14PA 7B19PB1
A5PD0A11PC1A17PA 6A23PB2
B5PD1B10PC2B15PA 5B20PB3
8152GS–AVR–11/09
A6PD2A12PC3A18PA 4A24PB4
B7PD6B12PC7B17PA 0
3
ATmega164PA/324PA/644PA/1284P
A
B
C
D
E
F
G
1234567
A
B
C
D
E
F
G
7654321
Top viewBottom view
1.3Pinout - VFBGA for ATmega164PA/324PA/644PA
Figure 1-3.VFBGA - Pinout
Table 1-2.BGA - Pinout
1234567
AGNDPB4PB2GNDVCCPA2GND
BPB6PB5PB3PB0PA0PA3PA5
CVCCRESETPB7PB1PA1PA6AREF
DGNDXTAL2PD0GNDPA4PA7GND
EXTAL1PD1PD5PD7PC5PC7AVCC
FPD2PD3PD6PC0PC2PC4PC6
GGNDPD4VCCGNDPC1PC3GND
8152GS–AVR–11/09
4
2.Overview
CPU
GND
VCC
RESET
Powe r
Supervision
POR / BOD &
RESET
Watchdog
Oscillator
Watchdog
Timer
Oscillator
Circuits /
Clock
Generation
XTAL1
XTAL2
PORT A (8)
PORT D (8)
PD7..0
PORT C (8)
PC5..0
TWI
SPI
EEPROM
JTAG/OCD
16bit T/C 1
8bit T/C 2
8bit T/C 0
SRAMFLASH
USART 0
Internal
Bandgap reference
Analog
Comparator
A/D
Converter
PA7..0
PORT B (8)
PB7..0
USART 1
TOSC1/PC6TOSC2/PC7
The ATmega164PA/324PA/644PA/1284P is a low-power CMOS 8-bit microcontroller based on
the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle,
the ATmega164PA/324PA/644PA/1284P achieves throughputs approaching 1 MIPS per MHz
allowing the system designer to optimize power consumption versus processing speed.
2.1Block Diagram
Figure 2-1.Block Diagram
ATmega164PA/324PA/644PA/1284P
The AVR core combines a rich instruction set with 32 general purpose working registers. All the
32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent
registers to be accessed in one single instruction executed in one clock cycle. The resulting
architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC microcontrollers.
8152GS–AVR–11/09
5
ATmega164PA/324PA/644PA/1284P
The ATmega164PA/324PA/644PA/1284P provides the following features: 16/32/64/128K bytes
of In-System Programmable Flash with Read-While-Write capabilities, 512B/1K/2K/4K bytes
EEPROM, 1/2/4/16K bytes SRAM, 32 general purpose I/O lines, 32 general purpose working
registers, Real Time Counter (RTC), three flexible Timer/Counters with compare modes and
PWM, 2 USARTs, a byte oriented 2-wire Serial Interface, a 8-channel, 10-bit ADC with optional
differential input stage with programmable gain, programmable Watchdog Timer with Internal
Oscillator, an SPI serial port, IEEE std. 1149.1 compliant JTAG test interface, also used for
accessing the On-chip Debug system and programming and six software selectable power saving modes. The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, SPI port,
and interrupt system to continue functioning. The Power-down mode saves the register contents
but freezes the Oscillator, disabling all other chip functions until the next interrupt or Hardware
Reset. In Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops
the CPU and all I/O modules except Asynchronous Timer and ADC, to minimize switching noise
during ADC conversions. In Standby mode, the Crystal/Resonator Oscillator is running while the
rest of the device is sleeping. This allows very fast start-up combined with low power consumption. In Extended Standby mode, both the main Oscillator and the Asynchronous Timer continue
to run.
The device is manufactured using Atmel’s high-density nonvolatile memory technology. The Onchip ISP Flash allows the program memory to be reprogrammed in-system through an SPI serial
interface, by a conventional nonvolatile memory programmer, or by an On-chip Boot program
running on the AVR core. The boot program can use any interface to download the application
program in the application Flash memory. Software in the Boot Flash section will continue to run
while the Application Flash section is updated, providing true Read-While-Write operation. By
combining an 8-bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip,
the Atmel ATmega164PA/324PA/644PA/1284P is a powerful microcontroller that provides a
highly flexible and cost effective solution to many embedded control applications.
The ATmega164PA/324PA/644PA/1284P AVR is supported with a full suite of program and system development tools including: C compilers, macro assemblers, program
debugger/simulators, in-circuit emulators, and evaluation kits.
2.2Comparison Between ATmega164PA, ATmega324PA, ATmega644PA and ATmega1284P
Table 2-1.Differences between ATmega164PA, ATmega324PA and ATmega644PA and
ATmega1284P
DeviceFlashEEPROMRAM
ATmega164PA16 Kbyte512 Bytes1 Kbyte
ATmega324PA32 Kbyte1 Kbyte2 Kbyte
ATmega644PA64 Kbyte2 Kbyte4 Kbyte
ATmega1284P128 Kbyte4 Kbyte16 Kbyte
8152GS–AVR–11/09
6
2.3Pin Descriptions
2.3.1VCC
Digital supply voltage.
2.3.2GND
Ground.
2.3.3Port A (PA7:PA0)
Port A serves as analog inputs to the Analog-to-digital Converter.
Port A also serves as an 8-bit bi-directional I/O port with internal pull-up resistors (selected for
each bit). The Port A output buffers have symmetrical drive characteristics with both high sink
and source capability. As inputs, Port A pins that are externally pulled low will source current if
the pull-up resistors are activated. The Port A pins are tri-stated when a reset condition becomes
active, even if the clock is not running.
Port A also serves the functions of various special features of the
ATmega164PA/324PA/644PA/1284P as listed on page 81.
ATmega164PA/324PA/644PA/1284P
2.3.4Port B (PB7:PB0)
Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
Port B output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port B pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
Port B also serves the functions of various special features of the
ATmega164PA/324PA/644PA/1284P as listed on page 83.
2.3.5Port C (PC7:PC0)
Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
Port C output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port C pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
Port C also serves the functions of the JTAG interface, along with special features of the
ATmega164PA/324PA/644PA/1284P as listed on page 86.
2.3.6Port D (PD7:PD0)
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
Port D output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port D pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
8152GS–AVR–11/09
Port D also serves the functions of various special features of the
ATmega164PA/324PA/644PA/1284P as listed on page 88.
7
2.3.7RESET
2.3.8XTAL1
2.3.9XTAL2
2.3.10AVCC
2.3.11AREF
ATmega164PA/324PA/644PA/1284P
Reset input. A low level on this pin for longer than the minimum pulse length will generate a
reset, even if the clock is not running. The minimum pulse length is given in ”System and Reset
Characteristics” on page 330. Shorter pulses are not guaranteed to generate a reset.
Input to the inverting Oscillator amplifier and input to the internal clock operating circuit.
Output from the inverting Oscillator amplifier.
AVCC is the supply voltage pin for Port A and the Analog-to-digital Converter. It should be externally connected to V
to V
through a low-pass filter.
CC
This is the analog reference pin for the Analog-to-digital Converter.
, even if the ADC is not used. If the ADC is used, it should be connected
CC
8152GS–AVR–11/09
8
3.Resources
A comprehensive set of development tools, application notes and datasheetsare available for
download on http://www.atmel.com/avr.
4.About Code Examples
This documentation contains simple code examples that briefly show how to use various parts of
the device. Be aware that not all C compiler vendors include bit definitions in the header files
and interrupt handling in C is compiler dependent. Please confirm with the C compiler documentation for more details.
The code examples assume that the part specific header file is included before compilation. For
I/O registers located in extended I/O map, "IN", "OUT", "SBIS", "SBIC", "CBI", and "SBI" instructions must be replaced with instructions that allow access to extended I/O. Typically "LDS" and
"STS" combined with "SBRS", "SBRC", "SBR", and "CBR".
Note:1.
5.Data Retention
Reliability Qualification results show that the projected data retention failure rate is much less
than 1 PPM over 20 years at 85°C or 100 years at 25°C.
ATmega164PA/324PA/644PA/1284P
8152GS–AVR–11/09
9
Loading...
+ 21 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.