ATmega164P Automotive Atmel Corporation, ATmega164P Automotive Datasheet - Page 96

no-image

ATmega164P Automotive

Manufacturer Part Number
ATmega164P Automotive
Description
Manufacturer
Atmel Corporation

Specifications of ATmega164P Automotive

Flash (kbytes)
16 Kbytes
Pin Count
44
Max. Operating Frequency
16 MHz
Cpu
8-bit AVR
# Of Touch Channels
16
Hardware Qtouch Acquisition
No
Max I/o Pins
32
Ext Interrupts
32
Usb Speed
No
Usb Interface
No
Spi
3
Twi (i2c)
1
Uart
2
Graphic Lcd
No
Video Decoder
No
Camera Interface
No
Adc Channels
8
Adc Resolution (bits)
10
Adc Speed (ksps)
15
Analog Comparators
1
Resistive Touch Screen
No
Temp. Sensor
No
Crypto Engine
No
Sram (kbytes)
1
Eeprom (bytes)
512
Self Program Memory
YES
Dram Memory
No
Nand Interface
No
Picopower
Yes
Temp. Range (deg C)
-40 to 125
I/o Supply Class
2.7 to 5.5
Operating Voltage (vcc)
2.7 to 5.5
Fpu
No
Mpu / Mmu
no / no
Timers
3
Output Compare Channels
6
Input Capture Channels
1
Pwm Channels
6
32khz Rtc
Yes
Calibrated Rc Oscillator
Yes
14.3.1
14.4
96
Timer/Counter Clock Sources
Atmel ATtiny24/44/84 [Preliminary]
Reusing the Temporary High Byte Register
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
written to TCNT1.
If when writing to more than one 16-bit register 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
Assembly Code Example
C Code Example
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
“Timer/Counter Prescaler” on page
“About Code Examples” on page
(1)
(1)
6.
120.
7701E–AVR–02/11

Related parts for ATmega164P Automotive