atmega64.pdf

(6314 KB) Pobierz
ATmega64
Features
High-performance, Low-power AVR ® 8-bit Microcontroller
Advanced RISC Architecture
– 130 Powerful Instructions – Most Single Clock Cycle Execution
– 32 x 8 General Purpose Working Registers + Peripheral Control Registers
– Fully Static Operation
– Up to 16 MIPS Throughput at 16 MHz
– On-chip 2-cycle Multiplier
High Endurance Non-volatile Memory segments
– 64K Bytes of In-System Reprogrammable Flash program memory
– 2K Bytes EEPROM
– 4K Bytes 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 64K Bytes Optional External Memory Space
– Programming Lock for Software Security
– SPI Interface for In-System Programming
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
– Two Expanded 16-bit Timer/Counters with Separate Prescaler, Compare Mode, and
Capture Mode
– Real Time Counter with Separate Oscillator
– Two 8-bit PWM Channels
– 6 PWM Channels with Programmable Resolution from 1 to 16 Bits
– 8-channel, 10-bit ADC
8 Single-ended Channels
7 Differential Channels
2 Differential Channels with Programmable Gain (1x, 10x, 200x)
– Byte-oriented Two-wire Serial Interface
– Dual Programmable Serial USARTs
– Master/Slave SPI Serial Interface
– Programmable Watchdog Timer with On-chip Oscillator
– On-chip Analog Comparator
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 Extended Standby
– Software Selectable Clock Frequency
– ATmega103 Compatibility Mode Selected by a Fuse
– Global Pull-up Disable
I/O and Packages
– 53 Programmable I/O Lines
– 64-lead TQFP and 64-pad QFN/MLF
Operating Voltages
– 2.7 - 5.5V for ATmega64L
– 4.5 - 5.5V for ATmega64
Speed Grades
– 0 - 8 MHz for ATmega64L
– 0 - 16 MHz for ATmega64
8-bit
Microcontroller
with 64K Bytes
In-System
Programmable
Flash
ATmega64
ATmega64L
2490P–AVR–07/09
245847391.212.png 245847391.223.png 245847391.234.png 245847391.245.png 245847391.001.png 245847391.012.png 245847391.023.png 245847391.034.png
 
ATmega64(L)
Pin
Configuration
Figure 1. Pinout ATmega64
TQFP/MLF
PEN
RXD0/(PDI) PE0
(TXD0/PDO) PE1
(XCK0/AIN0) PE2
(OC3A/AIN1) PE3
(OC3B/INT4) PE4
(OC3C/INT5) PE5
(T3/INT6) PE6
(ICP3/IN T7 ) PE7
(SS) PB0
(SCK) PB1
(MOSI) PB2
(MISO) PB3
(OC0) PB4
(OC1A) PB5
(OC1B) PB6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
PA3 (AD3)
PA4 (AD4)
PA5 (AD5)
PA6 (AD6)
PA7 (AD7)
PG2(ALE)
PC7 (A15)
PC6 (A14)
PC5 (A13)
PC4 (A12)
PC3 (A11)
PC2 (A10
PC1 (A9)
PC0 ( A8 )
PG1( RD )
PG0(WR)
Note: The bottom pad under the QFN/MLF package should be soldered to ground.
Disclaimer
Typical values contained in this data sheet are based on simulations and characterization of
other AVR microcontrollers manufactured on the same process technology. Min and Max values
will be available after the device is characterized.
2
2490P–AVR–07/09
245847391.055.png 245847391.066.png 245847391.077.png 245847391.088.png 245847391.099.png 245847391.110.png 245847391.121.png 245847391.132.png 245847391.143.png 245847391.154.png 245847391.165.png 245847391.176.png
 
ATmega64(L)
Overview
The ATmega64 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 ATmega64 achieves throughputs approaching 1 MIPS per MHz, allowing
the system designer to optimize power consumption versus processing speed.
Block Diagram
Figure 2. Block Diagram
PF0 - PF7
PA0 - PA7
PC0 - PC7
VCC
GND
PORTF DRIVERS
PORTA DRIVERS
PORTC DRIVERS
AVCC
DATA REGISTER
PORTF
DATA DIR.
REG. PORTF
DATA REGISTER
PORTA
DATA DIR.
REG. PORTA
DATA REGISTER
PORTC
DATA DIR.
REG. PORTC
8-BIT DATA BUS
XTAL1
AREF
CALIB. OSC
ADC
INTERNAL
OSCILLATOR
XTAL2
OSCILLATOR
JTAG TAP
PROGRAM
COUNTER
STACK
POINTER
WATCHDOG
TIMER
OSCILLATOR
ON-CHIP DEBUG
PROGRAM
FLASH
SRAM
MCU CONTROL
REGISTER
TIMING AND
CONTROL
RESET
BOUNDARY-
SCAN
INSTRUCTION
REGISTER
GENERAL
PURPOSE
REGISTERS
TIMER/
COUNTERS
PROGRAMMING
LOGIC
X
PEN
INSTRUCTION
DECODER
Y
INTERRUPT
UNIT
Z
CONTROL
LINES
ALU
EEPROM
STATUS
REGISTER
USART0
SPI
USART1
2-WIRE SERIAL
INTERFACE
DATA REGISTER
PORTE
DATA DIR.
REG. PORTE
DATA REGISTER
PORTB
DATA DIR.
REG. PORTB
DATA REGISTER
PORTD
DATA DIR.
REG. PORTD
DATA REG.
PORTG
DATA DIR.
REG. PORTG
PORTE DRIVERS
PORTB DRIVERS
PORTD DRIVERS
PORTG DRIVERS
PE0 - PE7
PB0 - PB7
PD0 - PD7
PG0 - PG4
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.
3
2490P–AVR–07/09
245847391.180.png 245847391.181.png 245847391.182.png 245847391.183.png 245847391.184.png 245847391.185.png 245847391.186.png 245847391.187.png 245847391.188.png 245847391.189.png 245847391.190.png 245847391.191.png 245847391.192.png 245847391.193.png 245847391.194.png 245847391.195.png 245847391.196.png 245847391.197.png 245847391.198.png 245847391.199.png 245847391.200.png 245847391.201.png 245847391.202.png 245847391.203.png 245847391.204.png 245847391.205.png 245847391.206.png 245847391.207.png 245847391.208.png 245847391.209.png 245847391.210.png 245847391.211.png 245847391.213.png 245847391.214.png 245847391.215.png 245847391.216.png 245847391.217.png 245847391.218.png 245847391.219.png 245847391.220.png 245847391.221.png 245847391.222.png 245847391.224.png 245847391.225.png 245847391.226.png 245847391.227.png 245847391.228.png 245847391.229.png 245847391.230.png 245847391.231.png 245847391.232.png 245847391.233.png 245847391.235.png 245847391.236.png 245847391.237.png 245847391.238.png 245847391.239.png 245847391.240.png 245847391.241.png 245847391.242.png 245847391.243.png 245847391.244.png 245847391.246.png 245847391.247.png 245847391.248.png 245847391.249.png 245847391.250.png 245847391.251.png 245847391.252.png 245847391.253.png 245847391.254.png 245847391.255.png 245847391.002.png 245847391.003.png 245847391.004.png 245847391.005.png 245847391.006.png 245847391.007.png 245847391.008.png 245847391.009.png 245847391.010.png 245847391.011.png 245847391.013.png 245847391.014.png 245847391.015.png 245847391.016.png 245847391.017.png 245847391.018.png 245847391.019.png 245847391.020.png 245847391.021.png 245847391.022.png 245847391.024.png 245847391.025.png 245847391.026.png 245847391.027.png 245847391.028.png 245847391.029.png 245847391.030.png 245847391.031.png 245847391.032.png 245847391.033.png 245847391.035.png 245847391.036.png 245847391.037.png 245847391.038.png 245847391.039.png 245847391.040.png 245847391.041.png 245847391.042.png 245847391.043.png 245847391.044.png 245847391.045.png 245847391.046.png 245847391.047.png 245847391.048.png 245847391.049.png 245847391.050.png 245847391.051.png 245847391.052.png 245847391.053.png 245847391.054.png 245847391.056.png 245847391.057.png 245847391.058.png 245847391.059.png 245847391.060.png 245847391.061.png 245847391.062.png 245847391.063.png 245847391.064.png 245847391.065.png 245847391.067.png 245847391.068.png 245847391.069.png 245847391.070.png 245847391.071.png 245847391.072.png 245847391.073.png 245847391.074.png 245847391.075.png 245847391.076.png 245847391.078.png 245847391.079.png 245847391.080.png 245847391.081.png 245847391.082.png 245847391.083.png 245847391.084.png 245847391.085.png 245847391.086.png 245847391.087.png 245847391.089.png 245847391.090.png 245847391.091.png 245847391.092.png 245847391.093.png 245847391.094.png 245847391.095.png 245847391.096.png 245847391.097.png 245847391.098.png 245847391.100.png 245847391.101.png 245847391.102.png 245847391.103.png 245847391.104.png 245847391.105.png 245847391.106.png 245847391.107.png 245847391.108.png 245847391.109.png 245847391.111.png 245847391.112.png 245847391.113.png 245847391.114.png 245847391.115.png 245847391.116.png 245847391.117.png 245847391.118.png 245847391.119.png 245847391.120.png 245847391.122.png 245847391.123.png 245847391.124.png 245847391.125.png 245847391.126.png 245847391.127.png 245847391.128.png 245847391.129.png 245847391.130.png 245847391.131.png 245847391.133.png 245847391.134.png 245847391.135.png 245847391.136.png 245847391.137.png 245847391.138.png 245847391.139.png 245847391.140.png 245847391.141.png 245847391.142.png 245847391.144.png 245847391.145.png 245847391.146.png 245847391.147.png 245847391.148.png 245847391.149.png 245847391.150.png 245847391.151.png 245847391.152.png 245847391.153.png 245847391.155.png 245847391.156.png 245847391.157.png 245847391.158.png 245847391.159.png 245847391.160.png 245847391.161.png 245847391.162.png 245847391.163.png 245847391.164.png 245847391.166.png 245847391.167.png 245847391.168.png 245847391.169.png 245847391.170.png 245847391.171.png 245847391.172.png 245847391.173.png 245847391.174.png
ATmega64(L)
The ATmega64 provides the following features: 64K bytes of In-System Programmable Flash
with Read-While-Write capabilities, 2K bytes EEPROM, 4K bytes SRAM, 53 general purpose I/O
lines, 32 general purpose working registers, Real Time Counter (RTC), four flexible Timer/Coun-
ters with compare modes and PWM, two USARTs, a byte oriented Two-wire Serial Interface, an
8-channel, 10-bit ADC with optional differential input stage with programmable gain, program-
mable 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 contin-
ues 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 crys-
tal/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 non-volatile memory technology. The
On-chip ISP Flash allows the program memory to be reprogrammed In-System through an SPI
serial interface, by a conventional non-volatile memory programmer, or by an On-chip Boot pro-
gram 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 ATmega64 is a powerful microcontroller that provides a highly-flexible
and cost-effective solution to many embedded control applications.
The ATmega64 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.
ATmega103 and
ATmega64
Compatibility
The ATmega64 is a highly complex microcontroller where the number of I/O locations super-
sedes the 64 I/O location reserved in the AVR instruction set. To ensure backward compatibility
with the ATmega103, all I/O locations present in ATmega103 have the same location in
ATmega64. Most additional I/O locations are added in an Extended I/O space starting from 0x60
to 0xFF (i.e., in the ATmega103 internal RAM space). These location can be reached by using
LD/LDS/LDD and ST/STS/STD instructions only, not by using IN and OUT instructions. The relo-
cation of the internal RAM space may still be a problem for ATmega103 users. Also, the
increased number of Interrupt Vectors might be a problem if the code uses absolute addresses.
To solve these problems, an ATmega103 compatibility mode can be selected by programming
the fuse M103C. In this mode, none of the functions in the Extended I/O space are in use, so the
internal RAM is located as in ATmega103. Also, the extended Interrupt Vectors are removed.
The ATmega64 is 100% pin compatible with ATmega103, and can replace the ATmega103 on
current printed circuit boards. The application notes “Replacing ATmega103 by ATmega128”
and “Migration between ATmega64 and ATmega128” describes what the user should be aware
of replacing the ATmega103 by an ATmega128 or ATmega64.
4
2490P–AVR–07/09
245847391.175.png 245847391.177.png
ATmega64(L)
ATmega103
Compatibility Mode
By programming the M103C Fuse, the ATmega64 will be compatible with the ATmega103
regards to RAM, I/O pins and Interrupt Vectors as described above. However, some new fea-
tures in ATmega64 are not available in this compatibility mode, these features are listed below:
One USART instead of two, asynchronous mode only. Only the eight least significant bits of
the Baud Rate Register is available.
One 16 bits Timer/Counter with two compare registers instead of two 16 bits Timer/Counters
with three compare registers.
Two-wire serial interface is not supported.
Port G serves alternate functions only (not a general I/O port).
Port F serves as digital input only in addition to analog input to the ADC.
Boot Loader capabilities is not supported.
It is not possible to adjust the frequency of the internal calibrated RC Oscillator.
The External Memory Interface can not release any Address pins for general I/O, neither
configure different wait states to different External Memory Address sections.
Only EXTRF and PORF exist in the MCUCSR Register.
No timed sequence is required for Watchdog Timeout change.
Only low-level external interrupts can be used on four of the eight External Interrupt sources.
Port C is output only.
USART has no FIFO buffer, so Data OverRun comes earlier.
The user must have set unused I/O bits to 0 in ATmega103 programs.
Pin Descriptions
VCC
Digital supply voltage.
GND
Ground.
Port A (PA7..PA0)
Port A is 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 ATmega64 as listed on page
73 .
Port 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 ATmega64 as listed on page
74 .
5
2490P–AVR–07/09
245847391.178.png 245847391.179.png
Zgłoś jeśli naruszono regulamin