Atmel Library Components List
Atmel Library Components List
ATmega128A
DATASHEET SUMMARY
Introduction
®
The Atmel ATmega128A 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 ATmega128A achieves throughputs close to
1MIPS per MHz. This empowers system designer to optimize the device for
power consumption versus processing speed.
Features
• High-performance, Low-power Atmel AVR 8-bit Microcontroller
• Advanced RISC Architecture
– 133 Powerful Instructions - Most Single-clock Cycle Execution
– 32 × 8 General Purpose Working Registers + Peripheral Control
Registers
– Fully Static Operation
– Up to 16MIPS Throughput at 16MHz
– On-chip 2-cycle Multiplier
• High Endurance Non-volatile Memory segments
– 128Kbytes of In-System Self-programmable Flash program
memory
– 4Kbytes EEPROM
– 4Kbytes Internal SRAM
– Write/Erase cycles: 10,000 Flash/100,000 EEPROM
– Data retention: 20 years at 85°C/100 years at 25°C(1)
– Optional Boot Code Section with Independent Lock Bits
• In-System Programming by On-chip Boot Program
• True Read-While-Write Operation
– Up to 64 Kbytes Optional External Memory Space
– Programming Lock for Software Security
– SPI Interface for In-System Programming
This is a summary document. A
complete document is available • JTAG (IEEE std. 1149.1 Compliant) Interface
on our Web site at – Boundary-scan Capabilities According to the JTAG Standard
www.atmel.com – Extensive On-chip Debug Support
Introduction......................................................................................................................1
Features.......................................................................................................................... 1
1. Description.................................................................................................................4
2. Configuration Summary............................................................................................. 5
3. Ordering Information..................................................................................................6
4. Block Diagram........................................................................................................... 7
6. Pin Configurations..................................................................................................... 9
6.1. Pin Descriptions............................................................................................................................9
7. Resources................................................................................................................12
8. Data Retention.........................................................................................................13
12. Errata.......................................................................................................................18
12.1. ATmega128A Rev. U.................................................................................................................. 18
1. Description
The Atmel 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.
The ATmega128A provides the following features: 128Kbytes of In-System Programmable Flash with
Read- While-Write capabilities, 4Kbytes EEPROM, 4Kbytes SRAM, 53 general purpose I/O lines, 32
general purpose working registers, Real Time Counter (RTC), four flexible Timer/Counters with compare
modes and PWM, 2 USARTs, one byte oriented Two-wire Serial Interface, an 8-channel, 10-bit ADC with
optional differential input stage with programmable gain, programmable Watchdog Timer with Internal
Oscillator, one 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 On-chip 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 ATmega128A is a powerful microcontroller that
provides a highly flexible and cost effective solution to many embedded control application
The ATmega128A 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.
Note:
1. This device can also be supplied in wafer form. Please contact your local Atmel sales office for
detailed ordering information and minimum quantities.
2. Pb-free packaging, complies to the European Directive for Restriction of Hazardous Substances
(RoHS directive). Also Halide free and fully Green.
3. Tape and Reel
Package Type
64A 64-lead, 14 × 14 × 1.0 mm, Thin Profile Plastic Quad Flat Package (TQFP)
64M1 64-pad, 9 × 9 × 1.0 mm, Quad Flat No-Lead/Micro Lead Frame Package (QFN/MLF)
SRAM
TCK
TMS
CPU
TDI
JTAG OCD
FLASH
TDO
PARPROG NVM
PEN programming EEPROM
PDI EEPROMIF
SERPROG
PDO
SCK
AD[7:0]
ExtMem A[15:8]
Clock generation RD/WR/ALE
XTAL1 D
8MHz 8MHz Power A
Crystal Osc Calib RC PA[7:0]
management T PB[7:0]
12MHz A
XTAL2
External External and clock I/O PC[7:0]
B PD[7:0]
RC Osc clock control U PORTS PE[7:0]
TOSC1
32.768kHz S PF[7:0]
1MHz int
XOSC PG[4:0]
osc
TOSC2
ExtInt INT[7:0]
VCC
Power Watchdog
Supervision Timer
RESET ADC ADC[7:0]
POR/BOD & AREF
GND RESET
Internal AIN0
Reference AIN1
AC ACO
ADCMUX
MISO
MOSI
SCK
SPI TC 0 OC0
(8-bit async)
SS
OC1A/B/C
SDA
TWI TC 1 T1
SCL (16-bit)
ICP1
RxD0
TxD0 USART 0 TC 2 T2
(8-bit) OC2
XCK0
RxD1 OC3A/B
TC 3
TxD1 USART 1 (16-bit) T3
XCK1 ICP3
PF5 (ADC5/TMS)
PF6 (ADC6/TDO)
PF4 (ADC4/TCK)
PF7 (ADC7/TDI)
Analog
PF0 (ADC0)
PF1 (ADC1)
PF2 (ADC2)
PF3 (ADC3)
Crystal/Osc
PA0 (AD0)
PA1 (AD1)
PA2 (AD2)
External Memory
AVCC
AREF
GND
GND
VCC
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
PEN 1 48 PA3 (AD3)
(RXD0/PDI) PE0 2 47 PA4 (AD4)
(TXD0/PDO) PE1 3 46 PA5 (AD5)
(XCK0/AIN0) PE2 4 45 PA6 (AD6)
(OC3A/AIN1) PE3 5 44 PA7 (AD7)
(OC3B/INT4) PE4 6 43 PG2 (ALE)
(OC3C/INT5) PE5 7 42 PC7 (A15)
(T3/INT6) PE6 8 41 PC6 (A14)
(ICP3/INT7) PE7 9 40 PC5 (A13)
(SS) PB0 10 39 PC4 (A12)
(SCK) PB1 11 38 PC3 (A11)
(MOSI) PB2 12 37 PC2 (A10)
(MISO) PB3 13 36 PC1 (A9)
(OC0) PB4 14 35 PC0 (A8)
(OC1A) PB5 15 34 PG1 (RD)
(OC1B) PB6 16 33 PG0 (WR)
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(OC2/OC1C) PB7
RESET
VCC
GND
(SCL/INT0) PD0
(SDA/INT1) PD1
(RXD1/INT2) PD2
(TXD1/INT3) PD3
(ICP1) PD4
(XCK1) PD5
(T1) PD6
(T2) PD7
(TOSC2) PG3
(TOSC1) PG4
XTAL2
XTAL1
Note: The Pinout figure applies to both TQFP and MLF packages. The bottom pad under the QFN/MLF
package should be soldered to ground.
6.1.1. VCC
Digital supply voltage.
6.1.10. RESET
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. Shorter
pulses are not guaranteed to generate a reset.
6.1.11. XTAL1
Input to the inverting Oscillator amplifier and input to the internal clock operating circuit.
6.1.12. XTAL2
Output from the inverting Oscillator amplifier.
6.1.13. AVCC
AVCC is the supply voltage pin for Port F and the A/D Converter. It should be externally connected to VCC,
even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter.
6.1.14. AREF
AREF is the analog reference pin for the A/D Converter.
6.1.15. PEN
PEN is a programming enable pin for the SPI Serial Programming mode, and is internally pulled high. By
holding this pin low during a Power-on Reset, the device will enter the SPI Serial Programming mode.
PEN has no function during normal operation.
11.1. 64A
PIN 1 B
e PIN 1 IDENTIFIER
E1 E
D1
D
C 0°~7°
A1 A2 A
L
COMMON DIMENSIONS
(Unit of measure = mm)
2010-10-20
TITLE DRAWING NO. REV.
2325 Orchard Parkway
64A, 64-lead, 14 x 14mm Body Size, 1.0mm Body Thickness,
San Jose, CA 95131 64A C
0.8mm Lead Pitch, Thin Prof le Plastic Quad Flat Package (TQFP)
Ma rked Pin# 1 I D
C SE ATING PLAN E
A1
TOP VIE W
A
K 0.08 C
L
Pin #1 Co rne r SIDE VIEW
D2
1 Option A Pin #1
Triangle
2
3 COMMON DIMENSIONS
(Unit of Measure = mm)
® ® ®
Atmel , Atmel logo and combinations thereof, Enabling Unlimited Possibilities , AVR , and others are registered trademarks or trademarks of Atmel Corporation in
U.S. and other countries. Other terms and product names may be trademarks of others.
DISCLAIMER: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any
intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND
CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED
OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND PROFITS, BUSINESS
INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED
OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this
document and reserves the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to
update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive
applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.
SAFETY-CRITICAL, MILITARY, AND AUTOMOTIVE APPLICATIONS DISCLAIMER: Atmel products are not designed for and will not be used in connection with any
applications where the failure of such products would reasonably be expected to result in significant personal injury or death (“Safety-Critical Applications”) without
an Atmel officer's specific written consent. Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the
operation of nuclear facilities and weapons systems. Atmel products are not designed nor intended for use in military or aerospace applications or environments
unless specifically designated by Atmel as military-grade. Atmel products are not designed nor intended for use in automotive applications unless specifically
designated by Atmel as automotive-grade.