ATMEGA8L ATMEL [ATMEL Corporation], ATMEGA8L Datasheet - Page 78

no-image

ATMEGA8L

Manufacturer Part Number
ATMEGA8L
Description
8-bit AVR with 8K Bytes In-System Programmable Flash
Manufacturer
ATMEL [ATMEL Corporation]
Datasheets

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATMEGA8L-6AU
Manufacturer:
ATMEL
Quantity:
675
Part Number:
ATMEGA8L-8AC
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATMEGA8L-8AI
Manufacturer:
MICROCHIP
Quantity:
1 292
Part Number:
ATMEGA8L-8AI
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATMEGA8L-8AI
Manufacturer:
ATMEL
Quantity:
8 000
Part Number:
ATMEGA8L-8AI
Manufacturer:
ALTERA
0
Part Number:
ATMEGA8L-8AJ
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATMEGA8L-8AU
Manufacturer:
ATMEL
Quantity:
4 590
Part Number:
ATMEGA8L-8AU
Manufacturer:
Atmel
Quantity:
7 500
Part Number:
ATMEGA8L-8AU
Manufacturer:
ATMEL
Quantity:
591
Part Number:
ATMEGA8L-8AU
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Company:
Part Number:
ATMEGA8L-8AU
Quantity:
7
Company:
Part Number:
ATMEGA8L-8AU
Quantity:
7
78
ATmega8(L)
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 r18,SREG
; Disable interrupts
cli
; Read TCNT1 into r17:r16
in r16,TCNT1L
in r17,TCNT1H
; Restore Global Interrupt Flag
out SREG,r18
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.
(1)
(1)
2486M–AVR–12/03

Related parts for ATMEGA8L