ATTINY167-15XZ Atmel, ATTINY167-15XZ Datasheet - Page 114

MCU AVR 16K FLASH 15MHZ 20-TSSOP

ATTINY167-15XZ

Manufacturer Part Number
ATTINY167-15XZ
Description
MCU AVR 16K FLASH 15MHZ 20-TSSOP
Manufacturer
Atmel
Series
AVR® ATtinyr
Datasheet

Specifications of ATTINY167-15XZ

Core Processor
AVR
Core Size
8-Bit
Speed
16MHz
Connectivity
I²C, LIN, SPI, UART/USART, USI
Peripherals
Brown-out Detect/Reset, POR, PWM, Temp Sensor, WDT
Number Of I /o
16
Program Memory Size
16KB (8K x 16)
Program Memory Type
FLASH
Eeprom Size
512 x 8
Ram Size
512 x 8
Voltage - Supply (vcc/vdd)
2.7 V ~ 5.5 V
Data Converters
A/D 11x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 125°C
Package / Case
20-TSSOP
For Use With
ATSTK600-SOIC - STK600 SOCKET/ADAPTER FOR SOIC
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
114
ATtiny87/ATtiny167
The following code examples show how to do an atomic read of the TCNT1 Register contents.
Reading any of the OCR1A/B or ICR1 Registers can be done by using the same principle.
Note:
The assembly code example returns the TCNT1 value in the r17:r16 register pair.
Assembly Code Example
C Code Example
TIM16_ReadTCNT1:
unsigned int TIM16_ReadTCNT1(void)
{
}
; Save global interrupt flag
in
; Disable interrupts
cli
; Read TCNT1 into r17:r16
lds
lds
; Restore global interrupt flag
out
ret
unsigned char sreg;
unsigned int i;
/* Save global interrupt flag */
sreg = SREG;
/* Disable interrupts */
_CLI();
/* Read TCNT1 into i */
i = TCNT1;
/* Restore global interrupt flag */
SREG = sreg;
return i;
1. The example code assumes that the part specific header file is included.
r18,SREG
r16,TCNT1L
r17,TCNT1H
SREG,r18
(1)
(1)
7728G–AVR–06/10

Related parts for ATTINY167-15XZ