ATMEGA162-16PJ Atmel, ATMEGA162-16PJ Datasheet - Page 24

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

ATMEGA162-16PJ

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

Specifications of ATMEGA162-16PJ

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)
2.7 V ~ 5.5 V
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
40-DIP (0.600", 15.24mm)
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Data Converters
-
EEPROM Write During
Power-down Sleep
Mode
Preventing EEPROM
Corruption
24
ATmega162/V
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.
When entering Power-down sleep mode while an EEPROM write operation is active, the
EEPROM write operation will continue, and will complete before the write access time has
passed. However, when the write operation is complete, the Oscillator continues running, and as
a consequence, the device does not enter Power-down entirely. It is therefore recommended to
verify that the EEPROM write operation is completed before entering Power-down.
During periods of low V
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. Sec-
ondly, the CPU itself can execute instructions incorrectly, if the supply voltage is too low.
EEPROM data corruption can easily be avoided by following this design 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
can be used. If a Reset occurs while a write operation is in progress, the write operation will be
completed provided that the power supply voltage is sufficient.
Assembly Code Example
C Code Example
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:r1?) in address register
out
out
; Start eeprom read by w?iting EERE
sbi
; Read data from data re?ister
in
ret
/* Wait for completion o? previous write */
while(EECR & (1<<EEWE))
/* Set up address regist?r */
EEAR = uiAddress;
/* Start eeprom rea? 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 voltage is
CC
Reset Protection circuit
2513K–AVR–07/09

Related parts for ATMEGA162-16PJ