ATMEGA164A-MCHR Atmel, ATMEGA164A-MCHR Datasheet - Page 28

IC MCU AVR 16K 20MHZ 44QFN

ATMEGA164A-MCHR

Manufacturer Part Number
ATMEGA164A-MCHR
Description
IC MCU AVR 16K 20MHZ 44QFN
Manufacturer
Atmel
Series
AVR® ATmegar
Datasheet

Specifications of ATMEGA164A-MCHR

Package / Case
44-VQFN Exposed Pad
Voltage - Supply (vcc/vdd)
1.8 V ~ 5.5 V
Operating Temperature
-40°C ~ 85°C
Speed
20MHz
Number Of I /o
32
Eeprom Size
512 x 8
Core Processor
AVR
Program Memory Type
FLASH
Ram Size
1K x 8
Program Memory Size
16KB (16K x 8)
Data Converters
A/D 8x10b
Oscillator Type
Internal
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Connectivity
I²C, SPI, UART/USART
Core Size
8-Bit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
8272A–AVR–01/10
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.
Note:
164A/164PA/324A/324PA/644A/644PA/1284/1284P
Assembly Code Example
C Code Example
EEPROM_read:
unsigned char EEPROM_read(unsigned int uiAddress)
{
}
; Wait for completion of previous write
sbic EECR,EEPE
rjmp EEPROM_read
; Set up address (r18:r17) in address register
out EEARH, r18
out EEARL, r17
; Start eeprom read by writing EERE
sbi EECR,EERE
; Read data from Data Register
in
ret
/* Wait for completion of previous write */
while(EECR & (1<<EEPE))
/* Set up address register */
EEAR = uiAddress;
/* Start eeprom read by writing EERE */
EECR |= (1<<EERE);
/* Return data from Data Register */
return EEDR;
1. See “About Code Examples” on page 9.
;
r16,EEDR
(1)
(1)
28

Related parts for ATMEGA164A-MCHR