ATMEGA645-16AI Atmel, ATMEGA645-16AI Datasheet - Page 24

IC AVR MCU FLASH 64K 5V 64TQFP

ATMEGA645-16AI

Manufacturer Part Number
ATMEGA645-16AI
Description
IC AVR MCU FLASH 64K 5V 64TQFP
Manufacturer
Atmel
Series
AVR® ATmegar
Datasheet

Specifications of ATMEGA645-16AI

Core Processor
AVR
Core Size
8-Bit
Speed
16MHz
Connectivity
SPI, UART/USART, USI
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
53
Program Memory Size
64KB (32K x 16)
Program Memory Type
FLASH
Eeprom Size
2K x 8
Ram Size
4K x 8
Voltage - Supply (vcc/vdd)
2.7 V ~ 5.5 V
Data Converters
A/D 8x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
64-TQFP, 64-VQFP
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATMEGA645-16AI
Manufacturer:
Atmel
Quantity:
10 000
2570M–AVR–04/11
Table 7-1.
The following code examples show one assembly and one C function for writing to the
EEPROM. The examples assume that interrupts are controlled (e.g. by disabling interrupts glob-
ally) so that no interrupts will occur during execution of these functions. The examples also
assume that no Flash Boot Loader is present in the software. If such code is present, the
EEPROM write function must also wait for any ongoing SPM command to finish.
The next code examples show assembly and C functions for reading the EEPROM. The exam-
ples assume that interrupts are controlled so that no interrupts will occur during execution of
these functions.
Symbol
EEPROM write (from CPU)
Assembly Code Example
C Code Example
EEPROM_write:
void EEPROM_write(unsigned int uiAddress, unsigned char ucData)
{
}
; Wait for completion of previous write
sbic EECR,EEWE
rjmp EEPROM_write
; Set up address (r18:r17) in address register
out EEARH, r18
out EEARL, r17
; Write data (r16) to Data Register
out EEDR,r16
; Write logical one to EEMWE
sbi EECR,EEMWE
; Start eeprom write by setting EEWE
sbi EECR,EEWE
ret
/* Wait for completion of previous write */
while(EECR & (1<<EEWE))
/* Set up address and Data Registers */
EEAR = uiAddress;
EEDR = ucData;
/* Write logical one to EEMWE */
EECR |= (1<<EEMWE);
/* Start eeprom write by setting EEWE */
EECR |= (1<<EEWE);
;
EEPROM Programming Time
Number of Calibrated
RC Oscillator Cycles
27,072
ATmega325/3250/645/6450
Typical Programming Time
3.4ms
24

Related parts for ATMEGA645-16AI