ATmega16M1 Automotive Atmel Corporation, ATmega16M1 Automotive Datasheet - Page 106
![no-image](/images/manufacturer_photos/0/0/79/atmel_corporation_sml.jpg)
ATmega16M1 Automotive
Manufacturer Part Number
ATmega16M1 Automotive
Description
Manufacturer
Atmel Corporation
Datasheets
1.AT90CAN128_AUTOMOTIVE.pdf
(225 pages)
2.ATMEGA16M1_AUTOMOTIVE.pdf
(12 pages)
3.ATMEGA16M1_AUTOMOTIVE.pdf
(25 pages)
4.ATMEGA16M1_AUTOMOTIVE.pdf
(367 pages)
Specifications of ATmega16M1 Automotive
Flash (kbytes)
16 Kbytes
Pin Count
32
Max. Operating Frequency
16 MHz
Cpu
8-bit AVR
# Of Touch Channels
12
Hardware Qtouch Acquisition
No
Max I/o Pins
27
Ext Interrupts
27
Usb Speed
No
Usb Interface
No
Spi
1
Uart
1
Can
1
Lin
1
Graphic Lcd
No
Video Decoder
No
Camera Interface
No
Adc Channels
11
Adc Resolution (bits)
10
Adc Speed (ksps)
125
Analog Comparators
4
Resistive Touch Screen
No
Dac Channels
1
Dac Resolution (bits)
10
Temp. Sensor
Yes
Crypto Engine
No
Sram (kbytes)
1
Eeprom (bytes)
512
Self Program Memory
YES
Dram Memory
No
Nand Interface
No
Picopower
No
Temp. Range (deg C)
-40 to 150
I/o Supply Class
2.7 to 5.5
Operating Voltage (vcc)
2.7 to 5.5
Fpu
No
Mpu / Mmu
no / no
Timers
2
Output Compare Channels
14
Input Capture Channels
1
Pwm Channels
10
32khz Rtc
No
Calibrated Rc Oscillator
Yes
106
Atmel ATtiny24/44/84 [Preliminary]
When changing the top value, the program must ensure that the new top value is higher or
equal to the value of all of the compare registers. If the top value is lower than any of the com-
pare registers, a compare match will never occur between TCNT1 and OCR1x. Note that
when using fixed top values, the unused bits are masked to zero when any of the OCR1x Reg-
isters are written
The procedure for updating ICR1 differs from that for updating OCR1A when used for defining
the top value. The ICR1 register is not double buffered. This means that if ICR1 is changed to
a low value when the counter is running with no or a low prescaler value, there is a risk that the
new ICR1 value written is lower than the current value of TCNT1. The result will then be that
the counter will miss the compare match at the top value. The counter will then have to count
to the max value (0xFFFF) and wrap around starting at 0x0000 before the compare match can
occur. The OCR1A register, however, is double buffered. This feature allows the OCR1A I/O
location to be written anytime. When the OCR1A I/O location is written, the value written will
be put into the OCR1A buffer register. The OCR1A compare register will then be updated with
the value in the buffer register at the next timer clock cycle when TCNT1 matches top. The
update is done on the same timer clock cycle on which TCNT1 is cleared and the TOV1 flag is
set.
Using the ICR1 register for defining top works well when using fixed top values. By using
ICR1, the OCR1A register is free to be used for generating a PWM output on OC1A. How-
ever, if the base PWM frequency is actively changed (by changing the top value), using the
OCR1A as top is clearly a better choice due to its double buffer feature.
In fast PWM mode, the compare units allow generation of PWM waveforms on the OC1x pins.
Setting the COM1x1:0 bits to two will produce a non-inverted PWM, and an inverted PWM out-
put can be generated by setting the COM1x1:0 to three (see
actual OC1x value will only be visible on the port pin if the data direction for the port pin is set
as output (DDR_OC1x). The PWM waveform is generated by setting (or clearing) the OC1x
register at the compare match between OCR1x and TCNT1, and clearing (or setting) the
OC1x register on the timer clock cycle on which the counter is cleared (changes from top to
bottom).
The PWM frequency for the output can be calculated by the following equation:
The variable N represents the prescaler divider (1, 8, 64, 256, or 1024).
The extreme values for the OCR1x register represent special cases when generating a PWM
waveform output in the fast PWM mode. If the OCR1x is set equal to bottom (0x0000), the out-
put will be a narrow spike for each top+1 timer clock cycle. Setting OCR1x equal to top will
result in a constant high or low output (depending on the polarity of the output set by the
COM1x1:0 bits.)
A frequency waveform output (with 50% duty cycle) in fast PWM mode can be achieved by
setting OC1A to toggle its logical level on each compare match (COM1A1:0 = 1). The wave-
form generated will have a maximum frequency of
(0x0000). This feature is similar to the OC1A toggle in CTC mode, except the double buffer
feature of the output compare unit is enabled in the fast PWM mode.
f
OCnxPWM
=
-------------------------------------
N
f
clk_I/O
1
+
TOP
1
A
= f
clk_I/O
/2 when OCR1A is set to zero
Table 14-2 on page
7701E–AVR–02/11
113). The