ATmega168PA Automotive Atmel Corporation, ATmega168PA Automotive Datasheet - Page 99
![no-image](/images/manufacturer_photos/0/0/79/atmel_corporation_sml.jpg)
ATmega168PA Automotive
Manufacturer Part Number
ATmega168PA Automotive
Description
Manufacturer
Atmel Corporation
- Current page: 99 of 225
- Download datasheet (4Mb)
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 ATmega168PA Automotive
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![ATmega168PA](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
Manufacturer:
Atmel Corporation
Datasheet:
![ATMEGA168PA-15MZ](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
Manufacturer:
ATMEL Corporation
Datasheet:
![ATMEGA168P-20AU](/photos/6/91/69154/313-32-tqfp_tmb.jpg)
Part Number:
Description:
MCU AVR 16K FLASH 20MHZ 32-TQFP
Manufacturer:
Atmel
Datasheet:
![ATmega168P](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
Manufacturer:
Atmel Corporation
Datasheet:
![ATMEGA168P-20MU](/images/manufacturer_photos/0/0/78/atmel_tmb.jpg)
Part Number:
Description:
MCU AVR 16K FLASH 20MHZ 32-QFN
Manufacturer:
Atmel
Datasheet:
![ATMEGA168P-20PU](/photos/7/21/72189/453-28-dip_tmb.jpg)
Part Number:
Description:
MCU AVR 16K FLASH 20MHZ 28-PDIP
Manufacturer:
Atmel
Datasheet:
![ATMEGA168P-20AN](/photos/6/91/69154/313-32-tqfp_tmb.jpg)
Part Number:
Description:
MCU AVR 16KB FLASH 20MHZ 32TQFP
Manufacturer:
Atmel
Datasheet:
![ATMEGA168P-20MQ](/images/manufacturer_photos/0/0/78/atmel_tmb.jpg)
Part Number:
Description:
MCU AVR 16K FLASH 20MHZ 32-QFN
Manufacturer:
Atmel
Datasheet:
![ATMEGA168P-20ANR](/photos/6/91/69154/313-32-tqfp_tmb.jpg)
Part Number:
Description:
IC MCU AVR 16K FLASH 32TQFP
Manufacturer:
Atmel
Datasheet:
![ATMEGA168P-W-11](/images/manufacturer_photos/0/0/78/atmel_tmb.jpg)
Part Number:
Description:
8-bit Microcontrollers - MCU Microcontroller
Manufacturer:
Atmel