ATMEGA162-16PC Atmel, ATMEGA162-16PC Datasheet - Page 22

IC MCU AVR 16K 5V 16MHZ 40-DIP

ATMEGA162-16PC

Manufacturer Part Number
ATMEGA162-16PC
Description
IC MCU AVR 16K 5V 16MHZ 40-DIP
Manufacturer
Atmel
Series
AVR® ATmegar
Datasheets

Specifications of ATMEGA162-16PC

Core Processor
AVR
Core Size
8-Bit
Speed
16MHz
Connectivity
EBI/EMI, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
35
Program Memory Size
16KB (8K x 16)
Program Memory Type
FLASH
Eeprom Size
512 x 8
Ram Size
1K x 8
Voltage - Supply (vcc/vdd)
4.5 V ~ 5.5 V
Oscillator Type
Internal
Operating Temperature
0°C ~ 70°C
Package / Case
40-DIP (0.600", 15.24mm)
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
Data Converters
-
Preventing EEPROM
Corruption
22
ATmega162(V/U/L)
The next code examples show assembly and C functions for reading the EEPROM. The
examples assume that interrupts are controlled so that no interrupts will occur during
execution of these functions.
During periods of low V
age is too low for the CPU and the EEPROM to operate properly. These issues are the
same as for board level systems using EEPROM, and the same design solutions should
be applied.
An EEPROM data corruption can be caused by two situations when the voltage is too
low. First, a regular write sequence to the EEPROM requires a minimum voltage to
operate correctly. Secondly, the CPU itself can execute instructions incorrectly, if the
supply voltage is too low.
E EP R O M da ta c o r r up ti on ca n e as i l y b e av o id ed by fo ll o wi ng t hi s de si g n
recommendation:
Keep the AVR RESET active (low) during periods of insufficient power supply voltage.
This can be done by enabling the internal Brown-out Detector (BOD). If the detection
level of the internal BOD does not match the needed detection level, an external low
V
progress, the write operation will be completed provided that the power supply voltage is
sufficient.
Assembly Code Example
C Code Example
CC
Reset Protection circuit can be used. If a Reset occurs while a write operation is in
EEPROM_read:
unsigned char EEPROM_read(unsigned int uiAddress)
{
}
; Wait for completion of previous write
sbic EECR,EEWE
rjmp EEPROM_read
; Set up address (r18:r17) in address register
out
out
; Start eeprom read by writing EERE
sbi
; Read data from data register
in
ret
/* Wait for completion of previous write */
while(EECR & (1<<EEWE))
/* Set up address register */
EEAR = uiAddress;
/* Start eeprom read by writing EERE */
EECR |= (1<<EERE);
/* Return data from data register */
return EEDR;
;
EEARH, r18
EEARL, r17
EECR,EERE
r16,EEDR
CC,
the EEPROM data can be corrupted because the supply volt-
2513C–AVR–09/02

Related parts for ATMEGA162-16PC