ATMEGA64A-MN Atmel, ATMEGA64A-MN Datasheet - Page 115

no-image

ATMEGA64A-MN

Manufacturer Part Number
ATMEGA64A-MN
Description
IC MCU AVR 64K FLASH 8QFN
Manufacturer
Atmel
Series
AVR® ATmegar
Datasheet

Specifications of ATMEGA64A-MN

Core Processor
AVR
Core Size
8-Bit
Speed
16MHz
Connectivity
I²C, SPI, UART/USART
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
*
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
8160C–AVR–07/09
It is important to notice that accessing 16-bit registers are atomic operations. If an interrupt
occurs between the two instructions accessing the 16-bit register, and the interrupt code
updates the temporary register by accessing the same or any other of the 16-bit timer registers,
then the result of the access outside the interrupt will be corrupted. Therefore, when both the
main code and the interrupt code update the temporary register, the main code must disable the
interrupts during the 16-bit access.
The following code examples show how to do an atomic read of the TCNTn Register contents.
Reading any of the OCRnA/B/C or ICRn Registers can be done by using the same principle.
Note:
Assembly Code Example
C Code Example
TIM16_ReadTCNTn:
unsigned int TIM16_ReadTCNTn( void )
{
}
; Save global interrupt flag
in
; Disable interrupts
cli
; Read TCNTn into r17:r16
in
in
; Restore global interrupt flag
out SREG,r18
ret
unsigned char sreg;
unsigned int i;
/* Save global interrupt flag */
sreg = SREG;
/* Disable interrupts */
_CLI();
/* Read TCNTn into i */
i = TCNTn;
/* Restore global interrupt flag */
SREG = sreg;
return i;
1. See “About Code Examples” on page 8.
r18,SREG
r16,TCNTnL
r17,TCNTnH
The assembly code example returns the TCNTn value in the r17:r16 register pair.
(1)
(1)
ATmega64A
115

Related parts for ATMEGA64A-MN