ATMEGA8L-8PJ Atmel, ATMEGA8L-8PJ Datasheet - Page 80
ATMEGA8L-8PJ
Manufacturer Part Number
ATMEGA8L-8PJ
Description
IC MCU AVR 8K 5V 8MHZ 28-DIP
Manufacturer
Atmel
Series
AVR® ATmegar
Specifications of ATMEGA8L-8PJ
Core Processor
AVR
Core Size
8-Bit
Speed
8MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
23
Program Memory Size
8KB (4K 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
Data Converters
A/D 6x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
28-DIP (0.300", 7.62mm)
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
- Current page: 80 of 302
- Download datasheet (6Mb)
Reusing the
Temporary High Byte
Register
Timer/Counter
Clock Sources
Counter Unit
80
ATmega8(L)
The following code examples show how to do an atomic write of the TCNT1 Register contents.
Writing any of the OCR1A/B or ICR1 Registers can be done by using the same principle.
Note:
The assembly code example requires that the r17:r16 Register pair contains the value to be writ-
ten to TCNT1.
If writing to more than one 16-bit register where the High byte is the same for all registers writ-
ten, then the High byte only needs to be written once. However, note that the same rule of
atomic operation described previously also applies in this case.
The Timer/Counter can be clocked by an internal or an external clock source. The clock source
is selected by the clock select logic which is controlled by the clock select (CS12:0) bits located
in the Timer/Counter Control Register B (TCCR1B). For details on clock sources and prescaler,
see
The main part of the 16-bit Timer/Counter is the programmable 16-bit bi-directional counter unit.
Figure 33 on page 81
Assembly Code Example
C Code Example
“Timer/Counter0 and Timer/Counter1 Prescalers” on page
TIM16_WriteTCNT1:
void TIM16_WriteTCNT1( unsigned int i )
{
}
; Save Global Interrupt Flag
in r18,SREG
; Disable interrupts
cli
; Set TCNT1 to r17:r16
out TCNT1H,r17
out TCNT1L,r16
; Restore Global Interrupt Flag
out SREG,r18
ret
unsigned char sreg;
unsigned int i;
/* Save Global Interrupt Flag */
sreg = SREG;
/* Disable interrupts */
_CLI();
/* Set TCNT1 to i */
TCNT1 = i;
/* Restore Global Interrupt Flag */
SREG = sreg;
1. See
“About Code Examples” on page 8
(1)
shows a block diagram of the counter and its surroundings.
(1)
73.
2486Z–AVR–02/11
Related parts for ATMEGA8L-8PJ
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
8-bit AVR with 8K Bytes In-System Programmable Flash
Manufacturer:
ATMEL [ATMEL Corporation]
Datasheet:
Part Number:
Description:
IC AVR MCU 8K 8MHZ 3V 32-QFN
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K 8MHZ 3V 28DIP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K LV 8MHZ COM 32TQFP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K LV 8MHZ IND 32TQFP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K LV 8MHZ COM 28-DIP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K LV 8MHZ IND 28-DIP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K LV 8MHZ COM 32-QFN
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC AVR MCU 8K LV 8MHZ IND 32-QFN
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
MCU AVR 8KB FLASH 8MHZ 32TQFP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
MCU AVR 8KB FLASH 8MHZ 32QFN
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC MCU AVR 8K 5V 8MHZ 32-TQFP
Manufacturer:
Atmel
Datasheet:
Part Number:
Description:
IC MCU AVR 8K 5V 8MHZ 32-QFN
Manufacturer:
Atmel
Datasheet: