ATmega16M1 Automotive Atmel Corporation, ATmega16M1 Automotive Datasheet - Page 99

no-image

ATmega16M1 Automotive

Manufacturer Part Number
ATmega16M1 Automotive
Description
Manufacturer
Atmel Corporation

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
14.6.1
14.6.2
14.6.3
7701E–AVR–02/11
Input Capture Trigger Source
Noise Canceller
Using the Input Capture Unit
The ICR1 register can only be written when using a waveform generation mode that utilizes
the ICR1 register for defining the counter's top value. In these cases the waveform generation
mode (WGM13:0) bits must be set before the top value can be written to the ICR1 register.
When writing the ICR1 register, the high byte must be written to the ICR1H I/O location before
the low byte is written to ICR1L.
For more information on how to access the 16-bit registers refer to
ters” on page
The main trigger source for the input capture unit is the input capture pin (ICP1). Timer/coun-
ter 1 can alternatively use the analog comparator output as trigger source for the input capture
unit. The analog comparator is selected as trigger source by setting the analog comparator
input capture (ACIC) bit in the analog comparator control and status register (ACSR). Be
aware that changing the trigger source can trigger a capture. The input capture flag must,
therefore, be cleared after the change.
Both the input capture pin (ICP1) and the analog comparator output (ACO) are sampled using
the same technique as for the T1 pin
identical. However, when the noise canceller is enabled, additional logic is inserted before the
edge detector, which increases the delay by four system clock cycles. Note that the inputs of
the noise canceller and edge detector are always enabled unless the timer/counter is set in a
waveform generation mode that uses ICR1 to define top.
An input capture can be triggered by software by controlling the port of the ICP1 pin.
The noise canceller improves noise immunity by using a simple digital filtering scheme. The
noise canceller input is monitored over four samples, and all four must be equal to change the
output, which in turn is used by the edge detector.
The noise canceller is enabled by setting the input capture noise canceller (ICNC1) bit in
timer/counter control register B (TCCR1B). When enabled, the noise canceller introduces an
additional four system clock cycles of delay between a change applied to the input and the
update of the ICR1 register. The noise canceller uses the system clock, and is, therefore, not
affected by the prescaler.
The main challenge when using the input capture unit is to assign enough processor capacity
for handling the incoming events. The time between two events is critical. If the processor has
not read the captured value in the ICR1 register before the next event occurs, the ICR1 will be
overwritten with a new value. In this case the result of the capture will be incorrect.
When using the input capture interrupt, the ICR1 register should be read as early in the inter-
rupt handler routine as possible. Even though the input capture interrupt has relatively high
priority, the maximum interrupt response time is dependent on the maximum number of clock
cycles it takes to handle any of the other interrupt requests.
Using the input capture unit in any mode of operation when the top value (resolution) is
actively changed during operation is not recommended.
94.
Atmel ATtiny24/44/84 [Preliminary]
(Figure 15-1 on page
120). The edge detector is also
“Accessing 16-bit Regis-
99

Related parts for ATmega16M1 Automotive