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

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
-
Timer/Counter
Interrupt Mask
Register – TIMSK
154
ATmega162/V
• Bit 4 – OCIE2: Timer/Counter2 Output Compare Match Interrupt Enable
When the OCIE2 bit is written to one and the I-bit in the Status Register is set (one), the
Timer/Counter2 Compare Match interrupt is enabled. The corresponding interrupt is executed if
a Compare Match in Timer/Counter2 occurs, i.e., when the OCF2 bit is set in the Timer/Counter
Interrupt Flag Register – TIFR.
• Bit 2 – TOIE2: Timer/Counter2 Overflow Interrupt Enable
When the TOIE2 bit is written to one and the I-bit in the Status Register is set (one), the
Timer/Counter2 Overflow interrupt is enabled. The corresponding interrupt is executed if an
overflow in Timer/Counter2 occurs, i.e., when the TOV2 bit is set in the Timer/Counter Interrupt
Flag Register – TIFR.
Bit
Read/Write
Initial Value
cycles, it executes the interrupt routine, and resumes execution from the instruction
following SLEEP.
Reading of the TCNT2 Register shortly after wake-up from Power-save may give an
incorrect result. Since TCNT2 is clocked on the asynchronous TOSC clock, reading TCNT2
must be done through a register synchronized to the internal I/O clock domain.
Synchronization takes place for every rising TOSC1 edge. When waking up from Power-
save mode, and the I/O clock (clk
value (before entering sleep) until the next rising TOSC1 edge. The phase of the TOSC
clock after waking up from Power-save mode is essentially unpredictable, as it depends on
the wake-up time. The recommended procedure for reading TCNT2 is thus as follows:
1. Write any value to either of the registers OCR2 or TCCR2.
2. Wait for the corresponding Update Busy Flag to be cleared.
3. Read TCNT2.
During asynchronous operation, the synchronization of the Interrupt Flags for the
Asynchronous Timer takes three processor cycles plus one timer cycle. The Timer is
therefore advanced by at least one before the processor can read the Timer value causing
the setting of the Interrupt Flag. The output compare pin is changed on the Timer clock and
is not synchronized to the processor clock.
TOIE1
R/W
7
0
OCIE1A
R/W
6
0
OCIE1B
R/W
5
0
I/O
OCIE2
) again becomes active, TCNT2 will read as the previous
R/W
4
0
TICIE1
R/W
3
0
TOIE2
R/W
2
0
TOIE0
R/W
1
0
OCIE0
R/W
0
0
TIMSK
2513K–AVR–07/09

Related parts for ATMEGA162-16PJ