ATTINY861A-MUR Atmel, ATTINY861A-MUR Datasheet - Page 80

no-image

ATTINY861A-MUR

Manufacturer Part Number
ATTINY861A-MUR
Description
MCU AVR 8KB FLASH 20MHZ 32QFN
Manufacturer
Atmel
Series
AVR® ATtinyr
Datasheet

Specifications of ATTINY861A-MUR

Core Processor
AVR
Core Size
8-Bit
Speed
20MHz
Connectivity
USI
Peripherals
Brown-out Detect/Reset, POR, PWM, Temp Sensor, WDT
Number Of I /o
16
Program Memory Size
8KB (4K x 16)
Program Memory Type
FLASH
Eeprom Size
512 x 8
Ram Size
512 x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 5.5 V
Data Converters
A/D 11x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
*
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
80
ATtiny261A/461A/861A
The following code examples show how to do an atomic read of the TCNT0 register contents.
Reading any of the OCR0 register can be done by using the same principle.
Note:
The assembly code example returns the TCNT0H/L value in the r17:r16 register pair.
Assembly Code Example
TIM0_ReadTCNT0:
C Code Example
unsigned int TIM0_ReadTCNT0( void )
{
}
; Save global interrupt flag
in r18,SREG
; Disable interrupts
cli
; Read TCNT0 into r17:r16
in r16,TCNT0L
in r17,TCNT0H
; Restore global interrupt flag
out SREG,r18
ret
unsigned char sreg;
unsigned int i;
/* Save global interrupt flag */
sreg = SREG;
/* Disable interrupts */
_CLI();
/* Read TCNT0 into i */
i = TCNT0L;
i |= ((unsigned int)TCNT0H << 8);
/* Restore global interrupt flag */
SREG = sreg;
return i;
See
“Code Examples” on page
6.
8197B–AVR–01/10

Related parts for ATTINY861A-MUR